[Mesa-users] How to debug Matlab crash?

Ruslan Kabatsayev b7.10110111 at gmail.com
Mon Jun 22 11:32:17 UTC 2020


Hi,

First I'd like to point out that the title of your message (and thus
this thread) could benefit from a change. It looks very much off topic
at first glance. I only opened it due to curiosity, like "why would
Mesa ML be appropriate to discuss MATLAB crashes?".
Also, I'm not a Mesa developer, but I'll try to help you proceed.

Your stack traces are mostly useless to the readers because they
contain only addresses, offsets and register values (all of these are
specific to your machine and your binaries), with a bit of symbols.
It'd be better to compile Mesa in debug mode, so that you got debug
symbols and could see at which source line in which file the fault
occurs, what values the variables have etc.. See
https://docs.mesa3d.org/debugging.html for some hints. Be sure to
disable compiler optimizations, or your debugging experience may
suffer.

Regards,
Ruslan

On Wed, 17 Jun 2020 at 14:05, Johannes Töger <johannes.toger at med.lu.se> wrote:
>
> Hi mesa-users,
>
>
>
> I am interested in Mesa llvmpipe to do software OpenGL for Matlab R2019b on Ubuntu 18.04 LTS.
>
>
>
> The reason for this is that I’m running Matlab on a compute server over x2go (remote desktop solution), and since there is no hardware acceleration available Matlab falls back to “Software OpenGL”. This mode is actually an older Mesa software rendering driver (version 17.1.3), which is horribly slow when using transparency. Not sure which software rendering module is being used.
>
>
>
> To increase performance, I compiled a recent Mesa (20.1.0) with llvmpipe as follows:
>
>
>
> meson -D glx=gallium-xlib -D gallium-drivers=swrast -D platforms=x11 -D dri3=false -D dri-drivers="" -D vulkan-drivers="" -D buildtype=release -D optimization=3 -Dprefix=/usr/local/mesa-20.1.0/
>
> ninja
>
> sudo ninja install
>
>
>
> Then I patched the Matlab environment variables so that it loads my new Mesa llvmpipe library instead. I had to set MESA_GL_VERSION_OVERRIDE=3.1COMPAT to make it work though.
>
>
>
> I can then run some simple graphics demos, but I eventually get crashes, with some traces attached below. The one with glXMakeContextCurrent is the most common.
>
>
>
> At this point I’m stuck as I don’t know very much about OpenGL and Mesa. I tried to compile a debug build to see if that would give more info in the stack trace, but no luck.
>
>
>
> Does anyone have an idea how to further debug this, or if there is another solution to this problem?
>
>
>
>
>
>
>
> Stack trace:
>
>
>
> MATLAB crash file:/home/johannes/matlab_crash_dump.13444-1:
>
>
>
>
>
> --------------------------------------------------------------------------------
>
>        Segmentation violation detected at Wed Jun 17 12:48:51 2020 +0200
>
> --------------------------------------------------------------------------------
>
>
>
> Configuration:
>
>   Crash Decoding           : Disabled - No sandbox or build area path
>
>   Crash Mode               : continue (default)
>
>   Default Encoding         : UTF-8
>
>   Deployed                 : false
>
>   Desktop Environment      : MATE
>
>   GNU C Library            : 2.27 stable
>
>   Graphics Driver          : VMware, Inc. llvmpipe (LLVM 6.0.0, 256 bits) Version 3.1 Mesa 20.1.0
>
>   Graphics card 1          : 0x10de ( 0x10de ) 0x1e02 Version 440.64.0.0 (0-0-0)
>
>   Graphics card 2          : 0x10de ( 0x10de ) 0x1e02 Version 440.64.0.0 (0-0-0)
>
>   Graphics card 3          : 0x1a03 ( 0x1a03 ) 0x2000 Version 0.0.0.0 (0-0-0)
>
>   Java Version             : Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
>
>   MATLAB Architecture      : glnxa64
>
>   MATLAB Entitlement ID    : 1263601
>
>   MATLAB Root              : /usr/local/MATLAB/R2019b
>
>   MATLAB Version           : 9.7.0.1319299 (R2019b) Update 5
>
>   OpenGL                   : software
>
>   Operating System         : Ubuntu 18.04.4 LTS
>
>   Process ID               : 13444
>
>   Processor ID             : x86 Family 6 Model 85 Stepping 4, GenuineIntel
>
>   Session Key              : d95211cf-cbc9-4a1e-b444-5551f1f03466
>
>   Static TLS mitigation    : Enabled: Full
>
>   Window System            : The X.Org Foundation (70000000), display :53
>
>
>
> Fault Count: 1
>
>
>
>
>
> Abnormal termination:
>
> Segmentation violation
>
>
>
> Register State (from fault):
>
>   RAX = 0000000000000000  RBX = fffffffffffffff8
>
>   RCX = 0000000000000000  RDX = 0000000000000000
>
>   RSP = 00007fc54c388030  RBP = 00007fc481202af0
>
>   RSI = 0000000000000000  RDI = 0000000000000001
>
>
>
>    R8 = 00007fc6f3b3ee40   R9 = 0000000000000000
>
>   R10 = 00007fc5210198a2  R11 = 00007fc6d39d6c30
>
>   R12 = 00007fc480288780  R13 = 0000000000000000
>
>   R14 = 00007fc4816781d0  R15 = 00007fc499c55800
>
>
>
>   RIP = 00007fc6f2af1200  EFL = 0000000000010282
>
>
>
>    CS = 0033   FS = 0000   GS = 0000
>
>
>
> Stack Trace (from fault):
>
> [  0] 0x00007fc6f2af1200 /usr/local/mesa-20.1.0/lib/x86_64-linux-gnu/libGL.so.1+00946688
>
> [  1] 0x00007fc6f2af12ed /usr/local/mesa-20.1.0/lib/x86_64-linux-gnu/libGL.so.1+00946925
>
> [  2] 0x00007fc6f2af45fa /usr/local/mesa-20.1.0/lib/x86_64-linux-gnu/libGL.so.1+00959994 glXMakeContextCurrent+00000330
>
> [  3] 0x00007fc463de4553 /usr/local/MATLAB/R2019b/bin/glnxa64/libjogl_desktop.so+00623955 Java_jogamp_opengl_x11_glx_GLX_dispatch_1glXMakeContextCurrent0__JJJJJ+00000062
>
> [  4] 0x00007fc5210198ce                                   <unknown-module>+00000000
>
> [  5] 0x00007fc521007ab0                                   <unknown-module>+00000000
>
> [  6] 0x00007fc521007ab0                                   <unknown-module>+00000000
>
> [  7] 0x00007fc521007ab0                                   <unknown-module>+00000000
>
> [  8] 0x00007fc5210082dd                                   <unknown-module>+00000000
>
> [  9] 0x00007fc5210082dd                                   <unknown-module>+00000000
>
> [ 10] 0x00007fc5210082dd                                   <unknown-module>+00000000
>
> [ 11] 0x00007fc5210082dd                                   <unknown-module>+00000000
>
> [ 12] 0x00007fc5210082dd                                   <unknown-module>+00000000
>
> [ 13] 0x00007fc521008322                                   <unknown-module>+00000000
>
> [ 14] 0x00007fc5210082dd                                   <unknown-module>+00000000
>
> [ 15] 0x00007fc523d14c80                                   <unknown-module>+00000000
>
>
>
>
>
>
>
>
>
> MATLAB crash file:/home/johannes/matlab_crash_dump.69832-1:
>
>
>
>
>
> --------------------------------------------------------------------------------
>
>        Segmentation violation detected at Wed Jun 17 12:46:35 2020 +0200
>
> --------------------------------------------------------------------------------
>
>
>
> Configuration:
>
>   Crash Decoding           : Disabled - No sandbox or build area path
>
>   Crash Mode               : continue (default)
>
>   Default Encoding         : UTF-8
>
>   Deployed                 : false
>
>   Desktop Environment      : MATE
>
>   GNU C Library            : 2.27 stable
>
>   Graphics Driver          : VMware, Inc. llvmpipe (LLVM 6.0.0, 256 bits) Version 3.1 Mesa 20.1.0
>
>   Graphics card 1          : 0x10de ( 0x10de ) 0x1e02 Version 440.64.0.0 (0-0-0)
>
>   Graphics card 2          : 0x10de ( 0x10de ) 0x1e02 Version 440.64.0.0 (0-0-0)
>
>   Graphics card 3          : 0x1a03 ( 0x1a03 ) 0x2000 Version 0.0.0.0 (0-0-0)
>
>   Java Version             : Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
>
>   MATLAB Architecture      : glnxa64
>
>   MATLAB Entitlement ID    : 1263601
>
>   MATLAB Root              : /usr/local/MATLAB/R2019b
>
>   MATLAB Version           : 9.7.0.1319299 (R2019b) Update 5
>
>   OpenGL                   : software
>
>   Operating System         : Ubuntu 18.04.4 LTS
>
>   Process ID               : 69832
>
>   Processor ID             : x86 Family 6 Model 85 Stepping 4, GenuineIntel
>
>   Session Key              : a9e597c5-518c-4ff2-90af-006933452fd8
>
>   Static TLS mitigation    : Enabled: Full
>
>   Window System            : The X.Org Foundation (70000000), display :53
>
>
>
> Fault Count: 1
>
>
>
>
>
> Abnormal termination:
>
> Segmentation violation
>
>
>
> Register State (from fault):
>
>   RAX = ec834853e5894855  RBX = 00007fe1f6d9e630
>
>   RCX = 0000000000000000  RDX = 0000000000000000
>
>   RSP = 00007fe2984e71f0  RBP = 00007fe1f51acbe0
>
>   RSI = 0000000000000000  RDI = 0000000000000001
>
>
>
>    R8 = 00007fe46ea4fe40   R9 = 00007fe47f26cc40
>
>   R10 = 0000000000000007  R11 = 0000000000000007
>
>   R12 = 0000000000000000  R13 = 00007fe1f57c8cb0
>
>  R14 = 00007fe1f4536950  R15 = 0000000000008010
>
>
>
>   RIP = 00007fe46da01020  EFL = 0000000000010286
>
>
>
>    CS = 0033   FS = 0000   GS = 0000
>
>
>
> Stack Trace (from fault):
>
> [  0] 0x00007fe46da01020 /usr/local/mesa-20.1.0/lib/x86_64-linux-gnu/libGL.so.1+00942112
>
> [  1] 0x00007fe46da066d8 /usr/local/mesa-20.1.0/lib/x86_64-linux-gnu/libGL.so.1+00964312 glXChooseFBConfig+00000232
>
> [  2] 0x00007fdf4d15d5f7 /usr/local/MATLAB/R2019b/bin/glnxa64/libjogl_desktop.so+00620023 Java_jogamp_opengl_x11_glx_GLX_dispatch_1glXChooseFBConfig+00000177
>
> [  3] 0x00007fe2a90198ce                                   <unknown-module>+00000000
>
> [  4] 0x00007fe2a9008060                                   <unknown-module>+00000000
>
> [  5] 0x00007fe2a9008060                                   <unknown-module>+00000000
>
> [  6] 0x00007fe2a9008060                                   <unknown-module>+00000000
>
> [  7] 0x00007fe2a9008060                                   <unknown-module>+00000000
>
> [  8] 0x00007fe2a9008060                                   <unknown-module>+00000000
>
> [  9] 0x00007fe2a9008060                                   <unknown-module>+00000000
>
> [ 10] 0x00007fe2a9008060                                   <unknown-module>+00000000
>
> [ 11] 0x00007fe2a9008322                                   <unknown-module>+00000000
>
> [ 12] 0x00007fe2a9007ab0                                   <unknown-module>+00000000
>
> [ 13] 0x00007fe2a90082dd                                   <unknown-module>+00000000
>
> [ 14] 0x00007fe2ac4e2c5c                                   <unknown-module>+00000000
>
>
>
>
>
> --
>
> Johannes Töger
>
>
>
> Associate Senior Lecturer
>
> Cardiac MR Group
>
> Department of Clinical Sciences Lund, Clinical Physiology
>
> Lund University, Sweden
>
>
>
>
>
>
>
> _______________________________________________
> mesa-users mailing list
> mesa-users at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-users


More information about the mesa-users mailing list