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

Asked by chriswcy on 2008-03-08


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/ [0xb5581767]
#1 /usr/lib/ [0xb55818b1]
#2 /usr/lib/ [0xb591529d]
#3 /usr/local/matlab75/sys/java/jre/glnx86/jre1.6.0/lib/i386/xawt/ [0xaef4922e]
#4 /usr/local/matlab75/sys/java/jre/glnx86/jre1.6.0/lib/i386/xawt/ [0xaef27ed7]
#5 /usr/local/matlab75/sys/java/jre/glnx86/jre1.6.0/lib/i386/xawt/ [0xaef28188]
#6 /usr/local/matlab75/sys/java/jre/glnx86/jre1.6.0/lib/i386/xawt/ [0xaef2848f]
#7 [0xafe1a68e]
#8 [0xafe12e9d]
#9 [0xafe12e9d]
#10 [0xafe10207]
#11 /usr/local/matlab75/sys/java/jre/glnx86/jre1.6.0/lib/i386/client/ [0x620967d]
#12 /usr/local/matlab75/sys/java/jre/glnx86/jre1.6.0/lib/i386/client/ [0x63057d8]
#13 /usr/local/matlab75/sys/java/jre/glnx86/jre1.6.0/lib/i386/client/ [0x6209510]
#14 /usr/local/matlab75/sys/java/jre/glnx86/jre1.6.0/lib/i386/client/ [0x625f38b]
#15 /usr/local/matlab75/sys/java/jre/glnx86/jre1.6.0/lib/i386/ [0xb1e7c96d]
#16 [0xafe1a68e]
#17 [0xafe12d37]
#18 [0xafe10207]
#19 /usr/local/matlab75/sys/java/jre/glnx86/jre1.6.0/lib/i386/client/ [0x620967d]
MATLAB: xcb_xlib.c:82: xcb_xlib_unlock: Assertion `c->xlib.lock' failed.
Aborted (core dumped)

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


Question information

English Edit question
Ubuntu Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
linovski (avelinorego) said :

I think so, it's a bug.

for now I solved the problem this way:
 sudo sed -i 's/XINERAMA/FAKEEXTN/g' /usr/lib/jvm/java-6-sun-

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

Revision history for this message
anabelli (anabelli) said :

## Matlab r2007b under Hardy Heron ##

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

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 :

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 :

"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/ [0xb55a3767]
#1 /usr/lib/ [0xb55a38b1]
#2 /usr/lib/ [0xb593729d]
#3 /opt/matlab/sys/java/jre/glnx86/jre1.6.0/lib/i386/motif21/ [0xaf0a428e]
#4 /opt/matlab/sys/java/jre/glnx86/jre1.6.0/lib/i386/motif21/ [0xaf048b77]
#5 /opt/matlab/sys/java/jre/glnx86/jre1.6.0/lib/i386/motif21/ [0xaf048e28]
#6 /opt/matlab/sys/java/jre/glnx86/jre1.6.0/lib/i386/motif21/ [0xaf04912f]
#7 [0xafe3b67e]
#8 [0xafe33e9d]
#9 [0xafe33e9d]
#10 [0xafe31207]
#11 /opt/matlab/sys/java/jre/glnx86/jre1.6.0/lib/i386/client/ [0x620967d]
#12 /opt/matlab/sys/java/jre/glnx86/jre1.6.0/lib/i386/client/ [0x63057d8]
#13 /opt/matlab/sys/java/jre/glnx86/jre1.6.0/lib/i386/client/ [0x6209510]
#14 /opt/matlab/sys/java/jre/glnx86/jre1.6.0/lib/i386/client/ [0x625f38b]
#15 /opt/matlab/sys/java/jre/glnx86/jre1.6.0/lib/i386/ [0xb1e9d96d]
#16 [0xafe3b67e]
#17 [0xafe33d37]
#18 [0xafe31207]
#19 /opt/matlab/sys/java/jre/glnx86/jre1.6.0/lib/i386/client/ [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 :

I fixed it this way:


Matlab uses a jvm of its own.

adding this

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

as first line of $MATLABROOT/bin/matlab .

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

sudo sed -i 's/XINERAMA/FAKEEXTN/g' /usr/lib/jvm/java-6-sun-

Some magic I can't explain.


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

Revision history for this message
bjtaylor01 (bentaylorche) said :

editing the matlab bash file in:

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

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-

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

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

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

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

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- (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-

Locking assertion failure. Backtrace:
#0 /usr/lib/ [0x7fbb1fe4897c]
#1 /usr/lib/ [0x7fbb1fe48a84]
#2 /usr/lib/ [0x7fbb2181ff4f]
#3 /usr/lib/jvm/java-1.5.0-sun- [0x7fbaf8a1dd7b]
#4 /usr/lib/jvm/java-1.5.0-sun- [0x7fbaf8a0ae9c]
#5 /usr/lib/jvm/java-1.5.0-sun- [0x7fbaf8a0affe]
#6 /usr/lib/jvm/java-1.5.0-sun- [0x7fbaf8a0b1c9]
#7 [0x7fbb15827f7b]
Locking assertion failure. Backtrace:
#0 /usr/lib/ [0x7fbb1fe4897c]
#1 /usr/lib/ [0x7fbb1fe48a15]
#2 /usr/lib/ [0x7fbb2181f323]
#3 /usr/lib/ [0x7fbb2181672c]
#4 /usr/lib/jvm/java-1.5.0-sun- [0x7fbaf8a0a1f7]
#5 /usr/lib/jvm/java-1.5.0-sun- [0x7fbaf8a0a431]
#6 /usr/lib/jvm/java-1.5.0-sun- [0x7fbaf8a0b099]
#7 /usr/lib/jvm/java-1.5.0-sun- [0x7fbaf8a0b1c9]
#8 [0x7fbb15827f7b]

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

It now works perfectly.

Revision history for this message
laplaceme (laplaceme) said :

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

Revision history for this message
jedi (saygin) said :

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.


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


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.


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

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-"
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 :

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.