Graphical Java programs : Assertion `c->xlib.lock’ failed”

21 11 2007

If you are running linux and you had problems with some graphical Java programs (e.g. jconsole), then you could be interested in the following patch. The bug is known, but does not seem to have been solved correctly yet even if Novell indicates it as resolved. Each time I update java under OpenSuse 10.3, I must apply this patch.


#!/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

Advertisements

Actions

Information

6 responses

28 11 2007
scorreia

I updated the line: sed -i ’s/XINERAMA/FAKEEXTN/ig’ “$f”
I added /i in order to be case insensitive because there appears to be some “Xinerama” strings in some libmawt.so.
But I am not sure it is correct: It seems that since then i have other problems with awt applications in which the windows do not resize correctly and the menus do not behave as they should…
So maybe the original replacement was better:
sed -i ’s/XINERAMA/FAKEEXTN/g’ “$f”

28 12 2007
linezfanatix

Thanks for the patch. I was trying to run netbeans 6 on openSuse10.3 when I encountered this issue. I made a small change to the patch here in order to resolve

I changed the find -name /usr/lib/jvm to find -name /usr/jdk/latest

With change I was able to run netbeans.

30 12 2007
Sarek

Thanks for the little script. Seems like the problem also occurs on Ubuntu…

11 02 2008
scorreia

It seems that the last updates of java from Opensuse are now working better. I only get some warning now without the need to apply the patch.

But see also http://jamesmcdonald.id.au/general/java-on-ubuntu-hardy-development-branch-fails-to-launch
if you have problems with openoffice and ubuntu.

11 03 2008
ram

how can i rename name /usr/lib/jvm to find -name /usr/jdk/latest

11 03 2008
scorreia

I am not sure to understand what you mean. Do you want to replace “/usr/lib/jvm” by “/usr/jdk/latest”?
If you are refering to the comment from linezfanatix, just copy my script and replace “/usr/lib/jvm” by “/usr/jdk/latest” (this is the path to the installation of your JVMs, you can replace it by other paths if you need).
What linezfanatix wanted to say is only to replace “/usr/lib/jvm” by “/usr/jdk/latest”. The command “find -name /usr/lib/jvm” is not correct.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: