Comment 1 for bug 1441356

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.