[Xcb] xlibs problem ;)

Jamey Sharp jamey at minilop.net
Tue Apr 5 17:49:22 PDT 2005


Oh. I didn't notice that Gimp 2.0 was an old version. Yes, I can
reproduce the bug with Gimp 2.2.

Auggghhh. The Gimp seems to be loading libpthread.so sometime after
calling XOpenDisplay -- in fact, just about the time that the splash
screen goes away. Since XInitThreads was called long before then (from
XOpenDisplay, because Xlib/XCB hooks the LockDisplay and UnlockDisplay
bits to get its work done) the _Xglobal_lock pointer is set non-null,
but not actually initialized because libc's weak symbol for
pthread_mutex_init is a no-op. After libpthread loads, the next
_XLockMutex call suddenly goes to something that isn't a no-op any more,
which reads garbage data and hangs.

I can probably fix this inside Xlib/XCB, but I claim it's a darned
stupid thing for the Gimp to do. I can't claim it violates Xlib's API,
much as I'd like to, because the Gimp apparently never calls
XInitThreads. This seems to be another of those apps that tries very
hard to avoid testing Xlib's thread support.

--Jamey


More information about the xcb mailing list