Cannot start matlab 2007b in ubuntu/xubuntu (hardy alpha-5)

Asked by chriswcy

Hi,

I have just upgraded the ubuntu/xubuntu 7.10 of my computers (home/office) to 8.04 alpha 5. I found that I cannot start matlab 2007b even I reinstall it. The terminal shows the following and then aborts matlab (I have installed matlab in /usr/local/matlab75/):

-----------------------------------------------------------------------------------------------------------------------------------------------------------------
xxx@ubuntu:~$ matlab
Locking assertion failure. Backtrace:
#0 /usr/lib/libxcb-xlib.so.0 [0xb5581767]
#1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_unlock+0x31) [0xb55818b1]
#2 /usr/lib/libX11.so.6(_XReply+0xfd) [0xb591529d]
#3 /usr/local/matlab75/sys/java/jre/glnx86/jre1.6.0/lib/i386/xawt/libmawt.so [0xaef4922e]
#4 /usr/local/matlab75/sys/java/jre/glnx86/jre1.6.0/lib/i386/xawt/libmawt.so [0xaef27ed7]
#5 /usr/local/matlab75/sys/java/jre/glnx86/jre1.6.0/lib/i386/xawt/libmawt.so [0xaef28188]
#6 /usr/local/matlab75/sys/java/jre/glnx86/jre1.6.0/lib/i386/xawt/libmawt.so(Java_sun_awt_X11GraphicsEnvironment_initDisplay+0x2f) [0xaef2848f]
#7 [0xafe1a68e]
#8 [0xafe12e9d]
#9 [0xafe12e9d]
#10 [0xafe10207]
#11 /usr/local/matlab75/sys/java/jre/glnx86/jre1.6.0/lib/i386/client/libjvm.so [0x620967d]
#12 /usr/local/matlab75/sys/java/jre/glnx86/jre1.6.0/lib/i386/client/libjvm.so [0x63057d8]
#13 /usr/local/matlab75/sys/java/jre/glnx86/jre1.6.0/lib/i386/client/libjvm.so [0x6209510]
#14 /usr/local/matlab75/sys/java/jre/glnx86/jre1.6.0/lib/i386/client/libjvm.so(JVM_DoPrivileged+0x34b) [0x625f38b]
#15 /usr/local/matlab75/sys/java/jre/glnx86/jre1.6.0/lib/i386/libjava.so(Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2+0x3d) [0xb1e7c96d]
#16 [0xafe1a68e]
#17 [0xafe12d37]
#18 [0xafe10207]
#19 /usr/local/matlab75/sys/java/jre/glnx86/jre1.6.0/lib/i386/client/libjvm.so [0x620967d]
MATLAB: xcb_xlib.c:82: xcb_xlib_unlock: Assertion `c->xlib.lock' failed.
Aborted (core dumped)
xxx@ubuntu:~$
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

How to solve it? Is it a bug of hardy?

Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
linovski (avelinorego) said :
#1

I think so, it's a bug.
See
https://bugs.launchpad.net/ubuntu/+source/libxcb/+bug/185311
and
https://bugs.launchpad.net/xorg-server/+bug/185311

for now I solved the problem this way:
 sudo sed -i 's/XINERAMA/FAKEEXTN/g' /usr/lib/jvm/java-6-sun-1.6.0.04/jre/lib/i386/xawt/libmawt.so

I didn't tried it:
There is a workaround: just give Shell-command
 export LIBXCB_ALLOW_SLOPPY_LOCK=1
before you start a java program.

Revision history for this message
anabelli (anabelli) said :
#2

## Matlab r2007b under Hardy Heron ##

sudo sed -i 's/XINERAMA/FAKEEXTN/g' $MATLAB/sys/java/jre/glnx86/jre1.6.0/lib/i386/xawt/libmawt.so

where $MATLAB := matlab's root.

To me:
this and "export LIBXCB_ALLOW_SLOPPY_LOCK=1" make matlab start, but the application is unusable: the window is empty.

I then tried to turn down visual effects ("None") and this got the job done. Now Matlab r2007b runs smoothly.

Revision history for this message
Olivier (olivier-lacroix) said :
#3

To get it working with visual effects you need to enter this before running it

export AWT_TOOLKIT=MToolkit

Revision history for this message
anabelli (anabelli) said :
#4

Olivier:
"export AWT_TOOLKIT=MToolkit" causes this:

me@myhost:~$ export AWT_TOOLKIT=MToolkit
me@myhost:~$ /opt/matlab/bin/matlab
Locking assertion failure. Backtrace:
#0 /usr/lib/libxcb-xlib.so.0 [0xb55a3767]
#1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_unlock+0x31) [0xb55a38b1]
#2 /usr/lib/libX11.so.6(_XReply+0xfd) [0xb593729d]
#3 /opt/matlab/sys/java/jre/glnx86/jre1.6.0/lib/i386/motif21/libmawt.so [0xaf0a428e]
#4 /opt/matlab/sys/java/jre/glnx86/jre1.6.0/lib/i386/motif21/libmawt.so [0xaf048b77]
#5 /opt/matlab/sys/java/jre/glnx86/jre1.6.0/lib/i386/motif21/libmawt.so [0xaf048e28]
#6 /opt/matlab/sys/java/jre/glnx86/jre1.6.0/lib/i386/motif21/libmawt.so(Java_sun_awt_X11GraphicsEnvironment_initDisplay+0x2f) [0xaf04912f]
#7 [0xafe3b67e]
#8 [0xafe33e9d]
#9 [0xafe33e9d]
#10 [0xafe31207]
#11 /opt/matlab/sys/java/jre/glnx86/jre1.6.0/lib/i386/client/libjvm.so [0x620967d]
#12 /opt/matlab/sys/java/jre/glnx86/jre1.6.0/lib/i386/client/libjvm.so [0x63057d8]
#13 /opt/matlab/sys/java/jre/glnx86/jre1.6.0/lib/i386/client/libjvm.so [0x6209510]
#14 /opt/matlab/sys/java/jre/glnx86/jre1.6.0/lib/i386/client/libjvm.so(JVM_DoPrivileged+0x34b) [0x625f38b]
#15 /opt/matlab/sys/java/jre/glnx86/jre1.6.0/lib/i386/libjava.so(Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedAction_2+0x3d) [0xb1e9d96d]
#16 [0xafe3b67e]
#17 [0xafe33d37]
#18 [0xafe31207]
#19 /opt/matlab/sys/java/jre/glnx86/jre1.6.0/lib/i386/client/libjvm.so [0x620967d]
MATLAB: xcb_xlib.c:82: xcb_xlib_unlock: Assertion `c->xlib.lock' failed.
Aborted (core dumped)

