LightDM leaves a systemd session after login

Bug #1441356 reported by Andrey Vihrov
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Light Display Manager
New
Undecided
Unassigned
LightDM GTK Greeter
New
Unknown

Bug Description

LightDM leaves a running systemd session after the user logs in. The session is permanently in the "closing" state. Typical loginctl output:

> loginctl session-status c7
c7 - lightdm (620)
           Since: Tue 2015-04-07 23:01:15 EEST; 11min ago
          Leader: 13751
            Seat: seat0; vc1
         Display: :0
         Service: lightdm-greeter; type x11; class greeter
           State: closing
            Unit: session-c7.scope
                  |-13766 dbus-launch --autolaunch=6f5e72077d76e68732c97a0900000a8c --binary-syntax --close-stderr
                  `-13767 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session

The manual fix is to run "sudo loginctl terminate-session <session>" each time.

My component versions are:

lightdm 1.14.0
lightdm-gtk-greeter 2.0.0
systemd 218
dbus 1.8.16

description: updated
Revision history for this message
Andrew P. (kalgasnik) wrote :

Results of small investigation.
This bug caused by deadlock deep inside X/XCB library.

1. Lightdm wants to close a greeter and sends SIGTERM to it.
2. Greeter catches that signal and calls gtk_main_quit() to stop main gtk loop.
3. There is a gdk_flush() call inside gtk_main → it calls gdk_display_sync() → XSync() → deadlock.
4. Greeter hangs.

0x00007f62c335f4ed in poll () from /usr/lib/libc.so.6
(gdb) bt
#0 0x00007f62c335f4ed in poll () from /usr/lib/libc.so.6
#1 0x00007f62c30689f2 in ?? () from /usr/lib/libxcb.so.1
#2 0x00007f62c306a2ff in ?? () from /usr/lib/libxcb.so.1
#3 0x00007f62c306a411 in xcb_wait_for_reply () from /usr/lib/libxcb.so.1
#4 0x00007f62c59bf727 in _XReply () from /usr/lib/libX11.so.6
#5 0x00007f62c59bb11d in XSync () from /usr/lib/libX11.so.6
#6 0x00007f62c4bbd13c in gdk_flush () from /usr/lib/libgdk-3.so.0
#7 0x00007f62c507069f in gtk_main () from /usr/lib/libgtk-3.so.0
#8 0x000000000040cdcc in main ()

Any call to XSync() after SIGTERM leads to deadlock.

This issue appeared after upgrading Gtk from 3.15.1 to 3.15.2.
I'm not familiar with all this X stuff, so I don't have real solution.
The simplest workaround - exit() in SIGTERM handler.

Revision history for this message
Andrey Vihrov (andrey.vihrov) wrote :

I think that #1445461 is not a duplicate bug. There seem to be two separate problems:

* The problem described in #1445461 happens on lock/unlock, leaves a running greeter and started happening with GTK 3.15+.
* The problem described here happens on login only, leaves only two dbus processes in the session and is reproducible with GTK 3.14 too.

Revision history for this message
Andrew P. (kalgasnik) wrote :

Yep, just checked it on another machine - #1441356 still present even if greeter terminates correctly.

Sean Davis (bluesabre)
Changed in lightdm-gtk-greeter:
importance: Undecided → Unknown
status: New → Unknown
Changed in lightdm-gtk-greeter:
status: Unknown → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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