GNOME Bugzilla – Bug 773673
Segmentation Fault trying to access User accounts panel
Last modified: 2018-02-02 12:59:09 UTC
Unable to open Users settings in gnome-control-center. GDB full backtrace gdb /usr/bin/gnome-control-center GNU gdb (Debian 7.11.1-2) 7.11.1 Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from /usr/bin/gnome-control-center...(no debugging symbols found)...done. (gdb) list No symbol table is loaded. Use the "file" command. (gdb) run Starting program: /usr/bin/gnome-control-center [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7fffce63f700 (LWP 4049)] [New Thread 0x7fffcd45c700 (LWP 4050)] [New Thread 0x7fffccc5b700 (LWP 4051)] [New Thread 0x7fffc4e8b700 (LWP 4052)] [New Thread 0x7fffbbd85700 (LWP 4053)] [New Thread 0x7fffbb584700 (LWP 4054)] Thread 1 "gnome-control-c" received signal SIGSEGV, Segmentation fault. 0x00000000004c9a5d in ?? () (gdb) bt full
+ Trace 236781
Output from addr2line command: addr2line -e /usr/bin/gnome-control-center -fCi 0x00000000004c9a5d cc_universal_access_get_resource ??:?
Sorry forgot a critical piece of information. Linux kali 4.7.0-kali1-amd64 #1 SMP Debian 4.7.6-1kali1 (2016-10-17) x86_64 GNU/Linux
Please install the debug versions of the necessary packages to get a useful backtrace. If in doubt, please contact your distribution for help.
What exactly are the debug packages for the necessary packages? How can the maintainers of my Linux distribution help me with gnome-control-center?
(In reply to vaze75159 from comment #3) > What exactly are the debug packages for the necessary packages? How can the > maintainers of my Linux distribution help me with gnome-control-center? Exactly the sort of question that your Linux distribution's support forum can answer. They're the ones distributing the software and building it.
Ok thank you. I will return with the information as soon as I have acquired it. It seems that this is a problem of mine on multiple machines after having run apt-get dist-upgrade.
I figured out how to work around this. I know this is a late reply, I am sorry. I went to the terminal and input "sudo useradd temp" and it let me manually add a user. Then I went to the gnome-control-center Users settings and it allowed me to access the settings from then on. I guess it was segfaulting because of the fact that there were no users and it was trying to fetch a user since I was root? Idk, that is one possibility.
Please install http://debug.mirrors.debian.org/debian-debug/pool/main/g/gnome-control-center/gnome-control-center-dbgsym_3.22.1-1_amd64.deb to have debug symbols for gnome-control-center. You might need similar packages for other libraries (libc6-dbg, libglib2.0-0-dbg, libgtk-3-0-dbg). See https://wiki.debian.org/HowToGetABacktrace
This is occurring in my instance of Kali as well immediately after attempting to open the User Accounts menu in Gnome Settings. Backtrace is identical to this one. Gnome-control-center v3.22.1 Distribution: Linux Kali 4.9.0-kali1-amd64 #1 SMP Debian 4.9.6-3kali2 (2017-01-30) x86_64 GNU/Linux Perhaps some string of events I performed lead up to this that might help shed some light on the issue. Following installing Kali, I attempted to add a user manually in terminal using standard useradd options, but this failed to properly create the home directories. Deleted the account and readded usering GNOME control center which worked correctly. Following most recent apt-get update & upgrade, Gnome seems to be having quite a few issues. Application menu extension has disappeared, and is showing an error in the Gnome Tweak extensions menu, in addition to being unable to open the Users menu in settings. Opening Keyboard settings causes Gnome Control Center to freeze, and must be forced to close. I've done some very short, albeit amateur debugging, and it appears that at some point in the stackframe where gnome-control-center assigns memory for the menu, it faults when pointing to a memory address that is empty, which effectively sends the program crashing down by sending it to the memory address 0x00. If my previous actions have any indication as to the cause, it could be that what it may be looking for is my old user entry which no longer exists, but this is entirely speculative. To replicate this error, install the latest version of Kali Linux in an AMD64 virtual environment directly from the ISO, and begin creating/removing user accounts through various means. I also attempted using mkhomedir_helper to create the home directories I was missing, although I don't think that would affect it.
So the explanation is rather easy. No users returned by act_user_manager_list_users() means list = NULL and "show_user(list->data, d)" segfaults. Here's the requested backtrace: (gdb) bt
+ Trace 237147
$1 = (GSList *) 0x0
Created attachment 345964 [details] [review] Avoid the segfault Please find attached the tested patch that I used to solve the problem in Kali. Kali only creates the root account and has no non-system accounts so its situation is a bit unusual as everything is running as root in its live system.
Review of attachment 345964 [details] [review]: Thanks for the patch. The um-user-panel.c has been changed in master and this patch is no more applicable. I am not sure about the previous code, but the current code definitely has more places which need to be fixed than this one. Although this is nonstandard configuration, it would be nice to show something like "No users found" instead of the unfilled panel and let a user create some. Also, it should not crash if current user (i.e. root) is not returned from accountsservice. We will be happy if you can propose patch applicable on master. Please follow the guidelines for submitting patches: https://wiki.gnome.org/Newcomers/SubmittingPatches
Sorry I won't have the time to try to make a patch for what's in master. But I can build an updated package and test it when you have pushed a fix.
Created attachment 346428 [details] [review] user-accounts: Introduce an empty state page There are eventually corner cases where there's no user other than root in the system and control-center can be launched by the root user (not recommended). In this cases, the panel crashes without any user to show (since accountsservice would just list normal users). This patch introduces an empty state[0] "No Users Page". [0] https://wiki.gnome.org/Design/OS/EmptyStates
Be aware that we are in UI-freeze right now (the patch above introduces UI changes and a newer string). I would suggest to commit-after-freeze or ask for an exception if this feature is *really* desirable for 3.24.
Review of attachment 346428 [details] [review]: Please attach screenshot for designers. I think that the no-users-page should appear by default, because users_loaded should not be called immediately. I suppose that the following code (e.g. from users_loaded) crashes for root, doesn't it? user = act_user_manager_get_user_by_id (d->um, getuid ()); show_user (user, d); ::: panels/user-accounts/data/user-accounts-dialog.ui @@ +463,3 @@ + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="label" translatable="yes" comments="Translators: This is the empty state page label which states that there are no users to show in the panel.">No Users Found</property> I think there should be also some description as you can see on: https://wiki.gnome.org/Design/OS/EmptyStates Maybe something like the following, Allan? "You can add a user account with the Add User button after unlocking this panel." @@ +466,3 @@ + <attributes> + <attribute name="weight" value="bold"/> + <attribute name="scale" value="1.2"/> <!-- PANGO_SCALE_LARGE --> Not sure about the scale - 1.6 is used in account-dialog.ui for similar page... ::: panels/user-accounts/um-user-panel.c @@ +96,3 @@ #define PAGE_LOCK "_lock" #define PAGE_ADDUSER "_adduser" +#define PAGE_NO_USERS "no-users-page" It would be good to add at least empty line before this defines, or maybe better to add some meaningful comments, because those defines don't correspond with the previous ones. Also would be good to use same conventions and use the underscores... @@ +292,3 @@ + gtk_stack_set_visible_child_name (GTK_STACK (d->stack), + list ? PAGE_USERS : PAGE_NO_USERS); + g_return_if_fail (list); I think we should not use g_return_if_fail here, see reference...
(In reply to Ondrej Holy from comment #15) ... > Maybe something like the following, Allan? > "You can add a user account with the Add User button after unlocking this > panel." That a little verbose for UI in my opinion. Something like this might be better: "Unlock to add a user account."
*** Bug 780315 has been marked as a duplicate of this bug. ***
Created attachment 350956 [details] [review] user-accounts: Introduce an empty state page There are eventually corner cases where there's no user other than root in the system and control-center can be launched by the root user (not recommended). In this cases, the panel crashes without any user to show (since accountsservice would just list normal users). This patch introduces an empty state[0] "No Users Page". [0] https://wiki.gnome.org/Design/OS/EmptyStates
Created attachment 350957 [details] screenshot
Review of attachment 350956 [details] [review]: Looks good, just... I think that reload_users has to be called also on user-added signal because of carousel update and also because PAGE_NO_USERS won't be switched to PAGE_USERS otherwise. This is probably existing bug which would be nice to fix in a separate patch. Maybe also we should not call show_user if PAGE_NO_USERS is shown... ::: panels/user-accounts/um-user-panel.c @@ +294,3 @@ g_debug ("Got %d users\n", g_slist_length (list)); + can_reload = (list && getuid () != 0); Is getuid check really needed? @@ +307,3 @@ user_added (d->um, user, d); } + And please remove this whitespace change...
*** Bug 783635 has been marked as a duplicate of this bug. ***
Created attachment 358218 [details] [review] user-accounts: Introduce an empty state page There are eventually corner cases where there's no user other than root in the system and control-center can be launched by the root user (not recommended). In this cases, the panel crashes without any user to show (since accountsservice would just list normal users). This patch introduces an empty state[0] "No Users Page". [0] https://wiki.gnome.org/Design/OS/EmptyStates
(In reply to Felipe Borges from comment #22) > Created attachment 358218 [details] [review] [review] > user-accounts: Introduce an empty state page > Be aware of the release schedule, and the current freeze state. (In reply to Ondrej Holy from comment #20) > Review of attachment 350956 [details] [review] [review]: > > Maybe also we should not call show_user if PAGE_NO_USERS is shown... I think that the show_user call won't be reached, since we have the if (!can_reload) return guard.
Review of attachment 358218 [details] [review]: With this patch applied (on top of gnome-control-center 3.24.3), we see the new "no users" empty page but it segfaults when you submit the form to add a new user page. And from there on, the applet segfaults every time you start it.
Yes, this is probably caused because the panel still tries to show your account, which is not in the carousel for some reason... more checks are needed. But maybe we could always add the user with getuid(), regardless it is considered as system user. But not sure how the panel will work e.g. with root account. Maybe just show it, but with insensitive options. Filipe, any ideas?
Created attachment 365038 [details] [review] user-accounts: Prevent crashes if current user is not in carousel In a specific cases, current user doesn't have to be returned from accountsservice, or can be skipped by act_user_is_system_account check. System users should not be shown. This is expected for root account, but should not happen with regular user accounts. It needs to be fixed in accountsservice if you see this happening with regular user accounts. We have to be just sure that Users panel doesn't crash in such cases and show all non-system user accounts returned from accountsservice. Empty page is shown currently only if act_user_manager_list_users returns nothing, but it has to be also shown if only system accounts are returned. To fix this issue, do not try to show current user, but show first user account in carousel instead if there is any. First user account is current user in normal case. The patch also fixes problems that current user account is sometimes selected instead of currently selected user account. This is because of preselection of first item in um_carousel_add, which causes unwanted signal emissions... It applies on top of attachment 358218 [details] [review].
Created attachment 365367 [details] GNOME-control-center-bug-report-video-1
Created attachment 365375 [details] GNOME-control-center-bug-report-video-2
(In reply to Ondrej Holy from comment #26) > Created attachment 365038 [details] [review] [review] > user-accounts: Prevent crashes if current user is not in carousel > > In a specific cases, current user doesn't have to be returned from > accountsservice, or can be skipped by act_user_is_system_account check. > System users should not be shown. This is expected for root account, > but should not happen with regular user accounts. It needs to be fixed > in accountsservice if you see this happening with regular user accounts. > We have to be just sure that Users panel doesn't crash in such cases > and show all non-system user accounts returned from accountsservice. > Empty page is shown currently only if act_user_manager_list_users > returns nothing, but it has to be also shown if only system accounts > are returned. To fix this issue, do not try to show current user, but > show first user account in carousel instead if there is any. First user > account is current user in normal case. > > The patch also fixes problems that current user account is sometimes > selected instead of currently selected user account. This is because > of preselection of first item in um_carousel_add, which causes unwanted > signal emissions... > > It applies on top of attachment 358218 [details] [review] [review]. Hi! I also have a similar problem with the User accounts panel. Immediately after a fresh start of GNOME, the User accounts panel hangs the first time I try to start it. But, if I kill this process, then all subsequent launches of the User accounts panel occur normally until the computer restarts, after which the User accounts panel hangs up again only at the first attempt to start, after which it starts to start normally again. I use Arch Linux, therefore, I always use only the latest version of GNOME. I also have a similar problem with gcc. Immediately after a fresh start, the GNOME gcc hangs the first time you try to start the User accounts panel. But, if you kill this process, then all subsequent launches of the User accounts panel occur normally until the computer is restarted, after which the User accounts again hangs up on the first attempt to start, after which it starts to start normally again. I use Archlinux, therefore, I always use only the latest version of GNOME. I attached 2 videos here. Thank you!
(In reply to Zfkerr from comment #29) > (In reply to Ondrej Holy from comment #26) > > Created attachment 365038 [details] [review] [review] [review] > > user-accounts: Prevent crashes if current user is not in carousel > > > > In a specific cases, current user doesn't have to be returned from > > accountsservice, or can be skipped by act_user_is_system_account check. > > System users should not be shown. This is expected for root account, > > but should not happen with regular user accounts. It needs to be fixed > > in accountsservice if you see this happening with regular user accounts. > > We have to be just sure that Users panel doesn't crash in such cases > > and show all non-system user accounts returned from accountsservice. > > Empty page is shown currently only if act_user_manager_list_users > > returns nothing, but it has to be also shown if only system accounts > > are returned. To fix this issue, do not try to show current user, but > > show first user account in carousel instead if there is any. First user > > account is current user in normal case. > > > > The patch also fixes problems that current user account is sometimes > > selected instead of currently selected user account. This is because > > of preselection of first item in um_carousel_add, which causes unwanted > > signal emissions... > > > > It applies on top of attachment 358218 [details] [review] [review] [review]. > > Hi! I also have a similar problem with the User accounts panel. Immediately > after a fresh start of GNOME, the User accounts panel hangs the first time I > try to start it. But, if I kill this process, then all subsequent launches > of the User accounts panel occur normally until the computer restarts, after > which the User accounts panel hangs up again only at the first attempt to > start, after which it starts to start normally again. I use Arch Linux, > therefore, I always use only the latest version of GNOME. I also have a > similar problem with gcc. Immediately after a fresh start, the GNOME gcc > hangs the first time you try to start the User accounts panel. But, if you > kill this process, then all subsequent launches of the User accounts panel > occur normally until the computer is restarted, after which the User > accounts again hangs up on the first attempt to start, after which it starts > to start normally again. > I use Archlinux, therefore, I always use only the latest version of GNOME. > I attached 2 videos here. Thank you! As gcc, I mean the GNOME Control Center, not the GNU compiler.
(In reply to Ondrej Holy from comment #26) > Created attachment 365038 [details] [review] [review] > user-accounts: Prevent crashes if current user is not in carousel > > In a specific cases, current user doesn't have to be returned from > accountsservice, or can be skipped by act_user_is_system_account check. > System users should not be shown. This is expected for root account, > but should not happen with regular user accounts. It needs to be fixed > in accountsservice if you see this happening with regular user accounts. > We have to be just sure that Users panel doesn't crash in such cases > and show all non-system user accounts returned from accountsservice. > Empty page is shown currently only if act_user_manager_list_users > returns nothing, but it has to be also shown if only system accounts > are returned. To fix this issue, do not try to show current user, but > show first user account in carousel instead if there is any. First user > account is current user in normal case. > > The patch also fixes problems that current user account is sometimes > selected instead of currently selected user account. This is because > of preselection of first item in um_carousel_add, which causes unwanted > signal emissions... > > It applies on top of attachment 358218 [details] [review] [review]. Hi! I have a problem with the User accounts panel in the gnome-control-center. After a fresh start of GNOME, the User accounts panel hangs the first time I try to start it. But, if I kill this process, then all subsequent launches of the User accounts panel occur normally until Arch Linux restarts, after which the User accounts panel hangs up again only at the first attempt to start, after which it starts normally again. I use Arch Linux, therefore, I always use only the latest version of GNOME and all packages. Unfortunately, I was not able to get a useful console output. But, I attached 2 videos here. Thank you!
Created attachment 365383 [details] strace.log
It's an assigned bug report on Arch Linux bugzilla: https://bugs.archlinux.org/task/56546
This report is about control-center crashes, not about hangs. So, please don't abuse this report and file a new bug report for your issue. Or does the attached patches fix your issue? Please attach also backtrace in time of hang, e.g. using "gstack $(pidof gnome-control-center)" (be sure that debug info is installed).
(In reply to Ondrej Holy from comment #34) > This report is about control-center crashes, not about hangs. So, please > don't abuse this report and file a new bug report for your issue. Or does > the attached patches fix your issue? Please attach also backtrace in time of > hang, e.g. using "gstack $(pidof gnome-control-center)" (be sure that debug > info is installed). I do not know which package I need to install to use this command. $ gstack $(pidof gnome-control-center) bash: gstack: command not found
Zfkerr, please create a new bug report for your issue, thanks! I will help you there...
Review of attachment 358218 [details] [review]: I am ok with this if designers are not against, but doesn't make much sense without attachment 365038 [details] [review]. Felipe, can you please take a look at it?
Created attachment 367623 [details] screenshot
Review of attachment 358218 [details] [review]: ::: panels/user-accounts/data/user-accounts-dialog.ui @@ +457,3 @@ + <object class="GtkImage"> + <property name="visible">True</property> + <property name="icon_name">computer-fail-symbolic</property> The icon should be changed to avatar-default-symbolic as per discussion on #control-center.
Created attachment 367680 [details] [review] user-accounts: Introduce an empty state page There are eventually corner cases where there's no user other than root in the system and control-center can be launched by the root user (not recommended). In this cases, the panel crashes without any user to show (since accountsservice would just list normal users). This patch introduces an empty state[0] "No Users Page". [0] https://wiki.gnome.org/Design/OS/EmptyStates
Review of attachment 367680 [details] [review]: I've just successfully tested those patches on Fedora 27 with the root account only. Which I suppose is the main case which we are trying to handle here. The control-center segfaults without those patches and print various criticals. With both patches from this bug, the no users page is shown instead and it is possible to add other users. The patches also fix crashes when there are already other users, but the session is started under root... Felipe, can you please check my patch, so we can go with this before the release/freeze?
Comment on attachment 367680 [details] [review] user-accounts: Introduce an empty state page Attachment 367680 [details] pushed as a701b46 - user-accounts: Introduce an empty state page
Review of attachment 365038 [details] [review]: Thank you. Works for me. Lgtm
Thanks! Attachment 365038 [details] pushed as 4e43bd6 - user-accounts: Prevent crashes if current user is not in carousel