Revision history for this message
anabelli (anabelli) said :
#5

I fixed it this way:

------------------

1.
Matlab uses a jvm of its own.

adding this

"export MATLAB_JAVA=/usr/lib/jvm/java-6-sun-1.6.0.04/jre"

as first line of $MATLABROOT/bin/matlab .

Makes Matlab use an external jvm (java-6-sun-1.6.0.04 for me).

2.
sudo sed -i 's/XINERAMA/FAKEEXTN/g' /usr/lib/jvm/java-6-sun-1.6.0.04/jre/lib/i386/xawt/libmawt.so

Some magic I can't explain.

-------------------

Trivial consideration:
In both instructions the string "java-6-sun-1.6.0.04" must be modified to match the actual installation.

Revision history for this message
bjtaylor01 (bentaylorche) said :
#6

editing the matlab bash file in:
$matlab_root/bin/matlab

I added:
export AWT_TOOLKIT=MToolkit
export MATLAB_JAVA=/usr/lib/jvm/java-6-sun-1.6.0.04/jre/
export LIBXCB_ALLOW_SLOPPY_LOCK=1

But it was still crashing, then when I removed AWT_TOOLKIT=MToolkit it worked just fine with visual effects.

So just put this in your matlab file at the very top (below the bash part)
export MATLAB_JAVA=/usr/lib/jvm/java-6-sun-1.6.0.04/jre/
export LIBXCB_ALLOW_SLOPPY_LOCK=1

I also ran:
sudo sed -i 's/XINERAMA/FAKEEXTN/g' $MATLAB_ROOT/sys/java/jre/glnxa64/jre1.5.0/lib/amd64/xawt/libmawt.so

As you can see I am using the 64 bit so I had to use:
find -name libmawt.so
In my Matlab directory to find my specific location of the libmawt.so file.

So now my Matlab is working great with full visual effects.

Revision history for this message
Thomas Lee (azthomas) said :
#7

OS: Ubuntu 8.04 amd64 with a clean installation few days ago
MATLAB version: Matlab 2008a

Previously on Ubuntu 7.10, Matlab crash.
But on 8.04, firstly, without any other java package, matlab will run flawlessly.

However, after installing java-1.5.0.15 (because Eclipse has recommended on that for stability), execute matlab will result in the following error messages
even when I
export MATLAB_JAVA=/usr/lib/jvm/java-1.5.0-sun-1.5.0.15/jre

