MATLAB: Does MATLAB suddenly hang on Red Hat Enterprise​/CentOS/Sc​ientific Linux 6.7

MATLAB

MATLAB sometimes suddenly hangs on relatively simple operations like small matrix multiplications. It does look like this happens under high IO load (from other processes) however. When MATLAB hangs the whole GUI is unresponsive, CPU usage is close to 0 and the only way to close MATLAB is by killing the process.
If I try to debug the process it looks like MATLAB is deadlocked in a call to _int_free in glibc:
(gdb) backtrace
#0 0x0000003600af80ce in __lll_lock_wait_private () from /lib64/libc.so.6
#1 0x0000003600a7cf7e in _L_lock_5746 () from /lib64/libc.so.6
#2 0x0000003600a78a8b in _int_free () from /lib64/libc.so.6
#3 0x00007ffff7672608 in ?? () from /usr/local/MATLAB/R2014a/bin/glnxa64/libmx.so
#4 0x00007ffff7674d55 in ?? () from /usr/local/MATLAB/R2014a/bin/glnxa64/libmx.so
#5 0x00007ffff7674ee2 in ?? () from /usr/local/MATLAB/R2014a/bin/glnxa64/libmx.so
#6 0x00007ffff767510f in ?? () from /usr/local/MATLAB/R2014a/bin/glnxa64/libmx.so

Best Answer

There is a bug in glibc-2.12-1.166 shipped with Red Hat Enterprise 6.7 which causes a deadlock in malloc/free (https://bugzilla.redhat.com/show_bug.cgi?id=1244002) which can cause deadlocks in MATLAB.
This bug is fixed in glibc-2.12-1.166.el6_7.1 which is available in the "fastbug updates" repositories.
To enable this repository go to "System" -> "Administration" -> "Add/Remove Software" and then "System" -> "Software Sources" where you can enable the "fastbug updates" repositories. After this use  "System" -> "Administration" -> "Software Update" to install the updated glibc version. Consult your Linux system administrator or the operating system's documentation if you want to install this particular update without using the "fastbug updates" repositories.