MATLAB: Segmentation violation detected on startup

crashfatalMATLABr2016asegmentationUbuntu

Hi I'm new to Matlab and trying to install on Ubuntu 16.04. After installing matlab, it keeps crashing on startup. Please find the crash report. II have tried installing matlab-support as well.
Configuration:
Crash Decoding : Disabled
Crash Mode : continue (default)
Current Graphics Driver: Unknown hardware
Current Visual : 0x6d (class 4, depth 24)
Default Encoding : UTF-8
GNU C Library : 2.23 stable
Host Name : rnavagamuwa-XPS-15-9550
MATLAB Architecture : glnxa64
MATLAB Root : /opt/matlab/R2016a
MATLAB Version : 9.0.0.341360 (R2016a)
OpenGL : hardware
Operating System : Linux 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64
Processor ID : x86 Family 6 Model 94 Stepping 3, GenuineIntel
Virtual Machine : Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
Window System : The X.Org Foundation (11803000), display :0
Fault Count: 1
Abnormal termination:
Segmentation violation
Register State (from fault):
RAX = 00007fa8691d8e40 RBX = 0000000000000000
RCX = 0000000000000001 RDX = 00000000000000a8
RSP = 00007fa8691d8e10 RBP = 00007fa85c08d7f0
RSI = 00007fa8691d8ee8 RDI = 00007fa8691d8e40
R8 = 0000000000000000 R9 = 0000000000000001
R10 = 00007fa85c565b20 R11 = 0000000000000000
R12 = 00007fa85c366c20 R13 = 00007fa85c08d7f0
R14 = 00007fa85c426250 R15 = 00007fa85c3628d0
RIP = 00007fa82b45824d EFL = 0000000000010206
CS = 0033 FS = 0000 GS = 0000
Stack Trace (from fault):
[ 0] 0x00007fa82b45824d /usr/lib/nvidia-361/libGLX_nvidia.so.0+00344653
If this problem is reproducible, please submit a Service Request via:
http://www.mathworks.com/support/contact_us/
A technical support engineer might contact you with further information.
Thank you for your help.** This crash report has been saved to disk as /home/rnavagamuwa/matlab_crash_dump.4715-1 **
MATLAB is exiting because of fatal error

Best Answer

I found a temporary solution for this bug. Add -softwareopengl flag and run. A bug in the nvidia driver is causing this issue. https://devtalk.nvidia.com/default/topic/926199/linux/361-28-crashes-matlab-r2016a/