Welcome to the Homepage of Senthil Nachimuthu
Matlab 2007b on Linux: Assertion 'c->xlib.lock' failed Print E-mail
User Rating: / 3
PoorBest 
Friday, 07 December 2007

I installed Matlab R2007b on my super fast (well, the fastest I can afford) Athlo64 machine running OpenSuse 10.3 x86_64. I got this problem which prevented Matlab from starting. Matlab showed this error message:

MATLAB: xcb_xlib.c:52: xcb_xlib_unlock: Assertion `c->xlib.lock' failed

 I found a work around to avoid this problem. Read on.

My Athlon64 computer runs openSuse 10.3 x86_64 with X.org 7.3. I get the following error when I launch Matlab R2007b (64 bit linux version).
 
 MATLAB: xcb_xlib.c:52: xcb_xlib_unlock: Assertion `c->xlib.lock' failed
 
Apparently, this problem is due to a bug in Java AWT (which Matlab uses to render the GUI). Sun Java uses/calls some libraries that do not support XCB yet, which is used by X.org 7.2 (or 7.3??) by default. This error only happens with relatively new versions of X.org.
 
If I run Matlab in a command line mode (no GUI), this error does not happen.
 
This error can be avoided by adding the following environment variable:
 
LIBXCB_ALLOW_SLOPPY_LOCK=1
 
 In openSuse, you can add the line
 
export LIBXCB_ALLOW_SLOPPY_LOCK=1
 
to your /etc/profile.local (create this file if it doesn't exist), and then refresh your environment variables by running
 
source /etc/profile
 
from the linux command line. 
 
This workaround will help avoid this problem until Java (specifically, the JVM used by Matlab) adds XCB support. 
 
Further information about this bug:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6532373 (note: In my case, editing the libmawt.so files did not fix this problem) 
 
  Update (April 24, 2008: I just noticed that Mathworks have posted the same workaround on their website for this problem, quite interestingly, on the same day that I posted the original article above.




Digg!Reddit!Del.icio.us!Google!Live!Slashdot!Netscape!Technorati!StumbleUpon!Spurl!Newsvine!Furl!Blogmarks!Yahoo!Ma.gnolia!Free social bookmarking plugins and extensions for Joomla! websites!
Last Updated ( Thursday, 24 April 2008 )
 
< Prev   Next >
Creative Commons License Copyright 2004-2008 Senthil Nachimuthu. Some rights reserved. The original work on this website is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.
Powered by Joomla