You are not logged in.

#1 2026-05-19 06:50:57

BenediktHufnagl
Member
Registered: 2025-07-16
Posts: 6

MATLAB segmentation fault after upgrading libstdc++

MATLAB R2026a (and also MATLAB R2025b) crashes with a segmentation fault after pacman update:

--------------------------------------------------------------------------------
          Segmentation violation detected at 2026-05-19 08:18:24 +0200
--------------------------------------------------------------------------------

Configuration:
  Crash Decoding           : Disabled - No sandbox or build area path
  Crash Mode               : continue (default)
  Default Encoding         : UTF-8
  GNU C Library            : 2.43 stable
  MATLAB Architecture      : glnxa64
  MATLAB Root              : /home/benedikt/.MatlabR2026a
  MATLAB Version           : 26.1.0.3203278 (R2026a)
  Operating System         : Linux 7.0.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Sun, 17 May 2026 17:23:07 +0000 x86_64
  Process ID               : 19565
  Processor ID             : x86 Family 6 Model 140 Stepping 1, GenuineIntel

Fault Count: 1


Abnormal termination:
Segmentation violation

Current Thread: 'MCR Main thread' id 139822995863232

Register State (from fault):
  RAX = 00007f2b13ffdf10  RBX = 0000000000000000
  RCX = 00007f2cfaf3c3c8  RDX = 00007f2b13ffe730
  RSP = 00007f2b13ffdea0  RBP = 00007f2b13ffdf70
  RSI = 00007f2b13ffe2a0  RDI = 0000000000000000

   R8 = 00007f2b08000910   R9 = 00000000000000a0
  R10 = 00000000000000a5  R11 = 0000000000000010
  R12 = 00007f2b13ffe2a0  R13 = 00007f2b13ffe730
  R14 = 0000000000000000  R15 = 00007f2b13ffdf10

  RIP = 00007f2b5c05c5f3  EFL = 0000000000010202

   CS = 0033   FS = 0000   GS = 0000

Stack Trace (from fault):
[  0] 0x00007f2b5c05c5f3 /home/benedikt/.MatlabR2026a/bin/glnxa64/matlab_startup_plugins/jmi/mwJavaClasspathCache.so+00148979
[  1] 0x00007f2b5c05e6a7 /home/benedikt/.MatlabR2026a/bin/glnxa64/matlab_startup_plugins/jmi/mwJavaClasspathCache.so+00157351
[  2] 0x00007f2b5c066748 /home/benedikt/.MatlabR2026a/bin/glnxa64/matlab_startup_plugins/jmi/mwJavaClasspathCache.so+00190280 _ZNSt17_Function_handlerIFSt10unique_ptrINSt13__future_base12_Result_baseENS2_8_DeleterEEvENS1_12_Task_setterIS0_INS1_7_ResultISt13unordered_setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4hashISE_ESt8equal_toISE_ESaISE_EEEES3_ENSt6thread8_InvokerISt5tupleIJPFSK_vEEEEESK_EEE9_M_invokeERKSt9_Any_data+00000040
[  3] 0x00007f2b95f7770f /home/benedikt/.MatlabR2026a/bin/glnxa64/libmwmatlab_main_lib.so+00169743 _ZNSt13__future_base13_State_baseV29_M_do_setEPSt8functionIFSt10unique_ptrINS_12_Result_baseENS3_8_DeleterEEvEEPb+00000031
[  4] 0x00007f2b9589d8fc                                 /usr/lib/libc.so.6+00645372
[  5] 0x00007f2b9589d979                                 /usr/lib/libc.so.6+00645497 pthread_once+00000025
[  6] 0x00007f2b5c064e5d /home/benedikt/.MatlabR2026a/bin/glnxa64/matlab_startup_plugins/jmi/mwJavaClasspathCache.so+00183901 _ZNSt13__future_base17_Async_state_implINSt6thread8_InvokerISt5tupleIJPFSt13unordered_setINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4hashISA_ESt8equal_toISA_ESaISA_EEvEEEEESG_E6_M_runEv+00000253
[  7] 0x00007f2b95ceb919                              /usr/lib/libstdc++.so+00964889
[  8] 0x00007f2b958981b9                                 /usr/lib/libc.so.6+00623033
[  9] 0x00007f2b9591d21c                                 /usr/lib/libc.so.6+01167900

I have been using the following command to start MATLAB (including previous versions) up until the recent Arch update via pacman.

export LD_PRELOAD=/usr/lib/libstdc++.so:/usr/lib/libfreetype.so:; export LD_LIBRARY_PATH=/usr/lib/dri/:/home/benedikt/.Matlab_gnutls/usr/lib/:; export QT_QPA_PLATFORM=xcb; ./matlab

Looking at the pacman logs I see

[2026-05-18T08:49:53+0200] [ALPM] upgraded libstdc++ (15.2.1+r604+g0b99615a8aef-1 -> 16.1.1+r12+g301eb08fa2c5-1)

I also tried to manually install the previous version of libstdc++ and force matlab to use it with LD_LIBRARY_PATH, however, that didn't work.

I managed to get everything working again by downgrading Arch Linux as described in Arch Linux Archive to a the state of the 30th of April 2026.

Do you know what went wrong here?

Offline

#2 2026-05-19 07:31:39

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,499
Website

Re: MATLAB segmentation fault after upgrading libstdc++

Mod note: moving to AUR Issues


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2026-05-19 14:23:02

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,518

Re: MATLAB segmentation fault after upgrading libstdc++

Did you try to not preload /usr/lib/libstdc++.so or in doubt preload the 15.2.1 version?
(You can extract if from the package in the ALA or your package cache and put it into /home/benedikt/.Matlab_gnutls/usr/lib/)

Offline

#4 2026-05-22 15:28:29

BenediktHufnagl
Member
Registered: 2025-07-16
Posts: 6

Re: MATLAB segmentation fault after upgrading libstdc++

Yes, I did exactly that. I accessed the older  15.2.1 version, unzipped it to a folder and used LD_LIBRARY_PATH to assign it. The problem didn't change.

Offline

#5 2026-05-22 15:31:06

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,518

Re: MATLAB segmentation fault after upgrading libstdc++

Please don't paraphrase, https://bbs.archlinux.org/viewtopic.php?id=57855
Your OP shows you explicitly preloading /usr/lib/libstdc++, doing anything w/ the LD_LIBRARY_PATH will then not prevent the system stdc++ (16.x) from being used.

Offline

Board footer

Powered by FluxBB