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/
346 stars 19 forks source link

system_server crash #3868

Open now0clock opened 3 weeks ago

now0clock commented 3 weeks ago
type: crash
SystemUptimeMs: 416878496
Process: system_server
Build: google/bramble/bramble:14/UP1A.231105.001.B2/2024080200:user/release-keys
Crash-Handler: com.android.internal.os.RuntimeInit$KillApplicationHandler
Loading-Progress: 1.0
Dropped-Count: 0

java.lang.OutOfMemoryError: Failed to allocate a 1096 byte allocation with 4432168 free bytes and 4328KB until OOM, target footprint 536870912, growth limit 536870912; giving up on allocation because <1% of heap free after GC.
    at android.util.ArrayMap.allocArrays(ArrayMap.java:279)
    at android.util.ArrayMap.put(ArrayMap.java:603)
    at android.service.notification.NotificationListenerService$RankingMap.<init>(NotificationListenerService.java:2286)
    at android.service.notification.NotificationRankingUpdate.<init>(NotificationRankingUpdate.java:53)
    at com.android.server.notification.NotificationManagerService.makeRankingUpdateLocked(NotificationManagerService.java:11600)
    at com.android.server.notification.NotificationManagerService$NotificationListeners.notifyRankingUpdateLocked(NotificationManagerService.java:13126)
    at com.android.server.notification.NotificationManagerService.handleSendRankingUpdate(NotificationManagerService.java:10338)
    at com.android.server.notification.NotificationManagerService.-$$Nest$mhandleSendRankingUpdate(NotificationManagerService.java:0)
    at com.android.server.notification.NotificationManagerService$WorkerHandler.handleMessage(NotificationManagerService.java:10414)
    at android.os.Handler.dispatchMessage(Handler.java:107)
    at android.os.Looper.loopOnce(Looper.java:232)
    at android.os.Looper.loop(Looper.java:317)
    at com.android.server.SystemServer.run(SystemServer.java:1024)
    at com.android.server.SystemServer.main(SystemServer.java:702)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:872)
thestinger commented 3 weeks ago

This is a real upstream bug but we can't determine what caused it from this. Does it happen for you more than once? If it was a one time issue, we'll just have to close it.

now0clock commented 3 weeks ago

It has happened sporadically. The device will become very laggy. Trying to tap the home, back, overview buttons, or pressing/holding the power button will be an extremely confusing, frustrating, buggy experience.

libalpm64 commented 2 weeks ago

Hello, this is with googles NotificationManagerService there is not a lot we can do at GrapheneOS. There things to note: the device was powered on for 4.8 days it's possible this might be a cause as over time the heap pool gets full or it's a memory leak with the notification service. The issue relates to your Heap reaching the max 536870912 bits (512 MB) servers memory got capped. I believe over time the pool gets full causing your device to go to a complete halt as there is no more memory which crashes the system_server service. Stopping the NotificationManagerService service and starting it again when this issue happens is the best solution I have.