I have Ubuntu20.04 and Matlab 2023b installed.
When I start simulink(part of Matlab) the program crashes with:
Inconsistency detected by ld.so: ../elf/dl-tls.c: 517: _dl_allocate_tls_init: Assertion 'listp != NULL' failed!
,
which is [well known issue](https://www.mathworks.com/matlabcentral/answers/1454674-why-does-matlab-crash-on-linux-with-inconsistency-detected-by-ld-so-elf-dl-tls-c-597-_dl_allo) with newer Matlab versions with linux OS that goes with glibc older than version 2.34.
[Official bug fix proposed by MathWorks](https://github.com/mathworks/build-glibc-bz-19329-patch) is to patch your glibc for your whole OS, which is not desirable in my case.
[I saw one solution](https://www.mathworks.com/matlabcentral/answers/1567188-simulink-crash-in-ubuntu-20-04) that would be suitable for me, which is installing glibc2.34 locally and then adding its path to LD_LIBRARAY_PATH
variable, only while running Matlab, which would result in only Matlab using the other version of glibc.
I have followed [this steps](https://askubuntu.com/questions/1345342/how-to-install-glibc-2-32-when-i-already-have-glibc2-31) to install glibc2.34 locally. I verified that it works with command:
user@hostname[~]: ~/glibc/glibc-2.34-install/bin/ldd --version
ldd (GNU libc) 2.34
Copyright (C) 2021 Free Software Foundation, Inc.
To oprogramowanie jest darmowe; warunki kopiowania są opisane w źródłach.
Autorzy nie dają ŻADNYCH gwarancji, w tym również gwarancji MOŻLIWOŚCI
SPRZEDAŻY lub PRZYDATNOŚCI DO KONKRETNYCH ZASTOSOWAŃ.
Autorami są Roland McGrath i Ulrich Drepper.
But after adding glibc/lib into LD_LIBRARAY_PATH
, I got segfault error on simple binaries like ls
:
user@hostname[~/glibc]❯ export LD_LIBRARY_PATH="/home/dsadowsk/glibc/glibc-2.34-install/lib:$LD_LIBRARY_PATH"
user@hostname[~/glibc]❯ ls
Segmentation fault
user@hostname[~/glibc]❯ /opt/matlab/R2023b/bin/matlab
Segmentation fault
It looks exactly like [this issue](https://unix.stackexchange.com/questions/272606/locally-installing-glibc-2-23-causes-all-programs-to-segfault) , but unfortunately I don't understand very well, how the solution works, and it doesn't work for the matlab here, as for ls
command.
user@hostname[~/glibc]❯ /lib64/ld-linux-x86-64.so.2 --library-path /lib64 /bin/ls
build glibc-2.34 glibc-2.34-install glibc-2.34.tar.gz
user@hostname[~/glibc]❯ /lib64/ld-linux-x86-64.so.2 --library-path /lib64 /opt/matlab/R2023b/bin/matlab
/opt/matlab/R2023b/bin/matlab: error while loading shared libraries: /opt/matlab/R2023b/bin/matlab: invalid ELF header
How can I be able to run matlab binary with glibc2.34 installed locally and not for my whole system?
Thank you for any thoughts you have.
Asked by DarKreter
(11 rep)
Oct 16, 2024, 08:33 PM
Last activity: Oct 17, 2024, 08:05 AM
Last activity: Oct 17, 2024, 08:05 AM