systemd-logind assert failure: error.c:319: Assertion failed in nih_error_get: context_stack != NULL

Bug #1302264 reported by Gil Pinheiro
178
This bug affects 36 people
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Fix Released
Critical
Stéphane Graber

Bug Description

Initially presents as a 'hang' during bootup. Checking the upstart logs it looks like systemd-logind is failing.

I tried a few different approaches - and eventually found that installing cgmanager allowed the system to reach a x11 login

checking into the logs now I continue to see errors:

Removed session c1.
cgmanager: cgm_remove for controller=blkio, cgroup_path=user/115.user/c1.session, recursive=1 failed: invalid request
cgmanager: cgm_remove for controller=cpu, cgroup_path=user/115.user/c1.session, recursive=1 failed: invalid request
cgmanager: cgm_remove for controller=cpuacct, cgroup_path=user/115.user/c1.session, recursive=1 failed: invalid request
cgmanager: cgm_remove for controller=cpuset, cgroup_path=user/115.user/c1.session, recursive=1 failed: invalid request
cgmanager: cgm_remove for controller=devices, cgroup_path=user/115.user/c1.session, recursive=1 failed: invalid request
cgmanager: cgm_remove for controller=freezer, cgroup_path=user/115.user/c1.session, recursive=1 failed: invalid request
cgmanager: cgm_remove for controller=hugetlb, cgroup_path=user/115.user/c1.session, recursive=1 failed: invalid request
cgmanager: cgm_remove for controller=memory, cgroup_path=user/115.user/c1.session, recursive=1 failed: invalid request
cgmanager: cgm_remove for controller=perf_event, cgroup_path=user/115.user/c1.session, recursive=1 failed: invalid request
cgmanager: cgm_remove for controller=systemd, cgroup_path=user/115.user/c1.session, recursive=1 failed: invalid request
cgmanager: cgm_remove for controller=blkio, cgroup_path=user/115.user, recursive=1 failed: invalid request
cgmanager: cgm_remove for controller=cpu, cgroup_path=user/115.user, recursive=1 failed: invalid request
cgmanager: cgm_remove for controller=cpuacct, cgroup_path=user/115.user, recursive=1 failed: invalid request
cgmanager: cgm_remove for controller=cpuset, cgroup_path=user/115.user, recursive=1 failed: invalid request
cgmanager: cgm_remove for controller=devices, cgroup_path=user/115.user, recursive=1 failed: invalid request
cgmanager: cgm_remove for controller=freezer, cgroup_path=user/115.user, recursive=1 failed: invalid request
cgmanager: cgm_remove for controller=hugetlb, cgroup_path=user/115.user, recursive=1 failed: invalid request
cgmanager: cgm_remove for controller=memory, cgroup_path=user/115.user, recursive=1 failed: invalid request
cgmanager: cgm_remove for controller=perf_event, cgroup_path=user/115.user, recursive=1 failed: invalid request
Failed to issue method call: Unknown unit: <email address hidden>

but the system seems to working now.

ProblemType: Crash
DistroRelease: Ubuntu 14.04
Package: systemd-services 204-5ubuntu16
ProcVersionSignature: Ubuntu 3.13.0-22.44-generic 3.13.8
Uname: Linux 3.13.0-22-generic x86_64
ApportVersion: 2.14-0ubuntu1
Architecture: amd64
AssertionMessage: error.c:319: Assertion failed in nih_error_get: context_stack != NULL
Date: Thu Apr 3 18:18:23 2014
ExecutablePath: /lib/systemd/systemd-logind
InstallationDate: Installed on 2014-03-24 (10 days ago)
InstallationMedia: Ubuntu-GNOME 14.04 "Trusty Tahr" - Alpha amd64 (20140323)
ProcCmdline: /lib/systemd/systemd-logind
ProcEnviron:
 PATH=(custom, no user)
 TERM=linux
Signal: 6
SourcePackage: systemd
StacktraceTop:
 nih_error_get () from /lib/x86_64-linux-gnu/libnih.so.1
 ?? ()
 ?? ()
 ?? ()
 ?? ()
