GrapheneOS / os-issue-tracker

Issue tracker for GrapheneOS Android Open Source Project hardening work. Standalone projects like Auditor, AttestationServer and hardened_malloc have their own dedicated trackers.
https://grapheneos.org/
357 stars 21 forks source link

Possible out-of-memory results in delayed reboot until screen is off #2085

Closed SirCypher closed 1 year ago

SirCypher commented 1 year ago

Hi,

Sometimes my phone reboots and when I'm running 3 profiles simultaneously, but only when the screen is off. Might be an OOM situation. Shouldn't the OS usually (forcefully) close some user apps instead of letting this happen?

Events:

  1. An app (almost always something heavy like Vanadium or Firefox) will lag a lot and maybe crash. - This is the signal for me that the bug is triggered.
  2. As long as I do NOT turn off the screen everything appears to continue to work, or will work again after the lag is gone.
  3. When I now turn off the screen or let the auto-screen-off happen, then the phone will not react to the power button anymore. The screen will stay completely black.
  4. Around 10 to 20 seconds after the screen goes off, the usual "You are using a different OS" screen will show, suggesting the kernel crashed and the phone is now starting from a completely fresh boot.

Facts:

A few logs, revealing the killed processes:

$ cat logcat | grep -Ei 'tombstone|mem-pressure-event|libdebug'