Locking assertion failure. Backtrace:
#0 /usr/lib/libxcb-xlib.so.0 [0x7fbb1fe4897c]
#1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_unlock+0x24) [0x7fbb1fe48a84]
#2 /usr/lib/libX11.so.6(_XReply+0x10f) [0x7fbb2181ff4f]
#3 /usr/lib/jvm/java-1.5.0-sun-1.5.0.15/jre/lib/amd64/xawt/libmawt.so [0x7fbaf8a1dd7b]
#4 /usr/lib/jvm/java-1.5.0-sun-1.5.0.15/jre/lib/amd64/xawt/libmawt.so [0x7fbaf8a0ae9c]
#5 /usr/lib/jvm/java-1.5.0-sun-1.5.0.15/jre/lib/amd64/xawt/libmawt.so [0x7fbaf8a0affe]
#6 /usr/lib/jvm/java-1.5.0-sun-1.5.0.15/jre/lib/amd64/xawt/libmawt.so(Java_sun_awt_X11GraphicsEnvironment_initDisplay+0x9) [0x7fbaf8a0b1c9]
#7 [0x7fbb15827f7b]
Locking assertion failure. Backtrace:
#0 /usr/lib/libxcb-xlib.so.0 [0x7fbb1fe4897c]
#1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_lock+0x15) [0x7fbb1fe48a15]
#2 /usr/lib/libX11.so.6 [0x7fbb2181f323]
#3 /usr/lib/libX11.so.6(XGetVisualInfo+0x2c) [0x7fbb2181672c]
#4 /usr/lib/jvm/java-1.5.0-sun-1.5.0.15/jre/lib/amd64/xawt/libmawt.so [0x7fbaf8a0a1f7]
#5 /usr/lib/jvm/java-1.5.0-sun-1.5.0.15/jre/lib/amd64/xawt/libmawt.so [0x7fbaf8a0a431]
#6 /usr/lib/jvm/java-1.5.0-sun-1.5.0.15/jre/lib/amd64/xawt/libmawt.so [0x7fbaf8a0b099]
#7 /usr/lib/jvm/java-1.5.0-sun-1.5.0.15/jre/lib/amd64/xawt/libmawt.so(Java_sun_awt_X11GraphicsEnvironment_initDisplay+0x9) [0x7fbaf8a0b1c9]
#8 [0x7fbb15827f7b]

The solution is to install "java-6-sun-1.6.0.06" package in the Ubuntu repository, and
export MATLAB_JAVA=/usr/lib/jvm/java-6-sun-1.6.0.06/jre/
as suggested by previous posts

It now works perfectly.

Revision history for this message
laplaceme (laplaceme) said :
#8

bjtaylor01's method worked for my case:
amd64 ubuntu 8.04 matlab 2008a
Thanks.

Revision history for this message
jedi (saygin) said :
#9

hi all,
i have been encountering same problem on kubuntu. when i ran from konsole, i got the same error, however matlab worked fine; but when launched from kicker i see splash screen and then it gets away.
by using bjtaylor's method, now i got rid of error messages when i run from console, but still i cannot run from kicker, nor i can click bash script from dolphin: result is same, splash screen appears and then whole process quits.

thanks.

Revision history for this message
Trevor Chart (trvcht) said :
#10

jedi,

In order to run MATLAB from any sort of menu, you have to pass it the "-desktop" option. Otherwise, it looks for a terminal tied to it and, finding none, dies. the -desktop option tells MATLAB that it doesn't have a terminal associated with it, so it doesn't look or die as a result.

Trevor

Revision history for this message
jose.juan.jose (jose.juan.jose-deactivatedaccount) said :
#11

I am using Matlab 2008b and it works out perfectly, but my problem is with Alt-Gr key(because it doesnt work). I have changed java with:
export MATLAB_JAVA="/usr/lib64/jvm/java-6-sun-1.6.0.10/jre"
export MATLAB_JAVA="/usr/lib64/jvm/java-6-sun/jre/"

But this key continues in the same way.
What it happens?? Thanks

Revision history for this message
Avinash Parnandi (bunnu) said :
#12

1) Disable compiz effects

2) Put in the symbolic links(update the 'matlab' link in /usr/local/bin to point to this matlab in /media/disk/matlabroot/bin.):
ln -s /media/disk/MATLAB/bin/matlab /usr/local/bin/matlab
ln -s /media/disk/MATLAB/bin/mex /usr/local/bin/mex

3) for getting the toolbars 1. Open the executable Matlab script, ~/matlab/bin/matlab in gedit.
                                            2. Copy and paste "export AWT_TOOLKIT=MToolkit" into the first line of the file.
                                            3. Save the file.

Can you help with this problem?

Provide an answer of your own, or ask chriswcy for more information if necessary.

To post a message you must log in.