Java error executing Zend StudioJava error executing Zend Studio

Posted September 28th, 2007 in Applications and PHP (Updated September 28th, 2007)

After I unwittingly upgraded from openSUSE 10.2 to openSUSE 10.3, I wasn't able to run Zend Studio 5.5.0. I would click the icon to start it up and nothing would happen; even the splash screen would not appear. I opened up a command prompt and ran Zend Studio from there, assuming I might get some sort of error output. Sure enough:

$ /path/to/ZendStudio-5.5.0/bin/ZDE
java: xcb_xlib.c:52: xcb_xlib_unlock: Assertion `c->xlib.lock' failed.
Aborted

Hmm, that looks like some sort of Java error to me. Given that I'd just done a big update to my operating system I thought that maybe Java had become screwed up or something, so the first thing I did was to reinstall it (I'd had some success in removing and then reinstalling some of the corrupted software from my upgrade). That didn't make any difference though, and I still got the same error.

So I plugged the error message into Google and first result was this page on the Sun Developer Network site. I didn't actually bother reading the text on the page, just did a Ctrl+F to find the error message on the page, which happened to be in the user submitted comments under the bug report. I scrolled down, scanning the posts for any useful information until I spotted a post that said: "I have the same problem with OpenSuSE 10.3. The sed-workaround works for me."

Aha! so a quick search on the page for "sed" and I spotted this post:

I worked with jcristau and christoph4 via IRC on #debian-x, and we managed to track down the problem with broken locking in Sun Java 1.5 and 1.6. It only occurs if Java finds the Xinerama extension, at which point it does something broken with locking and triggers the assertion. If Java never finds the Xinerama extension, it doesn't trigger the assertion for broken locking.

The following workarounds address this problem:

For sun-java5-bin:
sed -i 's/XINERAMA/FAKEEXTN/g' /usr/lib/jvm/java-1.5.0-sun-1.5.0.11/jre/lib/i386/xawt/libmawt.so

For sun-java6-bin:
sed -i 's/XINERAMA/FAKEEXTN/g' /usr/lib/jvm/java-6-sun-1.6.0.00/jre/lib/i386/xawt/libmawt.so

The same fix (applied to the appropriate file) might work for other proprietary JDKs.

I ran

sed -i 's/XINERAMA/FAKEEXTN/g' /usr/lib/jvm/java-1.5.0-sun-1.5.0.11/jre/lib/i386/xawt/libmawt.so

as the root user but got the following error message:

sed: can't read /usr/lib/jvm/java-1.5.0-sun-1.5.0.11/jre/lib/i386/xawt/libmawt.so

I used "find" the locate the actual location of the file:

find /usr/lib64/jvm -name "libmawt.so"
/usr/lib64/jvm/java-1.5.0-sun-1.5.0_update8/jre/lib/amd64/headless/libmawt.so
/usr/lib64/jvm/java-1.5.0-sun-1.5.0_update8/jre/lib/amd64/motif21/libmawt.so
/usr/lib64/jvm/java-1.5.0-sun-1.5.0_update8/jre/lib/amd64/xawt/libmawt.so

and then ran the sed command again like so:

sed -i 's/XINERAMA/FAKEEXTN/g'
/usr/lib64/jvm/java-1.5.0-sun-1.5.0_update8/jre/lib/amd64/xawt/libmawt.so

However, Zend Studio still wouldn't run, exiting with the same java: xcb_xlib.c:52: xcb_xlib_unlock: Assertion `c->xlib.lock' failed error message. I figured Zend must have its own copies of those Java files so another find on the directory Zend Studio is installed to turned up with:

$ find /path/to/ZendStudio-5.5.0 -name "libmawt.so"
/path/to/ZendStudio-5.5.0/jre/lib/i386/xawt/libmawt.so
/path/to/ZendStudio-5.5.0/jre/lib/i386/motif21/libmawt.so
/path/to/ZendStudio-5.5.0/jre/lib/i386/headless/libmawt.so

So I ran the sed command again on the Zend Studio version of the file:

sed -i 's/XINERAMA/FAKEEXTN/g' /path/to/ZendStudio-5.5.0/jre/lib/i386/xawt/libmawt.so

and this time Zend Studio was able to run. Yay!

Comments

blog comments powered by Disqus