04-05 16:58:42.365  1278  1377 W ActivityManager: Rescheduling restart of crashed service app.vanadium.webview/org.chromium.android_webview.services.MetricsBridgeService in 19994ms for mem-pressure-event
04-05 17:02:59.209   556   556 I tombstoned: intercept for pid 15343 and type kDebuggerdJavaBacktrace terminated: due to timeout
04-05 17:02:59.216  1278 17864 E system_server: libdebuggerd_client: failed to read status response from tombstoned: timeout reached?
04-05 17:02:59.217  1278 17864 E system_server: libdebuggerd_client: failed to get process tids
04-05 17:02:59.217  1278 17864 I system_server: libdebuggerd_client: started dumping process 15343
04-05 17:02:59.219   556   556 I tombstoned: registered intercept for pid 15343 and type kDebuggerdNativeBacktrace
04-05 17:02:59.219  1278 17864 E system_server: libdebuggerd_client: failed to send signal to pid 15343: No such process
04-05 17:02:59.219   556   556 I tombstoned: intercept for pid 15343 and type kDebuggerdNativeBacktrace terminated: due to input
04-05 17:02:59.232  1278 17864 I system_server: libdebuggerd_client: started dumping process 1278
04-05 17:02:59.233   556   556 I tombstoned: registered intercept for pid 1278 and type kDebuggerdJavaBacktrace
04-05 17:03:01.034   556   556 I tombstoned: received crash request for pid 1278
04-05 17:03:01.034   556   556 I tombstoned: found intercept fd 512 for pid 1278 and type kDebuggerdJavaBacktrace
04-05 17:03:01.037  1278  1309 I system_server: Wrote stack traces to tombstoned
04-05 17:03:01.037   556   556 W tombstoned: skipping tombstone file creation due to intercept
04-05 17:03:01.037  1278 17864 I system_server: libdebuggerd_client: done dumping process 1278
04-05 17:03:01.042  1278 17864 I system_server: libdebuggerd_client: started dumping process 20009
04-05 17:03:01.042   556   556 I tombstoned: registered intercept for pid 20009 and type kDebuggerdJavaBacktrace
04-05 17:03:02.072   556   556 I tombstoned: received crash request for pid 20009
04-05 17:03:02.072   556   556 I tombstoned: found intercept fd 512 for pid 20009 and type kDebuggerdJavaBacktrace
04-05 17:03:02.073 20009 20039 I org.dslul.openboard.inputmethod.latin: Wrote stack traces to tombstoned
04-05 17:03:02.074   556   556 W tombstoned: skipping tombstone file creation due to intercept
04-05 17:03:02.074  1278 17864 I system_server: libdebuggerd_client: done dumping process 20009
04-05 17:03:02.080  1278 17864 I system_server: libdebuggerd_client: started dumping process 3477
04-05 17:03:02.081   556   556 I tombstoned: registered intercept for pid 3477 and type kDebuggerdJavaBacktrace
04-05 17:03:02.514   556   556 I tombstoned: received crash request for pid 3477
04-05 17:03:02.514   556   556 I tombstoned: found intercept fd 512 for pid 3477 and type kDebuggerdJavaBacktrace
04-05 17:03:02.516  1278 17864 I system_server: libdebuggerd_client: done dumping process 3477
04-05 17:03:02.517  3477  3791 I com.android.nfc: Wrote stack traces to tombstoned
04-05 17:03:02.517   556   556 W tombstoned: skipping tombstone file creation due to intercept
04-05 17:03:02.520  1278 17864 I system_server: libdebuggerd_client: started dumping process 1858
04-05 17:03:02.521   556   556 I tombstoned: registered intercept for pid 1858 and type kDebuggerdJavaBacktrace
04-05 17:03:03.201   556   556 I tombstoned: received crash request for pid 1858
04-05 17:03:03.201   556   556 I tombstoned: found intercept fd 512 for pid 1858 and type kDebuggerdJavaBacktrace
04-05 17:03:03.203  1858  2146 I com.samsung.slsi.telephony.oemril: Wrote stack traces to tombstoned
04-05 17:03:03.203  1278 17864 I system_server: libdebuggerd_client: done dumping process 1858
04-05 17:03:03.203   556   556 W tombstoned: skipping tombstone file creation due to intercept
04-05 17:03:03.207  1278 17864 I system_server: libdebuggerd_client: started dumping process 1791
04-05 17:03:03.208   556   556 I tombstoned: registered intercept for pid 1791 and type kDebuggerdJavaBacktrace
04-05 17:03:03.938   556   556 I tombstoned: received crash request for pid 1791
04-05 17:03:03.938   556   556 I tombstoned: found intercept fd 512 for pid 1791 and type kDebuggerdJavaBacktrace
04-05 17:03:03.940  1278 17864 I system_server: libdebuggerd_client: done dumping process 1791
04-05 17:03:03.941  1791  2119 I com.android.se: Wrote stack traces to tombstoned
04-05 17:03:03.946  1278 17864 I system_server: libdebuggerd_client: started dumping process 1776
04-05 17:03:03.947   556   556 W tombstoned: skipping tombstone file creation due to intercept
04-05 17:03:03.947   556   556 I tombstoned: registered intercept for pid 1776 and type kDebuggerdJavaBacktrace
04-05 17:03:05.084   556   556 I tombstoned: received crash request for pid 1776
04-05 17:03:05.084   556   556 I tombstoned: found intercept fd 512 for pid 1776 and type kDebuggerdJavaBacktrace
04-05 17:03:05.086  1278 17864 I system_server: libdebuggerd_client: done dumping process 1776
04-05 17:03:05.086  1776  2084 I com.samsung.slsi.telephony.oem.oemrilhookservice: Wrote stack traces to tombstoned
04-05 17:03:05.095  1278 17864 I system_server: libdebuggerd_client: started dumping process 1835
04-05 17:03:05.087   556   556 W tombstoned: skipping tombstone file creation due to intercept
04-05 17:03:05.098   556   556 I tombstoned: registered intercept for pid 1835 and type kDebuggerdJavaBacktrace
04-05 17:03:05.608   556   556 I tombstoned: received crash request for pid 1835
04-05 17:03:05.608   556   556 I tombstoned: found intercept fd 512 for pid 1835 and type kDebuggerdJavaBacktrace
04-05 17:03:05.609  1278 17864 I system_server: libdebuggerd_client: done dumping process 1835
04-05 17:03:05.609  1835  2100 I com.shannon.imsservice: Wrote stack traces to tombstoned
04-05 17:03:05.609   556   556 W tombstoned: skipping tombstone file creation due to intercept
04-05 17:03:05.612  1278 17864 I system_server: libdebuggerd_client: started dumping process 1891
04-05 17:03:05.613   556   556 I tombstoned: registered intercept for pid 1891 and type kDebuggerdJavaBacktrace
04-05 17:03:06.296   556   556 I tombstoned: received crash request for pid 1891
04-05 17:03:06.296   556   556 I tombstoned: found intercept fd 512 for pid 1891 and type kDebuggerdJavaBacktrace
04-05 17:03:06.297  1891  2040 I com.android.phone: Wrote stack traces to tombstoned
04-05 17:03:06.297   556   556 W tombstoned: skipping tombstone file creation due to intercept
04-05 17:03:06.297  1278 17864 I system_server: libdebuggerd_client: done dumping process 1891
04-05 17:03:06.301  1278 17864 I system_server: libdebuggerd_client: started dumping process 1728
04-05 17:03:06.301   556   556 I tombstoned: registered intercept for pid 1728 and type kDebuggerdJavaBacktrace
04-05 17:03:06.555   556   556 I tombstoned: received crash request for pid 1728
04-05 17:03:06.555   556   556 I tombstoned: found intercept fd 512 for pid 1728 and type kDebuggerdJavaBacktrace
04-05 17:03:06.557  1278 17864 I system_server: libdebuggerd_client: done dumping process 1728
04-05 17:03:06.558  1728  1967 I com.android.networkstack.process: Wrote stack traces to tombstoned
04-05 17:03:06.558   556   556 W tombstoned: skipping tombstone file creation due to intercept
04-05 17:03:06.561  1278 17864 I system_server: libdebuggerd_client: started dumping process 1760
04-05 17:03:06.561   556   556 I tombstoned: registered intercept for pid 1760 and type kDebuggerdJavaBacktrace
04-05 17:03:07.053   556   556 I tombstoned: received crash request for pid 1760
04-05 17:03:07.053   556   556 I tombstoned: found intercept fd 512 for pid 1760 and type kDebuggerdJavaBacktrace
04-05 17:03:07.055  1278 17864 I system_server: libdebuggerd_client: done dumping process 1760
04-05 17:03:07.055  1760  2020 I com.shannon.qualifiednetworksservice: Wrote stack traces to tombstoned
04-05 17:03:07.055   556   556 W tombstoned: skipping tombstone file creation due to intercept
04-05 17:03:07.057  1278 17864 I system_server: libdebuggerd_client: started dumping process 1818
04-05 17:03:07.058   556   556 I tombstoned: registered intercept for pid 1818 and type kDebuggerdJavaBacktrace
04-05 17:03:07.789   556   556 I tombstoned: received crash request for pid 1818
04-05 17:03:07.790   556   556 I tombstoned: found intercept fd 512 for pid 1818 and type kDebuggerdJavaBacktrace
04-05 17:03:07.791  1278 17864 I system_server: libdebuggerd_client: done dumping process 1818
04-05 17:03:07.792  1818  1991 I com.shannon.rcsservice: Wrote stack traces to tombstoned
04-05 17:03:07.792   556   556 W tombstoned: skipping tombstone file creation due to intercept
04-05 17:03:07.799  1278 17864 I system_server: libdebuggerd_client: started dumping process 1637
04-05 17:03:07.799   556   556 I tombstoned: registered intercept for pid 1637 and type kDebuggerdJavaBacktrace
04-05 17:03:08.812  1278 17864 E system_server: libdebuggerd_client: failed to read status response from tombstoned: Try again
04-05 17:03:08.812   556   556 I tombstoned: intercept for pid 1637 and type kDebuggerdJavaBacktrace terminated: due to input
04-05 17:03:08.816  1278 17864 I system_server: libdebuggerd_client: started dumping process 1637
04-05 17:03:08.816   556   556 I tombstoned: registered intercept for pid 1637 and type kDebuggerdNativeBacktrace
04-05 17:03:09.069 17888 17888 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdNativeBacktrace
04-05 17:03:09.071   556   556 I tombstoned: received crash request for pid 1637
04-05 17:03:09.072   556   556 I tombstoned: found intercept fd 512 for pid 1637 and type kDebuggerdNativeBacktrace
04-05 17:03:09.109   556   556 I tombstoned: received crash request for pid 1637
04-05 17:03:09.122  1637  1667 I com.android.systemui: Wrote stack traces to tombstoned
04-05 17:03:09.123   556   556 E tombstoned: Traces for pid 1637 written to: trace_00
04-05 17:03:09.117   556   556 W tombstoned: type=1400 audit(0.0:1294672): avc: denied { read write } for dev="dm-45" ino=43146 scontext=u:r:tombstoned:s0 tcontext=u:object_r:anr_data_file:s0 tclass=file permissive=0
04-05 17:03:09.404  1278 17864 I system_server: libdebuggerd_client: done dumping process 1637
04-05 17:03:09.404   556   556 W tombstoned: skipping tombstone file creation due to intercept
04-05 17:03:09.441  1278 17864 E ActivityManager:   0% 556/tombstoned: 0% user + 0% kernel / faults: 151 minor 71 major

More detailed logs here: gos-crash-debug.log

Can you help me with this issue? If you have more questions please let me know!

Thank you very much and best regards

thestinger commented 1 year ago

Not able to replicate and there is no clear issue in the logs.

SirCypher commented 1 year ago

Just for future reference: I was able to work around this issue by switching from 3 user profiles to 2 user profiles + 1 work profile. The work profile is provided on the main profile by using the open-source "Shelter" app.