Various programs crashed with SIGSEGV in g_str_hash() from g_hash_table_lookup() from update_user()

Bug #1843982 reported by Hans-Petter Falao
144
This bug affects 17 people
Affects Status Importance Assigned to Milestone
accountsservice
Fix Released
Unknown
accountsservice (Debian)
Fix Released
Unknown
accountsservice (Ubuntu)
Fix Released
High
Iain Lane
Focal
Fix Released
High
Iain Lane

Bug Description

[ Description ]

When accountsservice's daemon is restarted - particularly when there is a user configured for auto login - it can cause code using its library to crash. This is bad because gnome-shell is one of those users which crashes.

[ QA ]

Configure a user for automatic login in gnome-shell.

Update to this SRU, and then *restart your system*. The crash is in the library part, and so you will still see it if programs loaded the buggy version. Restarting is the easiest way to make sure you're not on it.

Restart accounts-daemon.service (sudo systemctl restart accounts-daemon.service) a few times, leaving several seconds between each attempt.

See that it crashes if you don't have this SRU, and doesn't if you do have it.

---

Test that fast user switching still works properly.

---

Take a look at the error reports listed below and hopefully see them not occurring (barring the usual noise) with the SRU.

[ Regression potential ]

We think this is safe - it tells clients that the daemon is away when it quits, and is back when it comes back. They should get appropriate signals to indicate this. Nevertheless, these signals are sent when they weren't before now, so that could cause problems. Watch out for errors creeping up with this SRU.

We wondered upstream whether some more protections might be needed. I'm thinking that those should be *additional* safety rails around this fix, but it could actually be that more is needed and this fix isn't complete.

[ Original report ]

https://errors.ubuntu.com/problem/597be858df957473f357a9249b002b0e39f42781
https://errors.ubuntu.com/problem/3a817938d76d231fdfc8f698392fbf5e3724084f
https://errors.ubuntu.com/problem/3945cd9cdcec914cab9a3220d05e9696933336c7

ProblemType: Crash
DistroRelease: Ubuntu 19.10
Package: gnome-shell 3.34.0-1ubuntu1
ProcVersionSignature: Ubuntu 5.3.0-10.11-generic 5.3.0-rc8
Uname: Linux 5.3.0-10-generic x86_64
ApportVersion: 2.20.11-0ubuntu7
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Sat Sep 14 10:29:16 2019
DisplayManager: gdm3
ExecutablePath: /usr/bin/gnome-shell
InstallationDate: Installed on 2019-05-24 (112 days ago)
InstallationMedia: Ubuntu 19.10 "Eoan Ermine" - Alpha amd64 (20190523)
ProcCmdline: /usr/bin/gnome-shell
ProcEnviron:
 LANG=nb_NO.UTF-8
 LANGUAGE=nb_NO:nb:no_NO:no:nn_NO:nn:en
 PATH=(custom, no user)
 SHELL=/bin/bash
 XDG_RUNTIME_DIR=<set>
RelatedPackageVersions: mutter-common 3.34.0-2ubuntu1
Signal: 11
SourcePackage: gnome-shell
StacktraceTop:
 g_str_hash () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
 g_hash_table_lookup () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
 ?? () from /lib/x86_64-linux-gnu/libaccountsservice.so.0
 g_closure_invoke () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
 ?? () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
Title: gnome-shell crashed with SIGSEGV in g_str_hash()
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo
separator:

Revision history for this message
Hans-Petter Falao (la9ui) wrote :
Revision history for this message
Apport retracing service (apport) wrote :

StacktraceTop:
 g_str_hash () from /tmp/apport_sandbox_0rx60qvd/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6200.0
 g_hash_table_lookup () from /tmp/apport_sandbox_0rx60qvd/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6200.0
 update_user (user=0x55f631b9d840, manager=0x55f6311ff8d0) at ../src/libaccountsservice/act-user-manager.c:1020
 on_user_changed (manager=0x55f6311ff8d0, user=0x55f631b9d840) at ../src/libaccountsservice/act-user-manager.c:664
 on_user_changed (user=0x55f631b9d840, manager=0x55f6311ff8d0) at ../src/libaccountsservice/act-user-manager.c:650

Revision history for this message
Apport retracing service (apport) wrote : Stacktrace.txt
Revision history for this message
Apport retracing service (apport) wrote : StacktraceSource.txt
Revision history for this message
Apport retracing service (apport) wrote : ThreadStacktrace.txt
Changed in gnome-shell (Ubuntu):
importance: Undecided → Medium
tags: removed: need-amd64-retrace
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: gnome-shell crashed with SIGSEGV in g_str_hash()

This looks like bug 1841382

