After installing matlab 7.4.0 on ubuntu hardy (8.04), I got the following stack trace on the gnome output console;

patrickd@battlestar:~$ Locking assertion failure. Backtrace:

#0 /usr/lib/libxcb-xlib.so.0 [0xb5ac0767]

#1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_unlock+0x31) [0xb5ac08b1]

#2 /usr/lib/libX11.so.6(_XReply+0xfd) [0xb5e2c1bd]

#3 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/xawt/libmawt.so [0xa090826a]

#4 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/xawt/libmawt.so [0xa08ee352]

#5 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/xawt/libmawt.so [0xa08ee599]

#6 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/xawt/libmawt.so(Java_sun_awt_X11GraphicsEnvironment_initDisplay+0x24) [0xa08ee7a4]

#7 [0xadcbdb8b]

#8 [0xadcb7a7b]

#9 [0xadcb7a7b]

#10 [0xadcb5157]

#11 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/client/libjvm.so [0xb294f8ec]

#12 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/client/libjvm.so [0xb2a3e378]

#13 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/client/libjvm.so [0xb294f71f]

#14 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/client/libjvm.so(JVM_DoPrivileged+0x2db) [0xb29a7ebb]

#15 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/libjava.so(Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2+0x3d) [0xb2f422cd]

#16 [0xadcbd43b]

#17 [0xadcb79a4]

#18 [0xadcb5157]

#19 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/client/libjvm.so [0xb294f8ec]

Locking assertion failure. Backtrace:

#0 /usr/lib/libxcb-xlib.so.0 [0xb5ac0767]

#1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_lock+0x2e) [0xb5ac081e]

#2 /usr/lib/libX11.so.6 [0xb5e2b518]

#3 /usr/lib/libX11.so.6(XGetVisualInfo+0x26) [0xb5e220a6]

#4 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/xawt/libmawt.so [0xa08ed227]

#5 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/xawt/libmawt.so [0xa08ed4b8]

#6 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/xawt/libmawt.so [0xa08ee6e0]

#7 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/xawt/libmawt.so(Java_sun_awt_X11GraphicsEnvironment_initDisplay+0x24) [0xa08ee7a4]

#8 [0xadcbdb8b]

#9 [0xadcb7a7b]

#10 [0xadcb7a7b]

#11 [0xadcb5157]

#12 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/client/libjvm.so [0xb294f8ec]

#13 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/client/libjvm.so [0xb2a3e378]

#14 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/client/libjvm.so [0xb294f71f]

#15 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/client/libjvm.so(JVM_DoPrivileged+0x2db) [0xb29a7ebb]

#16 /opt/matlab/sys/java/jre/glnx86/jre1.5.0/lib/i386/libjava.so(Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2+0x3d) [0xb2f422cd]

#17 [0xadcbd43b]

#18 [0xadcb79a4]

#19 [0xadcb5157]

Which appears to be causing the standard menus in matlab not to display, after trying various solutions found around the great wide inter web, the one that finally worked for me was to edit the matlab startup script at <$matlab_home>/bin/matlab and insert the following at the top of the file;

export AWT_TOOLKIT=MToolkit

After editing the matlab startup script it now looks like;

patrickd@battlestar:~$ head /opt/matlab/bin/matlab

#!/bin/sh

export AWT_TOOLKIT=MToolkit

#

# Name:

# matlab script file for invoking MATLAB

#

# Usage:

# matlab [-h|-help] | [-n | -e]

Note: This doesn’t actually appear to stop the error message above from appearing in the terminal window, it does however allow the menus to display which for now is all I need to fix. If I later discover that the error message is causing something else not to work in Matlab then I ‘ll update this post.