Segfault in `daemon_local_set_automatic_login` when trying to enable automatic login if no DM is detected
I'm using GNOME on Chimera Linux, and trying to enable automatic login from the Settings app causes accountsservice
23.13.9 to segfault. Here's the back trace:
* thread #1, name = 'accounts-daemon', stop reason = signal SIGSEGV: address not mapped to object (fault address: 0x8)
* frame #0: 0x000055555556fdad accounts-daemon`user_change_automatic_login_authorized_cb(daemon=0x00007fffee603db0, user=0x00007fffee100b70, context=0x00007fffeec05f20, data=0x0000000000000001) at user.c:2662:100
frame #1: 0x000055555556959b accounts-daemon`check_auth_cb(authority=<unavailable>, res=<unavailable>, data=0x00007fffef706210) at daemon.c:1681:17
frame #2: 0x00007fffef42cecf libgio-2.0.so.0`g_simple_async_result_complete + 191
frame #3: 0x00007ffff7f72aea libpolkit-gobject-1.so.0`___lldb_unnamed_symbol549 + 378
frame #4: 0x00007fffef4470c3 libgio-2.0.so.0`g_task_return_now.llvm.12815632267297636896 + 35
frame #5: 0x00007fffef445b71 libgio-2.0.so.0`g_task_return.llvm.12815632267297636896 + 289
frame #6: 0x00007fffef4bb2d7 libgio-2.0.so.0`reply_cb + 119
frame #7: 0x00007fffef4470c3 libgio-2.0.so.0`g_task_return_now.llvm.12815632267297636896 + 35
frame #8: 0x00007fffef445b71 libgio-2.0.so.0`g_task_return.llvm.12815632267297636896 + 289
frame #9: 0x00007fffef4ad48d libgio-2.0.so.0`g_dbus_connection_call_done + 317
frame #10: 0x00007fffef447113 libgio-2.0.so.0`complete_in_idle_cb.llvm.12815632267297636896 + 35
frame #11: 0x00007fffef2827b6 libglib-2.0.so.0`g_main_context_dispatch_unlocked + 406
frame #12: 0x00007fffef282d72 libglib-2.0.so.0`g_main_context_iterate_unlocked + 706
frame #13: 0x00007fffef2833cd libglib-2.0.so.0`g_main_loop_run + 413
frame #14: 0x000055555556c6f8 accounts-daemon`main(argc=1, argv=0x00007fffffffecd8) at main.c:283:9
The segfault occurs here (when dereferencing error
, initialized to NULL
):
frame #0: 0x000055555556fdad accounts-daemon`user_change_automatic_login_authorized_cb(daemon=0x00007fffee603db0, user=0x00007fffee100b70, cont
ext=0x00007fffeec05f20, data=0x0000000000000001) at user.c:2662:100
2659 }
2660
2661 if (!daemon_local_set_automatic_login (daemon, user, enabled, &error)) {
-> 2662 throw_error (context, ERROR_FAILED, "failed to change automatic login: %s", error->message);
2663 return;
2664 }
2665
I briefly looked into the code, and the only place where daemon_local_set_automatic_login
returns FALSE
and therefore causes the if
statement body to execute is in lines 1907 to 1909 in src/daemon.c
:
if (!save_autologin (daemon, user_get_user_name (user), enabled, error)) {
return FALSE;
}
So I went and checked save_autologin
, and indeed, at the end of the function, FALSE
is returned without modifying error
.
Now, I'm using GDM, so I wasn't quite sure why get_current_system_dm_type
(called in save_autologin
) fails to detect that I'm using GDM. It didn't take me long to realize that it does that by checking what file the /etc/systemd/system/display-manager.service
symlink points to; however, Chimera Linux doesn't use systemd (it uses dinit as its service manager and init). I'm not quite sure about the right way to adapt get_current_system_dm_type
to Chimera Linux, I'll check how later (I might also open a separate ticket for this).