MATLAB: Does MATLAB crash on Linux with Static TLS mitigation disabled if libX11.so is not found

libx11.so.6MATLAB

MATLAB crashes on my Linux machine with the following line in the Configuration section of the crash log:
Static TLS mitigation : Disabled: Cannot load X11
How can I resolve this issue?

Best Answer

The Static TLS mitigation warning is related to the fact that the 'libX11.so' library may not be linked to the 'libX11.so.6' library on some Linux installations. This would not be the cause of a crash but it may cause other issues and can be resolved as described below. Use the contents of the stack trace found in the crash log to diagnose the root cause of the crash.
To resolve the Static TLS mitigation issue, start MATLAB with software OpenGL by using the following command from your terminal:
$ matlab -softwareopengl
For more information about the use of startup flags or the limitations associated with using software OpenGL, refer to the following links:
If hardware OpenGL is required, you can resolve the issue by telling MATLAB where to find the libX11.so.6 library.
1. Navigate to MATLAB's <matlabroot>/bin/<arch> directory. For example:
cd /usr/local/MATLAB/R2018a/bin/glnxa64
2. Create a symlink from libX11.so in this directory to the actual location of the libX11.so.6 library. For example:
ln -s /usr/lib/x86_64-linux-gnu/libX11.so.6 libX11.so
The actual location of this library may be different, depending on your distribution.
3. Start MATLAB without -softwareopengl.