MATLAB: xcb_xlib.c:50: xcb_xlib_unlock: Assertion `c->xlib.lock' failed.Either of the two workarounds works for me:
(1) If the libxcb version is ≥1.1, export LIBXCB_ALLOW_SLOPPY_LOCK=1 before running the broken application.
(2) Recompile libxcb with CFLAGS="-DNDEBUG". This macro disables assertions.
Workaround 2 uses some kind of brutal force, and in most cases Workaround 1 should be preferred.
[ Another workaround is found here. I think it works though I didn’t try it. However this uses even more brutal force. ]
 Gentoo Forum thread: xorg-server-1.3.0 + xcb breaks java ?
 LFS documentation on libxcb