0

`c->xlib.lock' failed error on Java applications

Ubuntu, Java

I am currently using the Alpha 3 release of Ubuntu 8.04 Hardy Heron.  Considering the fact that it is an alpha release, I tend to not get worked up over little errors that might occur.  However, I have found one that I just couldn't get around.  I use Aqua Data Studio for my database client and since loading Hardy Heron, I have been unable to run it.

When I would start it from a terminal, I would get a dump that looked like this:

#0 /usr/lib/libxcb-xlib.so.0 [0x90d00767]
#1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_unlock+0x31) [0x90d008b1]
#2 /usr/lib/libX11.so.6(_XReply+0xfd) [0x9039429d]
#3 /usr/lib/jvm/java-6-sun-1.6.0.04/jre/lib/i386/xawt/libmawt.so [0x9063e8ce]
#4 /usr/lib/jvm/java-6-sun-1.6.0.04/jre/lib/i386/xawt/libmawt.so [0x9061b067]
#5 /usr/lib/jvm/java-6-sun-1.6.0.04/jre/lib/i386/xawt/libmawt.so [0x9061b318]
#6 /usr/lib/jvm/java-6-sun-1.6.0.04/jre/lib/i386/xawt/libmawt.so(Java_sun_awt_X11GraphicsEnvironment_initDisplay+0x2f) [0x9061b61f]
#7 [0xb4cff3aa]
#8 [0xb4cf7f0d]
#9 [0xb4cf7f0d]
#10 [0xb4cf5249]
#11 /usr/lib/jvm/java-6-sun-1.6.0.04/jre/lib/i386/server/libjvm.so [0x637338d]
#12 /usr/lib/jvm/java-6-sun-1.6.0.04/jre/lib/i386/server/libjvm.so [0x64fd168]
#13 /usr/lib/jvm/java-6-sun-1.6.0.04/jre/lib/i386/server/libjvm.so [0x6373220]
#14 /usr/lib/jvm/java-6-sun-1.6.0.04/jre/lib/i386/server/libjvm.so(JVM_DoPrivileged+0x363) [0x63c90d3]
#15 /usr/lib/jvm/java-6-sun-1.6.0.04/jre/lib/i386/libjava.so(Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2+0x3d) [0xb7d1096d]
#16 [0xb4cff3aa]
#17 [0xb4cf7da7]
#18 [0xb4cf5249]
#19 /usr/lib/jvm/java-6-sun-1.6.0.04/jre/lib/i386/server/libjvm.so [0x637338d]
java: xcb_xlib.c:82: xcb_xlib_unlock: Assertion `c->xlib.lock' failed.
Aborted (core dumped)


Considering the fact that I used the Ubuntu sun-java6-jdk package from the Ubuntu repository, I decided that I would try the self-extracting bin that is available on http://java.sun.com.  After swapping to that JVM, I still received the same dump and abort.  After doing a bit of searching, I came across a patch in one of the bug reporting forums that effectively patches your JVM and prevents this error from occurring.  I ran the patch and now everything works as it should.   If you are receiving this error, create a shell script with the following content and run it.  Assuming that it runs successfully, you should then be able to open the Java application that was failing.
#!/bin/sh
# S. Correia
# 2007 11 21
# A simple script to patch the java library in order
# to solve the problem with "Assertion 'c->xlib.lock' failed."
# see bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6532373
LIB_TO_PATCH=libmawt.so
for f in `find /usr/lib/jvm -name "$LIB_TO_PATCH"`
do
echo "Patching library $f"
sudo sed -i 's/XINERAMA/FAKEEXTN/g' "$f"
done


Big thanks to "S. Correia" for getting me back on my feet!

tags:
Linux, JVM, core dump
nikopol said:
 
Nice one! Allowed me to get jbidwatcher working again. Thanks for posting this hack.
 
posted 645 days ago
Add Comment Reply to: this comment OR this thread
 
Simon said:
 
Wow, it actually works. Thank you so much; this has been plaguing me for several weeks.
 
posted 644 days ago
Add Comment Reply to: this comment OR this thread
 
 
You are welcome. Glad it worked for someone else too!
 
posted 644 days ago
Add Comment Reply to: this comment OR this thread
 
jgraham said:
 
Thanks a bunch for posting this. I've been hitting my head for over an hour. Who said that running alpha was a bad idea?
 
posted 634 days ago
Add Comment Reply to: this comment OR this thread
 
Starhawk said:
 
Great job here. I didn't have this problem but found this post helping someone on the Ubuntu forums trying to get frostwire working. You saved me alot of work and it worked like a charm :)
 
posted 634 days ago
Add Comment Reply to: this comment OR this thread
 
Damien Joldersma said:
 
Thank you! This helped me very much, I couldn't run DbVisualizer either on Hardy Heron.
 
posted 633 days ago
Add Comment Reply to: this comment OR this thread
 
Siegfried Sheldrake said:
 
Great! This script allowed me to get Freeguide working!

Cheers. :)
 
posted 624 days ago
Add Comment Reply to: this comment OR this thread
 
Vijaymateti said:
 
Hi that really saved my day. Me too using ubuntu 8.04 alpha3 and i tried to install netbeans on it and it throws exactly same error.

Thanks for the patch.
 
posted 611 days ago
Add Comment Reply to: this comment OR this thread
 
robline said:
 
Just another thanks to throw into the chorus. a simple sh javapatch.sh and I'm off to the races.
 
posted 578 days ago
Add Comment Reply to: this comment OR this thread
 
jjoshi said:
 
thanks for the patch. my netbeans stopped working today giving me this error. the patch fixed it.
 
posted 465 days ago
Add Comment Reply to: this comment OR this thread
 
Sam said:
 
Thanks, Dave, for the brilliant guide. Helped me fix the problem on Fedora 8 / JRE 1.6 (NetBeans pack), with minor modifications derived out of common sense. Keep up the good work. Cheers !
 
posted 457 days ago
Add Comment Reply to: this comment OR this thread
 
WOW gold said:
 
 
posted 200 days ago
Add Comment Reply to: this comment OR this thread
 

Search