os-issue-tracker icon indicating copy to clipboard operation
os-issue-tracker copied to clipboard

system_server crash when switching users

Open katrinmichael opened this issue 1 year ago • 12 comments

type: crash
SystemUptimeMs: 3153052
Process: system_server
Build: google/oriole/oriole:14/AP2A.240605.024/2024061400:user/release-keys
Crash-Handler: com.android.internal.os.RuntimeInit$KillApplicationHandler
Loading-Progress: 1.0
Dropped-Count: 0

java.lang.RuntimeException: Keyguard is not shown in 20 seconds
	at com.android.server.am.UserController$Injector.lockDeviceNowAndWaitForKeyguardShown(UserController.java:3885)
	at com.android.server.am.UserController.startUserInternal(UserController.java:1832)
	at com.android.server.am.UserController.startUserNoChecks(UserController.java:1683)
	at com.android.server.am.UserController.startUser(UserController.java:1637)
	at com.android.server.am.UserController.startUser(UserController.java:1596)
	at com.android.server.am.UserController.startUserInForeground(UserController.java:1944)
	at com.android.server.am.UserController.handleMessage(UserController.java:3240)
	at android.os.Handler.dispatchMessage(Handler.java:103)
	at android.os.Looper.loopOnce(Looper.java:232)
	at android.os.Looper.loop(Looper.java:317)
	at android.os.HandlerThread.run(HandlerThread.java:85)
	at com.android.server.ServiceThread.run(ServiceThread.java:46)

After an update yesterday the pop up that the system sever has crashed. When I swap between the user then it takes longer to get back to the first one and the grapheneos logo is shown

katrinmichael avatar Jun 16 '24 06:06 katrinmichael

Try rebooting the device. There's a known upstream bug with user switching triggering this:

https://github.com/GrapheneOS/os-issue-tracker/issues/3208

Does it happen even after rebooting?

thestinger avatar Jun 16 '24 20:06 thestinger

Good evening,it still happens even after rebooting the device.--Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail gesendet.Am 16.06.24, 22:17 schrieb Daniel Micay @.***>:

Try rebooting the device. There's a known upstream bug with user switching triggering this: #3208 Does it happen even after rebooting? —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

katrinmichael avatar Jun 16 '24 20:06 katrinmichael

@katrinmichael Can you try turning off developer options if it's enabled? Seems different from the existing issue if it's not just a rare case.

thestinger avatar Jun 16 '24 21:06 thestinger

I am also observing similar issues as OP on my Pixel 7 after updating to the latest release on stable (2024061400). Whenever I want to switch from the Owner profile to a secondary profile the device will hang and crash then perform a soft reboot.

Yes this issue persists through reboots and turning off developer options doesn't seem to change anything. The only way I've been able to switch profiles is by creating a new profile each reboot and switch to my other secondary profile from there. You can switch from any secondary back to Owner but if you try to switch again from Owner to any secondary profile it will repeat the same behavior (hang, crash and reboot). Hope this helps.

alexl8819 avatar Jun 16 '24 22:06 alexl8819

@alexl8819 Can you try changing the lock method, maybe removing it and adding it back?

thestinger avatar Jun 16 '24 22:06 thestinger

@alexl8819 Can you try changing the lock method, maybe removing it and adding it back?

There is no lock method on the Owner profile. I removed the lock method on my main secondary and rebooted the device. Switched from Owner to my main secondary without any lock method and it seemed to work without issue. I then re-added my lock method on my secondary, switched back to Owner then back to my secondary and the same issue occurs again (hang, crash and reboot).

alexl8819 avatar Jun 16 '24 22:06 alexl8819

What if you do have a lock method on both?

thestinger avatar Jun 16 '24 22:06 thestinger

Works as intended with a lock method on both. Thanks.

alexl8819 avatar Jun 16 '24 22:06 alexl8819

Unlocking the first owner works and it works. I haven't switched it back.--Diese Nachricht wurde von meinem Android Mobiltelefon mit GMX Mail gesendet.Am 17.06.24, 00:46 schrieb Alex @.***>:

@alexl8819 Can you try changing the lock method, maybe removing it and adding it back?

There is no lock method on the Owner profile. I removed the lock method on my main secondary and rebooted the device. Switched from Owner to my main secondary without any lock method and it seemed to work without issue. I then re-added my lock method on my secondary, switched back to Owner then back to my secondary and the same issue occurs again (hang, crash and reboot). —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

katrinmichael avatar Jun 17 '24 04:06 katrinmichael

