GNOME Bugzilla – Bug 413032
Locking issue with xcb in IA__gdk_display_sync
Last modified: 2007-03-09 05:33:09 UTC
Hi, with latest gtk 2.10.9 and xcb 1.0 several gtk applications fail with a assertion in XCB's locking code: xcb_xlib.c:41: xcb_xlib_lock: Assertion `!c->xlib.lock' failed. Below I'll attach backtraces for xchat and epiphany showing this behaviour. All were produced by having a Gtk window unfocused and dragging some window from the wnck window applet to this window a few times. nautilus and other's can be crashed the same way. It wasn't always the application that was dragged or to which was dragged that crashed. Bye
xchat:
+ Trace 114601
epiphany (Thread 1 crashed running the Gtk main loop... for both backtraces):
+ Trace 114602
Thread 1 (process 9902)
Might be related to bug #353842 though this was with normal libX11... probably a deadlock while xcb just asserts for this.
Also crashes gnome-panel under some situations, backtrace is different there though and one gets a segfault and no xcb assertions... but at the same time most of the time other apps, like xchat or epiphany for example, crash with the xcb assertion pasted above. Below is the gnome-panel backtrace:
+ Trace 114656
Thread 1 (process 7953)
I can reproduce this also, if any other backtraces are needed. Ubuntu bug: https://launchpad.net/ubuntu/+source/gtk+2.0/+bug/88608
And also happens completely unmotivated, without moving the cursor or typing something. Just happend to me with epiphany...
This turns out to be an incompatibility between traditional and xcb-ified xlib wrt to some semi-internal apis. Old libX11 executed the async callbacks outside of the display lock, xcb does it inside the lock. Thus the we deadlock as soon as the callback calls back into libX11. Possible fixes: - rewrite gdkasync.c to use xcb directly, rather than rely on the xcb-emulation of internal Xlib apis. This is quite a bit of work, and probably best undertaken in the context of an xcb backend for GDK. - defer the callbacks to an idle.
2007-03-08 Matthias Clasen <mclasen@redhat.com> * gdk/x11/gdkasync.c (send_event_handler): Defer the callbacks to an idle to avoid deadlock with xcb-ified libX11. (#413032, Sebastian Dröge)