You are not logged in.

#1 2017-10-27 18:53:55

MrcJkb
Member
Registered: 2017-10-12
Posts: 20

[Solved] Matlab GUI crashes with "Segmentation violation detected"

Hi. I installed Matlab R2017b (downloaded from the MathWorks website) and it worked fine for a while.
But now, whenever I try to start it, the program crashes with a "Segmentation violation detected" message.

I looked into the Arch Wiki and there is a section on that error message, but it seems to be outdated - it recommends to install ncurses5 (but newer versions of Matlab should be compatible with ncurses6). I gave ncurses5 a try and that didn't fix the problem.
Reinstalling Matlab hasn't fixed anything either (this time I was only able to install in silent mode with root privileges).

I have performed the following troubleshooting (all to no avail)

- switched between nouveau and nvidia graphics drivers
- tried both software and hardware opengl (Matlab often switches back to Software opengl)
- tried openjdk-8 and openjdk-9
- disabled/re-enabled Java 2D opengl rendering
- replaced the libstdc++.so.6 link with a symbolic link to /usr/lib/libstdc++.so.6 (a bug that has apparently been fixed since Matlab R2016b)


Starting Matlab in '-nodesktop' mode works fine, so it must be a graphics issue.
However, I am able to plot figures in nodesktop mode, so it deosn't seem like there's a problem with the JVM.

Before changing the libstdc++-so.6 symbolic link, calling 'opengl info' in Matlab returned the following:

 
                          Version: '2.1 Mesa 10.5.2'
                           Vendor: 'Brian Paul'
                         Renderer: 'Mesa X11'
                   MaxTextureSize: 16384
                           Visual: 'Visual 0x55, (RGBA 32 bits (8 8 8 8), Z depth 16 bits, Hardware acceleration, Double buffer, Antialias 0 samples)'
                         Software: 'true'
             HardwareSupportLevel: 'none (known graphics driver issues)'
        SupportsGraphicsSmoothing: 0
    SupportsDepthPeelTransparency: 1
       SupportsAlignVertexCenters: 0
                       Extensions: {156x1 cell}
               MaxFrameBufferSize: 16384

After unlinking and linking to /usr/lib/libstdc++.so.6, 'opengl info' returns:

Version: '3.0 Mesa 17.2.3'
                           Vendor: 'Intel Open Source Technology Center'
                         Renderer: 'Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2) '
                   MaxTextureSize: 16384
                           Visual: 'Visual 0x1b2, (RGBA 32 bits (8 8 8 8), Z depth 16 bits, Hardware acceleration, Double buffer, Antialias 8 samples)'
                         Software: 'false'
             HardwareSupportLevel: 'full'
        SupportsGraphicsSmoothing: 1
    SupportsDepthPeelTransparency: 1
       SupportsAlignVertexCenters: 1
                       Extensions: {240x1 cell}
               MaxFrameBufferSize: 16384

However, Matlab still crashes.
With the re-linked libstdc++.so.6, starting Matlab with 'LIBGL_DEBUG=verbose matlab' returns the following output:

libGL: Can't open configuration file /home/mrcjk/.drirc: No such file or directory.
libGL: pci id for fd 16: 8086:1916, driver i965
libGL: OpenDriver: trying /usr/lib/xorg/modules/dri/tls/i965_dri.so
libGL: OpenDriver: trying /usr/lib/xorg/modules/dri/i965_dri.so
libGL: Can't open configuration file /home/mrcjk/.drirc: No such file or directory.
libGL: Using DRI3 for screen 0

So I seem to be getting closer to the cause of the issue, but I'm not sure how to carry on from here. I will contact MathWorks support, but since Arch is not officially supported, I doubt they will help.

Last edited by MrcJkb (2017-11-01 18:55:41)

Offline

#2 2017-11-01 18:55:25

MrcJkb
Member
Registered: 2017-10-12
Posts: 20

Re: [Solved] Matlab GUI crashes with "Segmentation violation detected"

I got a reply from MathWorks support. The problem is because Matlab fails to load the font display $MATLAB/bin/glnxa64/libfreetype.so.6

The problem was be solved by creating an 'exclude' folder in $MATLAB/bin/glnxa64/ and moving libfreetype.so.6 to that folder.

In my case, I performed the following:

$ cd  /usr/local/MATLAB/R2017b # Matlab directory
$ cd bin/glnxa64
$ mkdir exclude
$ mv libfreetype* exclude
$ cd ../../sys/os/glnxa64
$ mkdir exclude
$ mv libstdc++.so.6* exclude
$ cd

Offline

Board footer

Powered by FluxBB