Bug 1061031

Summary: [abrt] systemd: log_assert(): systemd-logind killed by SIGABRT
Product: [Fedora] Fedora Reporter: Hans de Goede <hdegoede>
Component: systemdAssignee: systemd-maint
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: johannbg, lnykryn, msekleta, plautrba, systemd-maint, vpavlin, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/be45f55a0f0461cc81ad4f6a12a960d51dea5330
Whiteboard: abrt_hash:dcd05495dd5485efedaf4b0b826f7c8593b8762c
Fixed In Version: systemd-208-15.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-08 03:34:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace
none
File: cgroup
none
File: core_backtrace
none
File: dso_list
none
File: environ
none
File: limits
none
File: maps
none
File: open_fds
none
File: proc_pid_status
none
File: var_log_messages none

Description Hans de Goede 2014-02-04 09:31:04 UTC
Description of problem:
While testing my root less Xorg patches I noticed that systemd-logind seems to crash when I plug + unplug a microsoft office keyboard when using an Xorg which uses systemd-logind to get fds for input devices and drm nodes.

What I did was:
1) startx
2) switch to a different VT
3) plug in VT
4) switch back to X
5) unplug keyboard
6) systemd-logind crashes

The above translates to the following dbus interaction with systemd-logind:

1) TakeControl
2) TakeDevice for /dev/dri/card0 + all input devs
3) Receive pause signals for all of the above
4) TakeDevice for the 1st of the *2* new /dev/input/event? nodes for the ms keyb.
5) ReleaseDevice for the above dev (as it is paused)
6) TakeDevice for the 2nd of the *2* new /dev/input/event? nodes for the ms keyb.
7) ReleaseDevice (as it is paused)
8) Receive resume signal for the drm node
9) TakeDevice both /dev/input/event? nodes for the ms keyb.
10) Receive resume signal for other input nodes
11) Upon the udev remove event for the 1st of the *2* new /dev/input/event? nodes, call ReleaseDevice
12) The ReleaseDevice call times out (systemd-logind is gone)

I think this may be a race where systemd-logind is handling the udev remove event itself and at the same time
the ReleaseDevice call comes in, and depending on timing this makes systemd-logind "unhappy".

Version-Release number of selected component:
systemd-208-9.fc20

Additional info:
reporter:       libreport-2.1.11
backtrace_rating: 4
cmdline:        /usr/lib/systemd/systemd-logind
crash_function: log_assert
executable:     /usr/lib/systemd/systemd-logind
kernel:         3.12.5-302.fc20.x86_64
runlevel:       N 5
type:           CCpp
uid:            0

Truncated backtrace:
Thread no. 1 (9 frames)
 #2 log_assert at ../src/shared/log.c:699
 #3 log_assert_failed at ../src/shared/log.c:704
 #4 close_nointr_nofail at ../src/shared/util.c:182
 #5 session_device_free at ../src/login/logind-session-device.c:410
 #6 device_detach at ../src/login/logind-device.c:77
 #7 device_free at ../src/login/logind-device.c:60
 #8 manager_process_seat_device at ../src/login/logind-core.c:266
 #9 manager_dispatch_device_udev at ../src/login/logind.c:529
 #10 manager_run at ../src/login/logind.c:1188

Potential duplicate: bug 907890

Comment 1 Hans de Goede 2014-02-04 09:31:11 UTC
Created attachment 858989 [details]
File: backtrace

Comment 2 Hans de Goede 2014-02-04 09:31:14 UTC
Created attachment 858990 [details]
File: cgroup

Comment 3 Hans de Goede 2014-02-04 09:31:17 UTC
Created attachment 858991 [details]
File: core_backtrace

Comment 4 Hans de Goede 2014-02-04 09:31:24 UTC
Created attachment 858992 [details]
File: dso_list

Comment 5 Hans de Goede 2014-02-04 09:31:27 UTC
Created attachment 858993 [details]
File: environ

Comment 6 Hans de Goede 2014-02-04 09:31:31 UTC
Created attachment 858994 [details]
File: limits

Comment 7 Hans de Goede 2014-02-04 09:31:34 UTC
Created attachment 858995 [details]
File: maps

Comment 8 Hans de Goede 2014-02-04 09:31:37 UTC
Created attachment 858996 [details]
File: open_fds

Comment 9 Hans de Goede 2014-02-04 09:31:39 UTC
Created attachment 858997 [details]
File: proc_pid_status

Comment 10 Hans de Goede 2014-02-04 09:31:42 UTC
Created attachment 858998 [details]
File: var_log_messages

Comment 11 Hans de Goede 2014-02-04 10:38:17 UTC
The cause for this is that session_device_free is calling close_nointr_nofail, this is already
fixed upstream by using close_nointr instead.

Comment 12 Fedora Update System 2014-03-05 21:38:18 UTC
systemd-208-15.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/systemd-208-15.fc20

Comment 13 Fedora Update System 2014-03-07 06:27:51 UTC
Package systemd-208-15.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing systemd-208-15.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-3522/systemd-208-15.fc20
then log in and leave karma (feedback).

Comment 14 Fedora Update System 2014-03-08 03:34:39 UTC
systemd-208-15.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.