xcb_xlib.c:50: xcb_xlib_unlock: Assertion …
Monday, January 12th, 2009I think it was some component of KDE 4.1.x, which required a libX11 with enabled xcb use flag in Gentoo Linux. So I recompiled the library with the correct use flag. However, this in turn cause problems with Java (1.4 versions I think). I noticed it the first time, when I installed the latest Jalbum 8.1* version. When the Jalbum installer is started, it aborts with an assertion:
java: xcb_xlib.c:82: xcb_xlib_unlock: Assertion `c->xlib.lock' failed.
This was on my Linux box at home. After some googleing I fixed it by updating some library and completely forgot about it.
Now, at work I wanted to install the new DB2 Express C 9.5.2beta and came across the exact same problem, now with a IBM Java version, which is included in the DB2 installation package (J2RE 5.0 IBM J9 2.3). One fix, that can be found on the Net is the following:
sed -i 's/XINERAMA/FAKEEXTN/g' */jre/bin/xawt/libmawt.so
In case for my DB2 installation, this is somewhat messy, since it would require the unpacking and repackaging of the DB2 Java archive.
The fix, that I used for my original Jalbum installation problem and which is the best solution IMHO, at least for Gentoo people, is to replace the libxcb with a newer version, which contains a workaround for the xcb_xlib_unlock assertion.
This means, that first of all x11-libs/libxcb and x11-proto/xcb-proto need to be included in the /etc/portage/keywords file. Then I installed these packages:
# equery l xcb
[ Searching for package 'xcb' in all categories among: ]
* installed packages
[I--] [ ~] x11-libs/libxcb-1.1.90.1 (0)
[I--] [ ] x11-libs/xcb-util-0.2 (0)
[I--] [ ~] x11-proto/xcb-proto-1.2 (0)
You can check with this command line, if you have a libxcb with the appropiate workaround.
# strings /usr/lib/libxcb.so|grep XCB
LIBXCB_ALLOW_SLOPPY_LOCK
Now you can set the LIBXCB_ALLOW_SLOPPY_LOCK environment variable appropriately.
export LIBXCB_ALLOW_SLOPPY_LOCK=1
Now, the 1.4 Java should successfully run. You will still get an error message, but the program won’t abort. This assertion problem should be fixed at least in the current 1.6 Java versions.