I have the same issue See crash repory below. This surely has something to do with the lock mechanism. I removed the passcode from a profike with no personal information. When changing from this profile to the owner profilr it crashes.

type: crash
SystemUptimeMs: 14311051
Process: system_server
Build: google/husky/husky:14/AP2A.240605.024/2024061400:user/release-keys
Crash-Handler: com.android.internal.os.RuntimeInit$KillApplicationHandler
Loading-Progress: 1.0
Dropped-Count: 0

java.lang.RuntimeException: Keyguard is not shown in 20 seconds
	at com.android.server.am.UserController$Injector.lockDeviceNowAndWaitForKeyguardShown(UserController.java:3885)
	at com.android.server.am.UserController.startUserInternal(UserController.java:1832)
	at com.android.server.am.UserController.startUserNoChecks(UserController.java:1683)
	at com.android.server.am.UserController.startUser(UserController.java:1637)
	at com.android.server.am.UserController.startUser(UserController.java:1596)
	at com.android.server.am.UserController.startUserInForeground(UserController.java:1944)
	at com.android.server.am.UserController.handleMessage(UserController.java:3240)
	at android.os.Handler.dispatchMessage(Handler.java:103)
	at android.os.Looper.loopOnce(Looper.java:232)
	at android.os.Looper.loop(Looper.java:317)
	at android.os.HandlerThread.run(HandlerThread.java:85)
	at com.android.server.ServiceThread.run(ServiceThread.java:46)

jiffy89 avatar Jun 19 '24 07:06 jiffy89

I have the same issue too. The phone automatically rebooted while I was switching from profile nb 4 to profile nb 6. But the problems started before switching profiles. When I was under profile nb 4, the notification message "Finalizing system update" was taking much more longer than usual, and approximately every 10 sec, I got a popup message asking me something like : if I want to wait for the process to respond or if I want to kill it. I did not killed it, and I think I should have killed it before switching profiles.

I was not able to reproduce the bug a 2nd time.

type: crash
SystemUptimeMs: 38098883
Process: system_server
Build: google/bluejay/bluejay:14/AP2A.240605.024/2024061400:user/release-keys
Crash-Handler: com.android.internal.os.RuntimeInit$KillApplicationHandler
Loading-Progress: 1.0
Dropped-Count: 0

java.lang.RuntimeException: Keyguard is not shown in 20 seconds
	at com.android.server.am.UserController$Injector.lockDeviceNowAndWaitForKeyguardShown(UserController.java:3885)
	at com.android.server.am.UserController.startUserInternal(UserController.java:1832)
	at com.android.server.am.UserController.startUserNoChecks(UserController.java:1683)
	at com.android.server.am.UserController.startUser(UserController.java:1637)
	at com.android.server.am.UserController.startUser(UserController.java:1596)
	at com.android.server.am.UserController.startUserInForeground(UserController.java:1944)
	at com.android.server.am.UserController.handleMessage(UserController.java:3240)
	at android.os.Handler.dispatchMessage(Handler.java:103)
	at android.os.Looper.loopOnce(Looper.java:232)
	at android.os.Looper.loop(Looper.java:317)
	at android.os.HandlerThread.run(HandlerThread.java:85)
	at com.android.server.ServiceThread.run(ServiceThread.java:46)

stephane-21 avatar Jun 20 '24 19:06 stephane-21

I can confirm this is lockscreen related.

Reproducable testing

  • create new profile with passcode
  • remove passcode from profile
  • when you switch to new profile without passcode, no problems. But when switch back to main. Phone crashes.
  • problem is solved if either all profiles have a passcode, or none

`` type: crash SystemUptimeMs: 86380605 Process: system_server Build: google/husky/husky:14/AP2A.240605.024/2024061400:user/release-keys Crash-Handler: com.android.internal.os.RuntimeInit$KillApplicationHandler Loading-Progress: 1.0 Dropped-Count: 0

java.lang.RuntimeException: Keyguard is not shown in 20 seconds at com.android.server.am.UserController$Injector.lockDeviceNowAndWaitForKeyguardShown(UserController.java:3885) at com.android.server.am.UserController.startUserInternal(UserController.java:1832) at com.android.server.am.UserController.startUserNoChecks(UserController.java:1683) at com.android.server.am.UserController.startUser(UserController.java:1637) at com.android.server.am.UserController.startUser(UserController.java:1596) at com.android.server.am.UserController.startUserInForeground(UserController.java:1944) at com.android.server.am.UserController.handleMessage(UserController.java:3240) at android.os.Handler.dispatchMessage(Handler.java:103) at android.os.Looper.loopOnce(Looper.java:232) at android.os.Looper.loop(Looper.java:317) at android.os.HandlerThread.run(HandlerThread.java:85) at com.android.server.ServiceThread.run(ServiceThread.java:46)

jiffy89 avatar Jun 20 '24 22:06 jiffy89

It looks like this issue is a mix of several bugs (at least 2). Even with the same passcode method for all profiles, the crash can still occur.

My hypothesis about 1 of them :

The crash happens when switching from one profile to an other one if :

  • There has been a recent OS update.
  • You have disabled the ability that profiles can run in the background.
  • You login into a profile for the first time since an OS update, then quickly logout (before the process "finalizing system update" finishes) (timing is critical here and not so easy to reproduce).

Bellow the error message with the latest OS version,

type: crash
SystemUptimeMs: 8834585
Process: system_server
Build: google/bluejay/bluejay:14/AP2A.240705.004/2024071200:user/release-keys
Crash-Handler: com.android.internal.os.RuntimeInit$KillApplicationHandler
Loading-Progress: 1.0
Dropped-Count: 0

java.lang.RuntimeException: Keyguard is not shown in 20 seconds
	at com.android.server.am.UserController$Injector.lockDeviceNowAndWaitForKeyguardShown(UserController.java:3885)
	at com.android.server.am.UserController.startUserInternal(UserController.java:1832)
	at com.android.server.am.UserController.startUserNoChecks(UserController.java:1683)
	at com.android.server.am.UserController.startUser(UserController.java:1637)
	at com.android.server.am.UserController.startUser(UserController.java:1596)
	at com.android.server.am.UserController.startUserInForeground(UserController.java:1944)
	at com.android.server.am.UserController.handleMessage(UserController.java:3240)
	at android.os.Handler.dispatchMessage(Handler.java:103)
	at android.os.Looper.loopOnce(Looper.java:232)
	at android.os.Looper.loop(Looper.java:317)
	at android.os.HandlerThread.run(HandlerThread.java:85)
	at com.android.server.ServiceThread.run(ServiceThread.java:46)

stephane-21 avatar Jul 13 '24 20:07 stephane-21

I my case, I have the following profiles

  1. passcode and fingerprint
  2. No passcode
  3. Password I now resolved (workaround) the issue by having changed the passless profile to authenticate with "swipe" instead of "passcode off".

This basically did the trick for me. Functionally it doesn't change anything. I can still login without a passcode.

Fingerprint is still not working though

jiffy89 avatar Jul 13 '24 22:07 jiffy89

type: crash
SystemUptimeMs: 731463
Process: system_server
Build: google/akita/akita:14/AP2A.240705.005/2024080200:user/release-keys
Crash-Handler: com.android.internal.os.RuntimeInit$KillApplicationHandler
Loading-Progress: 1.0
Dropped-Count: 0

java.lang.RuntimeException: Keyguard is not shown in 20 seconds
	at com.android.server.am.UserController$Injector.lockDeviceNowAndWaitForKeyguardShown(UserController.java:3885)
	at com.android.server.am.UserController.startUserInternal(UserController.java:1832)
	at com.android.server.am.UserController.startUserNoChecks(UserController.java:1683)
	at com.android.server.am.UserController.startUser(UserController.java:1637)
	at com.android.server.am.UserController.startUser(UserController.java:1596)
	at com.android.server.am.UserController.startUserInForeground(UserController.java:1944)
	at com.android.server.am.UserController.handleMessage(UserController.java:3240)
	at android.os.Handler.dispatchMessage(Handler.java:103)
	at android.os.Looper.loopOnce(Looper.java:232)
	at android.os.Looper.loop(Looper.java:317)
	at android.os.HandlerThread.run(HandlerThread.java:85)
	at com.android.server.ServiceThread.run(ServiceThread.java:46)

Same issue here, even if i switch back to main profile from any other profile or i just finish session on one of them.

I share it if it can give you some extra information, ty for your efforts on this OS.

damagr avatar Aug 05 '24 05:08 damagr

Should be fixed by the August monthly update of Android 14 QPR3 based on https://support.google.com/pixelphone/thread/289456705/google-pixel-update-aug-2024. We'll be making a release based on this today once they push it to AOSP.

thestinger avatar Aug 06 '24 19:08 thestinger

I am on the new version 20240806 and it looks like the issue is fixed - at least for me (PIN login on main user and nothing on side user).

Gh61 avatar Aug 08 '24 08:08 Gh61

Should be mostly resolved. New issue at https://github.com/GrapheneOS/os-issue-tracker/issues/3841 though.

thestinger avatar Aug 08 '24 16:08 thestinger