Title: systemd-logind assert failure: error.c:319: Assertion failed in nih_error_get: context_stack != NULL
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups:

Revision history for this message
Gil Pinheiro (gilpinheiro) wrote :
Revision history for this message
Apport retracing service (apport) wrote :

StacktraceTop:
 nih_error_get () at error.c:320
 cgm_dbus_connect () at ../src/shared/cgmanager.c:47
 check_hierarchy (p=p@entry=0x13b62a0 "blkio") at ../src/shared/cgroup-util.c:656
 cg_shorten_controllers (controllers=0x13b6700) at ../src/shared/cgroup-util.c:1493
 manager_startup (m=m@entry=0x13b6010) at ../src/login/logind.c:1642

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 systemd (Ubuntu):
importance: Undecided → Medium
tags: removed: need-amd64-retrace
Revision history for this message
Gil Pinheiro (gilpinheiro) wrote :

I'll note that looking at the apt logs cgmanager libs were installed during the last update, but the cgmanager package itself was not.

information type: Private → Public
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in systemd (Ubuntu):
status: New → Confirmed
Revision history for this message
Stéphane Graber (stgraber) wrote :

Yeah, that's fine, cgmanager isn't meant to be installed by default yet, however the recent bugfix in systemd broke on systems that don't have cgmanager. We're working on a fix right now.

Revision history for this message
Stéphane Graber (stgraber) wrote :

Tracked done the problem to an extra nih error processing call which was asserting. Dropped it and uploaded the fix to the queue, it should hopefully be accepted very soon.

Changed in systemd (Ubuntu):
status: Confirmed → In Progress
assignee: nobody → Stéphane Graber (stgraber)
Steve Langasek (vorlon)
Changed in systemd (Ubuntu):
importance: Medium → Critical
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 204-5ubuntu17

---------------
systemd (204-5ubuntu17) trusty; urgency=medium

  * Fix crash on systems without cgmanager. (LP: #1302264)
 -- Stephane Graber <email address hidden> Fri, 04 Apr 2014 00:17:14 -0400

Changed in systemd (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
tozen (dpaskovskis) wrote :

Nothing fixed! Steel problem persist. Last updates received 04/04/2014.

Revision history for this message
Stéphane Graber (stgraber) wrote :

That specific bug has certainly been fixed, please make sure you're running 204-5ubuntu17 and if you are, file a new crash report as that'll be an entirely different issue.

Revision history for this message
Gavin Graham (gavingraham) wrote :

I can confirm that the fix is working for me.

Revision history for this message
Michael Heuberger (michael.heuberger) wrote :

Not sure if my problem is related to this one. At the moment I experience issues installing/updating libpam-systemd:amd64. Then I followed the installation scripts and saw that /sys/fs/cgroup/systemd is missing and I wasn't able to create that manually or using the script. Looks like /sys/fs/cgroup is missing.

Sorry if this is off-topic but I am desperate to fix it. Here a log from sudo apt-get install libpam-systemd:

...
Setting up libpam-systemd:amd64 (204-5ubuntu20.4) ...
start: Job failed to start
invoke-rc.d: initscript systemd-logind, action "start" failed.
dpkg: error processing package libpam-systemd:amd64 (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 libpam-systemd:amd64

Revision history for this message
Luis Boullosa (luisboullosa) wrote :

The problem has arisen again in my system when updating to systemd-services 204-5ubuntu20.5.

I downgraded to the 204-5ubuntu20.4 version and the error disappeared, so I guess the latest version is provoking the error now.

Revision history for this message
Martin Pitt (pitti) wrote :

@Luis: That version (http://launchpadlibrarian.net/182673897/systemd_204-5ubuntu20.4_204-5ubuntu20.5.diff.gz) does not change anything related to this bug at all, so this sounds like a race condition and pure coincidence. However, you posted this to both here and bug 1309025 and both are already fixed/closed. If you still experience crashes, please report them as new bugs, as they are most certainly different. Thanks!

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.