affects: gnome-shell (Ubuntu) → accountsservice (Ubuntu)
information type: Private → Public
summary: - gnome-shell crashed with SIGSEGV in g_str_hash()
+ Various programs crashed with SIGSEGV in g_str_hash() from
+ g_hash_table_lookup() from update_user()
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in accountsservice (Ubuntu):
status: New → Confirmed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
description: updated
Revision history for this message
Sebastien Bacher (seb128) wrote :
Changed in accountsservice (Ubuntu):
importance: Medium → High
status: Confirmed → Triaged
Changed in accountsservice:
status: Unknown → New
Changed in accountsservice (Debian):
status: Unknown → Confirmed
tags: added: focal
tags: added: champagne
tags: added: rls-ff-incoming
Changed in accountsservice (Ubuntu):
assignee: nobody → Iain Lane (laney)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
description: updated
description: updated
Iain Lane (laney)
Changed in accountsservice (Ubuntu Focal):
milestone: none → ubuntu-20.04.1
tags: removed: rls-ff-incoming
tags: removed: champagne
Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
http://iso.qa.ubuntu.com/qatracker/reports/bugs/1843982

tags: added: iso-testing
Revision history for this message
Iain Lane (laney) wrote :

Okay, I've uploaded a fix to groovy and the review queue for 20.04.

Iain Lane (laney)
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package accountsservice - 0.6.55-0ubuntu12

