GNOME Bugzilla – Bug 751739
Deadlock in X11 when setting XSetErrorHandler while another thread is opening display with XOpenDisplay
Last modified: 2015-07-01 15:30:55 UTC
<owen> thiblahute: the problem shown by the backtraces is a) thread A - XGrabServer() [server grab is established]; XSetErrorHandler() [wants global lock within process] <owen> b) thread B) - XOpenDisplay - gets the global lock and keeps it until the display is open, then tries to open the display, but the server is grabbed <owen> I think moving the gdk_x11_display_error_trap_push()/pop() calls in gdk_x11_device_xi2_window_at_position() to outside everything and checking the return values from XIQueryPointer() fixes the problem <owen> garnacho_: ^^^^^^^^^^^^^^^^ * mcrha is now known as mcrha|afk <owen> It's really more of an xlib issue, though not entirely sure how to fix it - I do wonder *why* XOpenDisplay needs to hold the global lock across the xcb calls to open the displayXOpenDisplay
+ Trace 235215
Thread 11 (Thread 0x7f2b1b013700 (LWP 17219))
Thread 10 (Thread 0x7f2b1a812700 (LWP 17220))
Thread 9 (Thread 0x7f2b1a011700 (LWP 17221))
Thread 8 (Thread 0x7f2b19810700 (LWP 17222))
Thread 7 (Thread 0x7f2b1900f700 (LWP 17223))
Thread 6 (Thread 0x7f2b1880e700 (LWP 17224))
Thread 5 (Thread 0x7f2b037fe700 (LWP 17226))
Thread 4 (Thread 0x7f2b027fc700 (LWP 17228))
Thread 1 (Thread 0x7f2b47e47700 (LWP 17214))
Created attachment 306425 [details] [review] x11: Avoid X error traps within server grabs gdk_x11_device_xi2_window_at_position() may attempt to push/pop a few error trap pairs while traversing the window tree. Move it outside the server grab, and around the multiple XIQueryPointer calls we may do here.
Review of attachment 306425 [details] [review]: ok
Attachment 306425 [details] pushed as 0f3995a - x11: Avoid X error traps within server grabs
Any luck to get that backported on the 3.16 branch?