There is a bug that calling XGetExtensionVersion() after XInitThreads() always causes a deadlock. I do not really use XGetExtensionVersion() myself, but I found a deadlock in the Qt library in the QApplication constructor, and this seems to be caused by XGetExtensionVersion() and happens only if XInitThreads() is called before. According to this forum posting (which is probably the same bug): http://www.qt-forum.org/thread.php?threadid=14988&sid=e99b9990f5fbbec62dc5e650d36b160f&hilight=XInitThreads this did not happen in XFree 4.3 - but I have not tried this myself, so I cannot confirm this. The bug can be reproduced with X.org 6.8.2 and X.org 6.9 with the following test program: Simple test program test.c to reproduce this bug: --------------------------------------------- #include <X11/Xlib.h> #include <X11/extensions/XInput.h> int main(int argc, char * argv[]) { XInitThreads(); Display * dpy = XOpenDisplay(NULL); XGetExtensionVersion (dpy, "XInputExtension"); return 0; } --------------------------------------------- gcc -I/usr/include/X11 -L/usr/X11R6/lib -lXs11 -lXi -lpthread test.c -o test
I have found this - there was a similar bug in XFree 3.3 times. http://groups.google.de/group/linux.debian.bugs.dist/browse_thread/thread/326776d4b4115fb8/a85e61eb6a7b5f89?lnk=st&q=XInitThreads+XGetExtensionVersion+deadlock&rnum=1&hl=de#a85e61eb6a7b5f89
*** Bug 5423 has been marked as a duplicate of this bug. ***
I found this in the XFree bug list: http://bugs.xfree86.org/show_bug.cgi?id=260 They have a working bugfix.
Created attachment 4163 [details] [review] Port of XFree's patch (for X.org 6.9) This patch works for me (hope there are no license issues due to license differences between X.org and XFree86)
Sorry about the phenomenal bug spam, guys. Adding xorg-team@ to the QA contact so bugs don't get lost in future.
*** Bug 1413 has been marked as a duplicate of this bug. ***
Current libXi uses _XiGetExtensionVersion which doesn't lock. The reported thread fixes this in pretty much the same way as the current git, so I'm marking as fixed.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.