Quick Fix For xcb_xlib_unlock: Assertion `c->xlib.lock’ failed Java Errors

Karol Krizka @ January 12, 2008

Linux

I am currently working on a small application in Java, but as it turns out the Ubuntu Hardy Heron SUN Java package is terribly broken in both version 5 and 6. Everytime I try to launch a simple application that requires graphics, I am greeted with the following error:

Locking assertion failure. Backtrace:
#0 /usr/lib/libxcb-xlib.so.0 [0x91202767]
#1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_unlock+0×31) [0x912028b1]
#2 /usr/lib/libX11.so.6(_XReply+0xfd) [0x90e0a29d]
#3 /usr/lib/jvm/java-6-sun-1.6.0.03/jre/lib/i386/xawt/libmawt.so [0x90f0964e]
#4 /usr/lib/jvm/java-6-sun-1.6.0.03/jre/lib/i386/xawt/libmawt.so [0x90ee7f97]
#5 /usr/lib/jvm/java-6-sun-1.6.0.03/jre/lib/i386/xawt/libmawt.so [0x90ee8248]
#6 /usr/lib/jvm/java-6-sun-1.6.0.03/jre/lib/i386/xawt/libmawt.so(Java_sun_awt_X11GraphicsEnvironment_initDisplay+0×2f) [0x90ee854f]
#7 [0xb4ca4b7b]
#8 [0xb4c9cf0d]
#9 [0xb4c9cf0d]
#10 [0xb4c9a243]
#11 /usr/lib/jvm/java-6-sun-1.6.0.03/jre/lib/i386/server/libjvm.so [0x62c5ecd]
#12 /usr/lib/jvm/java-6-sun-1.6.0.03/jre/lib/i386/server/libjvm.so [0x64523b8]
#13 /usr/lib/jvm/java-6-sun-1.6.0.03/jre/lib/i386/server/libjvm.so [0x62c5d60]
#14 /usr/lib/jvm/java-6-sun-1.6.0.03/jre/lib/i386/server/libjvm.so(JVM_DoPrivileged+0×34b) [0x631bc1b]
#15 /usr/lib/jvm/java-6-sun-1.6.0.03/jre/lib/i386/libjava.so(Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2+0×3d) [0xb7cb596d]
#16 [0xb4ca4b7b]
#17 [0xb4c9cda7]
#18 [0xb4c9a243]
#19 /usr/lib/jvm/java-6-sun-1.6.0.03/jre/lib/i386/server/libjvm.so [0x62c5ecd]
java: xcb_xlib.c:82: xcb_xlib_unlock: Assertion `c->xlib.lock’ failed.
Aborted (core dumped)

You can tempororaly disable this error by turning off the locking assertion by setting the LIBXCB_ALLOW_SLOPPY_LOCK variable to true. Just launch your java applications using the following command:

LIBXCB_ALLOW_SLOPPY_LOCK=true java Simulation

Or for a more general solution, add the following line to the bottom of your ~/.bashrc file:

export LIBXCB_ALLOW_SLOPPY_LOCK=true

This should make all your Java applications work again.

Did you enjoy this post? Then why not subscribe to my RSS feed or subscribe by e-mail? Also check out the many other FREE ways to appreciate a blogger.


Related Posts

RSS feed | Trackback URI

Comments »

No comments yet.

Name (required)
E-mail (required - never shown publicly)
URI
Subscribe to comments via email
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line=""> in your comment.

Feed