Matlab / glibc Problem on AMD 64
Setup: Matlab 7.0.4 sp2 for linux on Gentoo X86_64 Linux Server.
When I tried to run matlab command the following error
/usr/local/matlab704/bin/util/oscheck.sh: line 150: /lib64/libc.so.6: Permission denied
*** glibc detected *** malloc(): memory corruption: 0x0000000000597dc0 ***
Aborted
I spent a lot of time searching for this one on the web. One of solution which many said solved their similar problem was…
Here’s the workaround:
– Open $MATLAB/bin/.matlab7rc.sh with your favorite text editor
– Add the following lines to the top of the file:
LD_ASSUME_KERNEL=2.4.1
export LD_ASSUME_KERNEL
This seems to work for 2.4 and 2.6 kernels.
————————————————————————–
LD_ASSUME_KERNEL=2.4.21
export LD_ASSUME_KERNEL
(or) if using a CSH.
setenv LD_ASSUME_KERNEL 2.4.21
From many posts I got to know that it worked for SuSe 64 Bit platform.
For Redhat EL3 you will need
LD_ASSUME_KERNEL=2.4.19
export LD_ASSUME_KERNEL
————————————————————————
I also read as to why the LD_ASSUME_KERNEL trick works. When
Matlab is run without the trick, it gets linked to the /lib/libc.so.6
library, which contains new TLS (thread level storage) features.
Though I cannot say for sure, I’m assuming based on what Jocken
reported that there is a bug in the mmap() code.
If Matlab is run with the trick, it is linked with
/lib/obsolete/libc.so.6, which does not contain the TLS features. I
can only assume that this occurs because the TLS features require
support from the kernel that is only present in the 2.6 series.
A BETTER WAY TO USE THE “TRICK”
The problem with setting the environment variable LD_ASSUME_KERNEL
system wide is that all applications will use the older libc, when
the newer libc should probably be used whenever possible. To get
around this, open up matlab startup script (found in $MATLAB/bin).
For example, my matlab installation is under /usr/local/matlab, so I
open /usr/local/matlab/bin/matlab in a text editor. Scroll down
until you find the line that reads:
ARCH_LIST=’sol2 hpux glnx86 glnxi64 glnxa64 mac’
Add below this line the following:
LD_ASSUME_KERNEL=2.4.19
This will set the variable only for the execution of matlab and not
for any other applications on the system.
———————————————————————-
In my case in spite of doing all the aboue suggested results, I get a new error now
expr: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/bin/uname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
Sorry! We could not determine the machine architecture for your
host. Please contact:
MathWorks Technical Support
for further assistance.
trap: usage: trap [-lp] [arg signal_spec …]
Still trying to find a soln to get out of this error.
From : http://nvrvarma.blogspot.com/2005/09/matlab-glibc-problem-on-amd-64.html