Do not turn on the xcb use flag if you plan on using =sun-jre-1.5*

Oh goodie. I decided to try the new xcb stuff so I turned on the xcb use flag in libX11 and mesa just to find out that java from sun does not work with it. Proprietary software is so much fun. Luckily a change is happening for the better as all of Sun’s java implementation will be released under the GPL in the future.

java: xcb_xlib.c:50: xcb_xlib_unlock: Assertion `c->xlib.lock' failed.

9 thoughts on “Do not turn on the xcb use flag if you plan on using =sun-jre-1.5*”

  1. This was a bug in the open-source libXi library, which has been fixed upstream.

    Proprietary software considered harmful, certainly, but not actually the source of the problem this time. 🙂

  2. Actually, it is a Java bug. That patch just disables XCB’s equivalent to segfaulting on a double-free.


    The gist of it is:
    1. Java (including 1.6) is statically linked against a VERY old libXext compiled with threading off.
    2. Java dynamically links against the modern libX11 with threading enabled and, when using the XCB version, XML-parser-like strictness.
    3. If Java detects the Xinerama X extension, it does some calls to figure out how the Xinerama desktop is put together… which causees the problem.
    4. The problem exists because the un-threaded libXext doesn’t bother to acquire the lock but the XCB-backed threaded Xlib is then asked to release the lock and cries foul over it’s equivalent of a double-free.

    To patch away XCB’s strictness is like patching away XML’s strictness or telling the Linux kernel to not throw segfaults if one program messes with another program’s memory. You’re just asking for trouble in the long run.

    According to that bug page, one of the Java people is working on solving the problem but, until they do, I’d suggest the following solution which someone on the bug page suggested instead:

    Run this sed line (adapt the path, obviously) so that Java doesn’t detect Xinerama and doesn’t call the problem code:
    sed -i ‘s/XINERAMA/FAKEEXTN/g’ /opt/sun-jdk-

Comments are closed.