---------------
accountsservice (0.6.55-0ubuntu12) groovy; urgency=medium

  * Cherry-pick from unstable.
  * Add patch to not crash in the library when the daemon goes away
    (Closes: #948228) (LP: #1843982)

 -- Iain Lane <email address hidden> Tue, 05 May 2020 17:00:20 +0100

Changed in accountsservice (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Ok, I think that the test case is thorough enough to cover the regression risk here. Let's get it in.

Changed in accountsservice (Ubuntu Focal):
status: Triaged → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Hans-Petter, or anyone else affected,

Accepted accountsservice into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/accountsservice/0.6.55-0ubuntu12~20.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Jack Howarth (jwhowarth) wrote :

I am seeing crashes back into the greeter when updating the current accountsservice 0.6.55-0ubuntu11 package to the accountsservice 0.6.55-0ubuntu12~20.04.1 update in the focal proposed-updates. An autologin is currently set for this machine. Since the changes describe this fix as...

 * Add patch to not crash in the library when the daemon goes away
    (Closes: #948228) (LP: #1843982)

Doesn't that imply that the crashes will only be fixed for future updates of accountsservice rather than for the current one that implements that fix?

Revision history for this message
Jack Howarth (jwhowarth) wrote :

I can also confirm that if I disable autologin, reboot and then update to the current packages in focal-proposed updates that the installation of accountsservice 0.6.55-0ubuntu12~20.04.1 from the current accountsservice 0.6.55-0ubuntu11 package completes normally.

Revision history for this message
Jack Howarth (jwhowarth) wrote :
Download full text (5.4 KiB)

Looking at the syslog for the failed upgrade to accountsservice 0.6.55-0ubuntu12~20.04.1 with autologin enabled, I find that the first failure appears at...

May 13 17:04:50 howarth-MacPro systemd[1]: Stopping Accounts Service...
May 13 17:04:50 howarth-MacPro systemd[1]: accounts-daemon.service: Succeeded.
May 13 17:04:50 howarth-MacPro systemd[1]: Stopped Accounts Service.
May 13 17:04:50 howarth-MacPro systemd[1]: Starting Accounts Service...
May 13 17:04:50 howarth-MacPro accounts-daemon[12151]: started daemon version 0.6.55
May 13 17:04:50 howarth-MacPro systemd[1]: Started Accounts Service.
May 13 17:04:50 howarth-MacPro kernel: [ 311.779519] gsd-keyboard[2260]: segfault at 0 ip 00007f330b6b1494 sp 00007ffed49c6f88 error 4 in libglib-2.0.so.0.6400.2[7f330b68d000+84000]
May 13 17:04:50 howarth-MacPro kernel: [ 311.779530] Code: f8 5b 5d c3 66 90 f3 0f 1e fa 48 83 ec 08 e8 a3 cf fd ff 85 c0 0f 94 c0 48 83 c4 08 0f b6 c0 c3 66 0f 1f 44 00 00 f3 0f 1e fa <
0f> be 07 41 b8 05 15 00 00 84 c0 74 1d 0f 1f 80 00 00 00 00 44 89
May 13 17:04:50 howarth-MacPro kernel: [ 311.779639] gdm3[1405]: segfault at 0 ip 00007f719bbe3494 sp 00007ffc4861af48 error 4 in libglib-2.0.so.0.6400.2[7f719bbbf000+84000]
May 13 17:04:50 howarth-MacPro kernel: [ 311.779650] Code: f8 5b 5d c3 66 90 f3 0f 1e fa 48 83 ec 08 e8 a3 cf fd ff 85 c0 0f 94 c0 48 83 c4 08 0f b6 c0 c3 66 0f 1f 44 00 00 f3 0f 1e fa <
0f> be 07 41 b8 05 15 00 00 84 c0 74 1d 0f 1f 80 00 00 00 00 44 89
May 13 17:04:50 howarth-MacPro kernel: [ 311.779653] gdm-session-wor[1519]: segfault at 0 ip 00007f6a8d633494 sp 00007ffe7b13c2a8 error 4 in libglib-2.0.so.0.6400.2[7f6a8d60f000+84000]
May 13 17:04:50 howarth-MacPro kernel: [ 311.779662] Code: f8 5b 5d c3 66 90 f3 0f 1e fa 48 83 ec 08 e8 a3 cf fd ff 85 c0 0f 94 c0 48 83 c4 08 0f b6 c0 c3 66 0f 1f 44 00 00 f3 0f 1e fa <
0f> be 07 41 b8 05 15 00 00 84 c0 74 1d 0f 1f 80 00 00 00 00 44 89
May 13 17:04:50 howarth-MacPro gnome-shell[1882]: GNOME Shell crashed with signal 11
May 13 17:04:50 howarth-MacPro gnome-shell[1882]: == Stack trace for context 0x55ed1ab076e0 ==
May 13 17:04:50 howarth-MacPro systemd[1534]: Stopped target GNOME Keyboard handling.
May 13 17:04:50 howarth-MacPro systemd[1534]: gsd-keyboard.service: Main process exited, code=dumped, status=11/SEGV
May 13 17:04:50 howarth-MacPro /usr/lib/gdm3/gdm-x-session[1562]: (II) modeset(0): Disabling kernel dirty updates, not required.
May 13 17:04:50 howarth-MacPro systemd[1534]: gsd-keyboard.service: Failed with result 'core-dump'.
May 13 17:04:50 howarth-MacPro systemd[1534]: Stopped GNOME Keyboard handling.
May 13 17:04:50 howarth-MacPro systemd[1534]: gsd-keyboard.service: Triggering OnFailure= dependencies.
May 13 17:04:50 howarth-MacPro systemd[1534]: Started GNOME Session Failed lockdown screen (user).
May 13 17:04:50 howarth-MacPro systemd[1534]: Reached target GNOME Session Failed.
May 13 17:04:50 howarth-MacPro systemd[1534]: Starting Notification regarding a crash report...
May 13 17:04:50 howarth-MacPro update-notifier-crash[12175]: /usr/bin/whoopsie
May 13 17:04:50 howarth-MacPro systemd[1534]: gnome-shell-x11.service: Main process exited, code=dumped, status=11/SEGV
May 13 17:04:50...

Read more...

Revision history for this message
Iain Lane (laney) wrote :

Right. It's in the library. Programs will remain using the versions of the libraries that were on the system when they started, so that means that you need to upgrade, reboot, and *then* try the restart. I should update the QA steps to make that more clear, will do.

description: updated
Revision history for this message
Jack Howarth (jwhowarth) wrote :

My experience with focal-proposed and accountsservice 0.6.55-0ubuntu12~20.04.1 has been that the update causes the currently executing 'sudo apt-get update' to prematurely abort when the gnome shell crashes. In my case, this left the linux-kerrnel packages only half configured. My understanding is that 'sudo apt-get update' doesn't fully run as a background process when executed from a Gnome Terminal window. So when the gnome shell crashes back to gdm, the current update is stopped at that point.

I believe the proper way to test this package is on a machine currently on focal-updates that is then switched to focal-proposed so that the update occurs against a real-world set of packages and not just the accountsservice packages alone.

Changed in accountsservice:
status: New → Fix Released
Revision history for this message
Sebastien Bacher (seb128) wrote :

The fix is not easy to confirm since it's random and the errors report are against services using it like gdm so the 'version it's happening with table' don't tell us what version of e.g gdm was in use and not accountsservice

The updated 0ubuntu12~20.04.1 version works without visible problems though and the fix is simple and got upstream reviewed. There are also no regression reported

Based on those facts I'm going to mark the SRU as verified

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The upstream bug mentions:

> When gdm is configured with AutomaticLogin, restarting accounts-daemon.service causes consumers to crash

so it might be possible to verify that way.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package accountsservice - 0.6.55-0ubuntu12~20.04.1

---------------
accountsservice (0.6.55-0ubuntu12~20.04.1) focal; urgency=medium

  * Backport from groovy to focal.

accountsservice (0.6.55-0ubuntu12) groovy; urgency=medium

  * Cherry-pick from unstable.
  * Add patch to not crash in the library when the daemon goes away
    (Closes: #948228) (LP: #1843982)

 -- Iain Lane <email address hidden> Tue, 05 May 2020 17:05:26 +0100

Changed in accountsservice (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for accountsservice has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Changed in accountsservice (Debian):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.