Matlab Crash on Sonoma(macOS 14.0)
Mostrar comentarios más antiguos
Matlab2023b works fine on my computer with macOS 13.6. I find that the matlab 2023b is supported on Sonoma, so I update the system to it. However, after the update matlab crashs each time I launch it. And I find similar report on stack overflow.
The crash report:
--------------------------------------------------------------------------------
Segmentation violation detected at 2023-10-02 08:03:40 +0800
--------------------------------------------------------------------------------
Configuration:
Crash Decoding : Disabled - No sandbox or build area path
Crash Mode : continue (default)
Default Encoding : UTF-8
Deployed : false
Graphics Driver : Uninitialized hardware
Java Version : Java 1.8.0_382-b05 with Amazon.com Inc. OpenJDK 64-Bit Server VM mixed mode
MATLAB Architecture : maca64
MATLAB Entitlement ID : [FILTERED]
MATLAB Root : /Applications/MATLAB_R2023b.app
MATLAB Version : 23.2.0.2365128 (R2023b)
OpenGL : hardware
Operating System : Mac OS 版本14.0(版号23A344)
Process ID : 5522
Processor ID : ABI64 ARM ARM64E FIRESTORM_ICESTORM HG
Session Key : [FILTERED]
Window System : Quartz
Fault Count: 1
Abnormal termination:
Segmentation violation
Current Thread: '' id 0x294e2b000
Register State (from fault):
X0 = 0000000000000012 X1 = 0000000000000000
X2 = 0000000000000001 X3 = 0000000000000000
X4 = 00000001d9ae8630 X5 = 0000000000000000
X6 = 0000000000000000 X7 = 0000000000000403
X8 = 1194967f20a30012 X9 = 0000000000000000
X10 = 0000000000000001 X11 = 0000000000000000
X12 = 0000000010800000 X13 = 0000000000000001
X14 = 0000000000000000 X15 = 0000000084004000
X16 = 0000000182884e00 X17 = 0000000237fd36d0
X18 = 0000000000000000 X19 = 0000000236d00a60
X20 = 0000000000000000 X21 = 0000000000000000
X22 = 0000000294e2a670 X23 = 000000000000001a
X24 = 0000000000000000 X25 = 0000000000000000
X26 = 0000000294e290e0 X27 = 0000000000000000
X28 = 0000600065e36520
FP = 0000000294e27ae0 LR = 5154800182884e38
SP = 0000000294e27ae0 PC = 00000001829cd6f0
CPSR = 60001000
Stack Trace (from fault):
[ 0] 0x0000000104904d90 /Applications/MATLAB_R2023b.app/bin/maca64/libmwfl.dylib+00019856 _ZN10foundation4core4diag15stacktrace_base7captureERKNS1_14thread_contextEm+00000064
[ 1] 0x0000000104907c58 /Applications/MATLAB_R2023b.app/bin/maca64/libmwfl.dylib+00031832 _ZN10foundation4core4test17terminate_handledERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE+00002144
[ 2] 0x0000000104907118 /Applications/MATLAB_R2023b.app/bin/maca64/libmwfl.dylib+00028952 _ZN10foundation4core4diag13terminate_logEPKcPK17__darwin_ucontext+00000140
[ 3] 0x000000010b0653b0 /Applications/MATLAB_R2023b.app/bin/maca64/libmwmcr.dylib+00529328 _Z19mnPrintErrorMessageRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE+00011892
[ 4] 0x000000010b063250 /Applications/MATLAB_R2023b.app/bin/maca64/libmwmcr.dylib+00520784 _Z19mnPrintErrorMessageRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE+00003348
[ 5] 0x000000010b060cf0 /Applications/MATLAB_R2023b.app/bin/maca64/libmwmcr.dylib+00511216 mnFatalSignalHandler+00000140
[ 6] 0x000000018284da24 /usr/lib/system/libsystem_platform.dylib+00014884 _sigtramp+00000056
[ 7] 0x0000000182884e38 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation+00028216 CFDictionaryGetValue+00000056
[ 8] 0x0000000182884e38 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation+00028216 CFDictionaryGetValue+00000056
[ 9] 0x0000000204c93578 /System/Library/PrivateFrameworks/IO80211.framework/Versions/A/IO80211+00017784 Apple80211Scan+00000584
[ 10] 0x00000001361d5994 /Applications/MATLAB_R2023b.app/bin/maca64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+01923476 FqTtUQGnylG+00000356
[ 11] 0x00000001361d5da4 /Applications/MATLAB_R2023b.app/bin/maca64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+01924516 AjEdeqBE+00000564
[ 12] 0x00000001361e4e00 /Applications/MATLAB_R2023b.app/bin/maca64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+01986048 GxnmPknfylG+00000176
[ 13] 0x00000001361e42cc /Applications/MATLAB_R2023b.app/bin/maca64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+01983180 OexMpdMAylG+00000332
[ 14] 0x00000001361e4628 /Applications/MATLAB_R2023b.app/bin/maca64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+01984040 tQpdOundylG+00000052
[ 15] 0x000000018281f034 /usr/lib/system/libsystem_pthread.dylib+00028724 _pthread_start+00000136
[ 16] 0x0000000182819e3c /usr/lib/system/libsystem_pthread.dylib+00007740 thread_start+00000008
PS: when I run matlab on terminal, there are two warnings as:
CodeCache is full. Compiler has been disabled.
Try increasing the code cache size using -XX:ReservedCodeCacheSize=
objc[16042]: Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x2325b2888) and /Applications/MATLAB_R2023b.app/bin/maca64/Frameworks/Chromium Embedded Framework.framework/Libraries/libGLESv2.dylib (0x10bc41e70).
One of the two will be used. Which one is undefined.
56 comentarios
Jianrong Jia
el 2 de Oct. de 2023
Movida: the cyclist
el 5 de Oct. de 2023
I have the same issue on Mac mini 2023.
the cyclist
el 2 de Oct. de 2023
Editada: the cyclist
el 24 de En. de 2024
I have no problem running R2023b after upgrade to Sonoma, on Macbook Pro with M1 Silicon.
Update: MATLAB is not crashing soon after startup, but it definitely crashes more often now. As a few answers/comments have mentioned, closing figures (via the X in the figure window) does seem to be a catalyst. Closing figures using the close command does not cause a crash for me.
Update: Installing R2023b Update 2 has not resolved this for me. (No mention of this in the release notes, as far as I saw.)
Update: I've had lots of interaction with MW support on this. Some suggested fixes (based solely on inspecting my personal setup) included shutting off various Accessibility settings, and turning off the 3rd-party software Flux. So far, nothing has helped.
Update: @Jinbo Zhang had success by fresh install of R2023b, and removing all older releases. This did not help me -- closing figures via the X in the figure window still causes MATLAB to hang.
Update: If you are having only the figure-closing issue, a work-around for me is to make sure that the window focus is not on the window you are closing, before you hit the X.
Update: The Sonoma update (14.3) seems to have fixed this problem for me.
Walter Roberson
el 2 de Oct. de 2023
For whatever it is worth, I am running R2023b without problem on Sonoma on an intel iMac.
ZONGCHAO
el 2 de Oct. de 2023
Movida: the cyclist
el 5 de Oct. de 2023
same issue after updating to sonoma version
Jawed Hakimi
el 2 de Oct. de 2023
Movida: the cyclist
el 5 de Oct. de 2023
I have problems where I can't close figures. m1 max macbook, macos sonoma 14.0
AEK
el 2 de Oct. de 2023
Movida: the cyclist
el 5 de Oct. de 2023
Same problem. Appears a few minutes after startup. Even if I don't do anything.
--------------------------------------------------------------------------------
Segmentation violation detected at 2023-10-02 16:08:37 +0300
--------------------------------------------------------------------------------
Configuration:
Crash Decoding : Disabled - No sandbox or build area path
Crash Mode : continue (default)
Default Encoding : UTF-8
Deployed : false
Graphics Driver : Apple Apple M2 Max Version 2.1 Metal - 86
Graphics Text Issue Info : xmin=-221.000000, ymin=-5.500000, xmax=0.000000, ymax=5.500000
Java Version : Java 1.8.0_382-b05 with Amazon.com Inc. OpenJDK 64-Bit Server VM mixed mode
MATLAB Architecture : maca64
MATLAB Root : /Applications/MATLAB_R2023b.app
MATLAB Version : 23.2.0.2365128 (R2023b)
OpenGL : hardware
Operating System : Mac OS 14.0 (23A344)
Processor ID : ABI64 ARM ARM64E
Window System : Quartz
Fault Count: 1
Abnormal termination:
Segmentation violation
the cyclist
el 2 de Oct. de 2023
I suppose a conceivable variable here is whether or not people are using the "New Desktop". I am not using it yet (and now I'm not keen to try it, just in case).
AEK
el 2 de Oct. de 2023
You mean the option to "Click Wallpaper to Reveal Desktop"? It's off for me, too. But matlab is crashing.
AEK
el 2 de Oct. de 2023
Maybe it's a matter of JVM version ? Can you write the output of "version -java" ?
Walter Roberson
el 2 de Oct. de 2023
'Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode'
for me (not having problems)
I am not using the new desktop.
@AEK the new desktop is a revised desktop that Mathworks is working on. Among other things, it supports Dark Theme
the cyclist
el 2 de Oct. de 2023
You can see the option to turn it on, directly above the toolstrip on the Command Window.
If you are using the new desktop, that button will say "Stop the New Desktop" instead.

huang liang
el 2 de Oct. de 2023
Jianrong Jia
el 3 de Oct. de 2023
Can you provide more details? I have reinstalled java and matlab but no one works.
I downloaded the new java from here: Java Downloads | Oracle 中国
huang liang
el 3 de Oct. de 2023
Jian Gao
el 3 de Oct. de 2023
Movida: the cyclist
el 5 de Oct. de 2023
I have the same issue on Macbook pro 2020 Intel (MacOS 14.0)
MATLAB Log File: /Users/gaojian/matlab_crash_dump.1616-1
------------------------------------------------
MATLAB Log File
------------------------------------------------
--------------------------------------------------------------------------------
Segmentation violation detected at 2023-10-04 13:48:23 +0800
--------------------------------------------------------------------------------
Configuration:
Crash Decoding : Disabled - No sandbox or build area path
Crash Mode : continue (default)
Default Encoding : UTF-8
Deployed : false
Graphics Driver : Uninitialized hardware
Java Version : Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
MATLAB Architecture : maci64
MATLAB Entitlement ID : 6257193
MATLAB Root : /Applications/MATLAB R2023b.app
MATLAB Version : 23.2.0.2380103 (R2023b) Update 1
OpenGL : hardware
Operating System : Mac OS 版本14.0(版号23A344)
Process ID : 1616
Processor ID : x86 Family 6 Model 126 Stepping 5, GenuineIntel
Session Key : 4093fa5e-d226-4977-b9d7-979ebe953a4d
Window System : Quartz
Fault Count: 1
Abnormal termination:
Segmentation violation
Current Thread: '' id 0x700007ba7000
Register State (from fault):
RAX = abd8b65eb8dd0001 RBX = 00007ffb47d32b80
RCX = 0000000000000002 RDX = 0000000000000000
RSP = 0000700007ba39d0 RBP = 0000700007ba39d0
RSI = 0000000000000000 RDI = 0000000000000012
R8 = 0000000000000000 R9 = 000060002e6e4280
R10 = 0000700007ba33c0 R11 = 0000000000000206
R12 = 0000000000000000 R13 = 0000000000000000
R14 = 0000000000000000 R15 = 0000000000000000
RIP = 00007ff805c73984 RFL = 0000000000010246
CS = 000000000000002b FS = 0000000000000000 GS = 0000000000000000
Stack Trace (from fault):
[ 0] 0x0000000110003204 /Applications/MATLAB R2023b.app/bin/maci64/libmwfl.dylib+00008708 _ZN10foundation4core4diag15stacktrace_base7captureERKNS1_14thread_contextEm+00000052
[ 1] 0x00000001100061d2 /Applications/MATLAB R2023b.app/bin/maci64/libmwfl.dylib+00020946 _ZN10foundation4core4test17terminate_handledERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE+00002210
[ 2] 0x00000001100056d0 /Applications/MATLAB R2023b.app/bin/maci64/libmwfl.dylib+00018128 _ZN10foundation4core4diag13terminate_logEPKcPK17__darwin_ucontext+00000128
[ 3] 0x000000011757d5cb /Applications/MATLAB R2023b.app/bin/maci64/libmwmcr.dylib+00521675 _Z19mnPrintErrorMessageRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE+00011451
[ 4] 0x000000011757b5f6 /Applications/MATLAB R2023b.app/bin/maci64/libmwmcr.dylib+00513526 _Z19mnPrintErrorMessageRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE+00003302
[ 5] 0x0000000117579005 /Applications/MATLAB R2023b.app/bin/maci64/libmwmcr.dylib+00503813 mnFatalSignalHandler+00000149
[ 6] 0x00007ff805afc37d /usr/lib/system/libsystem_platform.dylib+00013181 _sigtramp+00000029
[ 7] 0x0000000000000008 <unknown-module>+00000000
[ 8] 0x00007ff805b34672 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation+00026226 CFDictionaryGetValue+00000046
[ 9] 0x00007ffb1e452fb2 /System/Library/PrivateFrameworks/IO80211.framework/Versions/A/IO80211+00016306 Apple80211Scan+00000654
[ 10] 0x00000001350c85e6 /Applications/MATLAB R2023b.app/bin/maci64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+02123238 SZrvVftOC1B2M+00000416
[ 11] 0x00000001350c8a5a /Applications/MATLAB R2023b.app/bin/maci64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+02124378 AjEdeqBE+00000610
[ 12] 0x00000001350d8aca /Applications/MATLAB R2023b.app/bin/maci64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+02190026 DnaJFgfabOrGzcMOQOgiJ1B2M+00000215
[ 13] 0x00000001350d8174 /Applications/MATLAB R2023b.app/bin/maci64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+02187636 TSFahViiGsDVoPyMXCRkdcjdlGHVQrbz1B2M+00000663
[ 14] 0x00000001350d8013 /Applications/MATLAB R2023b.app/bin/maci64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+02187283 TSFahViiGsDVoPyMXCRkdcjdlGHVQrbz1B2M+00000310
[ 15] 0x00000001350d8339 /Applications/MATLAB R2023b.app/bin/maci64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.dylib+02188089 kJGelXsocljkLRyYxULdYwxUtduHEFWisDQMLb1B2M+00000045
[ 16] 0x00007ff805acf202 /usr/lib/system/libsystem_pthread.dylib+00025090 _pthread_start+00000099
[ 17] 0x00007ff805acabab /usr/lib/system/libsystem_pthread.dylib+00007083 thread_start+00000015
Ying-Feng Hsu
el 4 de Oct. de 2023
Movida: the cyclist
el 5 de Oct. de 2023
I also have the exactly same issue. Any help here?
Arthur
el 4 de Oct. de 2023
Movida: the cyclist
el 5 de Oct. de 2023
I have the same problem.
Joshua
el 4 de Oct. de 2023
Movida: the cyclist
el 5 de Oct. de 2023
Exact same problem for me, I deleted the app and used the newest installer, and it works now.
Jawed Hakimi
el 4 de Oct. de 2023
Movida: the cyclist
el 5 de Oct. de 2023
I did it multiple times, didnt work. Every time I close the figures it is just loading and never ends. But if I close all the figure through CMD window it works
Walter Roberson
el 4 de Oct. de 2023
@huang liang that is not Java, that is OpenJDK
Ying-Feng Hsu
el 4 de Oct. de 2023
Movida: the cyclist
el 5 de Oct. de 2023
I am in Intel (MacOS 14.0). And I also uninstalled and reinstalled the latest Matlab (2023b update 1). The crash problem still remains.
Nick
el 5 de Oct. de 2023
Movida: the cyclist
el 5 de Oct. de 2023
There were issues on that even on previous MacOS versions, but now it's getting worse.
Pay attention that you don't use tools, which work with Accessibility Features (e.g. BetterTouchTool, BetterSnapTool, iScreenShooter, etc.).
I had a debug sessions with MW engineers a year ago, and they pointed me to the stack traces from the Accessibility Framework. Seems like MATLAB uses it and coming to clash. That time re-configuring tools (e.g. BetterSnapTool allows ignoring particular applications) did help.
I didn't find yet what's causing the issues on my Mac today - so I'm also affected...
dim-ask
el 5 de Oct. de 2023
Closing plots through clicking the X on the window results to crash most often. Closing with cmd+w most of the times does not work. Closing with the close function works in principle, but it often messes up which window it closes, it does not always close the last "active" plot window. Zoom and other callback functions are messed up, too, and do not work well. Matlab is almost unworkable now if one is depending on interactive figures.
chiran
el 6 de Oct. de 2023
Movida: the cyclist
el 6 de Oct. de 2023
Can someone give me solution to this issue. I reinstalled matlab. But it didn't work for me. (I moved matlab to trash. Then I cleared the trash).
Stéphane
el 6 de Oct. de 2023
Same thing happen to me, macbook pro m1 pro. I just ignore the message (don't close the message window) and just use matlab as usual, the same way when using ventura os.
Luca Purificato
el 10 de Oct. de 2023
I have the same problems on MAcBook Air 2020 since i updated to sonoma 14. whenever I try to close figure but even when I use simulink
Ivan Rincon
el 11 de Oct. de 2023
same here !!! every time i close a figure or try to zoom it the program crash on sonoma14.0
Leon Müller
el 11 de Oct. de 2023
I have the same problem (R2023b Apple Silicon, Sonoma 14.0, M1 Pro), closing or even creating figures leads to a Matlab crash. For me, installing and enabling the new desktop beta seems to actually solve this issue (https://se.mathworks.com/matlabcentral/fileexchange/119593-new-desktop-for-matlab-beta). However, I would prefer not having to use the new desktop right now so that's still annoying, but at least a temporary workaround.
Ahmed Harbi
el 13 de Oct. de 2023
Same here, R2023a Apple Silicon, Sonoma 14.0, MacBook Air M1
超恒
el 13 de Oct. de 2023
m1 pro MacBook pro Sonoma , close figure then crash
Felipe
el 13 de Oct. de 2023
same here, Macbook Pro M1 Max, Sonoma 14.0. Workaround from Leon Muller is working for now.
Jinbo Zhang
el 20 de Oct. de 2023
Fresh installation of MATLAB2023b? I remove all my previous installation and preference settings, and all problem solved.
Jinbo Zhang
el 25 de Oct. de 2023
Did you install the java with right version. I also use Sonoma. It is running ok. Just some freeze when update figure quickily.
Alfarizy
el 25 de Oct. de 2023
Jinbo Zhang -> what version of java do you have?
Alfarizy
el 25 de Oct. de 2023
I think i figured it out how to fix this problem. It seems like there is a crashed happen on the java. It can be because you have multiple JDK/JRE installed on your mac.
What I did to fix this, I uninstalled all of my JDK/JRE according to this following instruction https://www.java.com/en/download/help/mac_uninstall_java.html and also do the following after you did the instruction on the link I provided.
Uninstalling the JDK on macOS
To uninstall the JDK on macOS, you must have Administrator privileges.
Note: Do not attempt to uninstall Java by removing the Java tools from /usr/bin. This directory is part of the system software and any changes will be reset by Apple the next time that you perform an update of the OS.
- Go to /Library/Java/JavaVirtualMachines.
- Remove the directory where the JDK is installed by running the rm command as a root user or by using the sudo tool:$ rm -rf jdk-1.8.jdk
After you have done both two steps above, restart your mac, and download then install Amazon Corretto 8 from Matlab website. Restart your mac, and open your MATLAB_R2023B
@Alfarizy it have to remove other jre ? But I have to use other version to do my jobs. I try to change default java version by change-the-default-java-jdk, and my terminal output is :
~ /usr/libexec/java_home -V
Matching Java Virtual Machines (1):
1.8.0_382 (arm64) "Amazon" - "Amazon Corretto 8" /Library/Java/JavaVirtualMachines/amazon-corretto-8.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/amazon-corretto-8.jdk/Contents/Home
➜ ~ set | grep JAVA
JAVA_HOME=/Library/Java/JavaVirtualMachines/amazon-corretto-8.jdk/Contents/Home
➜ ~ java -version
openjdk version "1.8.0_382"
OpenJDK Runtime Environment Corretto-8.382.05.1 (build 1.8.0_382-b05)
OpenJDK 64-Bit Server VM Corretto-8.382.05.1 (build 25.382-b05, mixed mode)
And the matlab terminal output of run `version -java` is correct too. But all it does not work, crashing problem still.
Zhenhao Zhou
el 13 de Nov. de 2023
Movida: the cyclist
el 13 de Nov. de 2023
I just installed the latest Matlab 2023b on the new MacBook Pro with M3 chip, the same issue occurs!!!!!!!!!!!! Very annoying! I can't close figures using the red button! Does Matlab or Apple has a timeline for solving this issue?
greg wurtz
el 13 de Nov. de 2023
@Zhenhao Zhou, did you update to 14.1.1. This solved the pb for me (with M2). Otherwise, selecting another window before hnadling Matlab windows also works (again, with M2).
Zhenhao Zhou
el 13 de Nov. de 2023
@greg wurtz Thanks for the response. I did update to 14.1.1, unfortunately it didn't solve the pb for me. Looks like selecting another window works but isn't a perfect solution. Let's hope an official update is on the way......
GlyArg
el 19 de Nov. de 2023
Exact same problem here. Sonoma and crash.
But I found that the "close-figures-on-top-and-hang" problem can be fixed by setting the figure renderer to "painters". Add this to "startup.m":
set(groot, 'defaultFigureRenderer', 'painters');
If I set the renderer to "opengl" the problem appears again. So looks like it's an opengl problem.
The crash report is still there but it can be minimized and ignored.
Note: 3D-plot will be very slow using painters since hardware acceleration is not used.
Yasunori Hayashi
el 1 de Dic. de 2023
Editada: Walter Roberson
el 1 de Dic. de 2023
Weizhe Chen
el 1 de Dic. de 2023
A good temporary solution. Thanks for sharing!
Lei Dai
el 8 de Dic. de 2023
Movida: Dyuman Joshi
el 11 de Dic. de 2023
My Matlab crashed everytime when I tried openning plot browser, or zoom-in/out my figure. It seems that something is not working well regarding the figure interface UI.
Xiliang Luo
el 8 de Dic. de 2023
Movida: Dyuman Joshi
el 11 de Dic. de 2023
OS: macOS Sonoma
Chip: Apple M3 Pro
Matlab Version: both 2023a and 2023b
Issue:
Whenever try to close a figure by clicking the red cross on the figure, matlab will freeze. Need to force quit and re-start.
Neal Gallagher
el 12 de Dic. de 2023
OS: macOS Sonom 14.2.
Chip: Intel Xeon
Matlab 2022b, 2023b
Issue: Close a figure by clicking the red cross on the figure, matlab will freeze. Need to force quit and re-start. Similar behavior observed with other GUI actions (e.g., radio button and dropdown menus).
ya liu
el 13 de Dic. de 2023
OS: macOS Sonom 14.2.
Chip: M2
Matlab 2023b
Close a figure by clicking the red cross on the figure, matlab will freeze. Need to force quit and re-start.
I use "close all" to close figures and Matlab works well! Hope this can help others!
john
el 17 de Dic. de 2023
Good to note that this issue is about crash report on launch.
It is not about the crash rerport on closing the figure. :)
Xiliang Luo
el 17 de Dic. de 2023
[Updated from previous post]
OS: macOS Sonoma
Chip: Apple M3 Pro
Matlab Version: 2023b
Issue:
Previously, whenever try to close a figure by clicking the red cross on the figure, matlab will freeze. Need to force quit and re-start.
After adding the following lines in stratup.m file (i created under start folder):
set(groot, 'defaultFigureCloseRequestFcn', 'close(gcf)');
set(groot, 'defaultFigureWindowStyle', 'normal');
warning('off', 'MATLAB:close:RecursionOnClose');
Matlab will not freeze if you close a new figure plotted after the addtition of new lines.
However, matlab will freeze when you open an old figure created before or created with older version of matlab.
Benjamin Simone
el 22 de En. de 2024
Movida: Dyuman Joshi
el 24 de En. de 2024
Please fix this issue soon, I have research to complete for school and lots of figures to save/edit/close! I'll be able to use a school computer for the time being, but this bug is really messing up my efficiency.
To give this thread a boost of awareness for MW: I get the rainbow wheel of death on my M1 Ultra Macbook Pro with Sonoma OS when closing a figure after running a matlab file.
geofo
el 24 de En. de 2024
Movida: Dyuman Joshi
el 24 de En. de 2024
Apple released a new vesion of Sonoma (14.3) and with this new version I can close plots in Matlab without problems. I tested this on 4 Mac computers, all work. I hope this works for you as well!
Mariano Kulish
el 8 de Feb. de 2024
Thank you geofo! I've done the 14.3 update, and that solved it for me too! Awesome!
Alexandre
el 13 de Mzo. de 2024
I have Sonoma 14.4 and matlab crash after a few minutes with the same error.
Alessandro
el 27 de Mzo. de 2024
Hi
Sonoma 14.4.1 here, R2023b crashes at "close all"
Very frustrating!
A
Ali Shahdoost
el 29 de Abr. de 2024
I'm not happy about this issue caused from "SIGBUS" error.
Respuesta aceptada
Más respuestas (20)
Ahmed Harbi
el 29 de Oct. de 2023
6 votos
Hello, the issue is not with the JAVA JDK, it's with the XCode version 15.0 with macOS Sonoma.
You can find in apple silicon requirements MATLAB is supported with XCode 14.0 with macOS Ventura. https://www.mathworks.com/support/requirements/apple-silicon.html
From the call stack the system is calling dylib files from /usr/lib/system "libsystem_platform, and libsystem_pthread". which are not comaptiable with the requirements for MATLAB.
Nothing can be done for now, either MATLAB get an update for XCode 15, and macOS Sonoma. Or you can downgrade your macOS version.
7 comentarios
Ahmed Harbi
el 29 de Oct. de 2023
Kindly note that downgrading your macOS version is not an easy task. You need to backup your data, and completely erase you mac, then reinstall the required macOS, and reinstall all of your data and programmes.
So, personally I recommend ignoring the crash report from MATLAB completely, as the software is still funtional even with the crash report. And wait for MathWorks to provide an update.
Walter Roberson
el 29 de Oct. de 2023
Having a backup before attempting anything like that is always a good idea.
If you are downgrading from a recent MacOS version to the one immediately before it, then you do not need to erase everything: you can instead have it overwrite just the APFS volume that holds the operating system: it should not need to erase your data.
If you have your time machine backups on an APFS volume then that requires a fairly recent version of MacOS, and you could possibly run into problems trying to restore off of it to a previous version of MacOS that did not support those.
john
el 1 de Nov. de 2023
I second this. Looks it's working on Sonoma with xcode 14. However, I'm wondering how painful it is to downgrade xcode from 15 to 14 and if it's not restricted.
Walter Roberson
el 1 de Nov. de 2023
@john xcode major versions are specific to MacOS releases. You cannot downgrade xcode to 14 without downgrading MacOS.
john
el 1 de Nov. de 2023
@Walter Roberson Thanks. OK... So, we have to wait for the update from MathWorks.
Jinbo Zhang
el 2 de Nov. de 2023
Editada: Jinbo Zhang
el 2 de Nov. de 2023
In that page, seem Xcode only related to compilers. Why it will have influence on gui usage? I compile spm c code, it is working just fine with Xcode 15. Besides, call stack report here is not a typical bug faced in Sonoma. Most of the bug reported in these coments is about matlab hangs when press X to a simple figure. And if you just open matlab in terminal with -nodesktop option, it can be solve temporally, Seem jdk should be part of the source of this bug. Interestingly, on one of my mac air which never install matlab, I fresh install matlab on it, it work smoothly.... no hang, no crash, just weird...
It's intriguing how different environments can impact software behavior. While Xcode's influence on GUI usage might not be immediately apparent, its role in handling compilers could indirectly affect performance. It's worth exploring potential interactions with JDK and other dependencies to troubleshoot issues like MATLAB hangs which seem to vary across setups.
geofo
el 24 de En. de 2024
Editada: the cyclist
el 24 de En. de 2024
2 votos
Apple released today (24 Jan 2024) a new vesion of Sonoma (14.3) and with this new version I can close plots in Matlab without problems. I tested this on 4 Mac computers, all work.
2 comentarios
the cyclist
el 24 de En. de 2024
In limited testing, this Sonoma update has fixed the problem for me, too. Fingers crossed!
Zhenhao Zhou
el 24 de En. de 2024
Same here! 14.3 solved all the figure-related issues!
Alfarizy
el 25 de Oct. de 2023
1 voto
I think i figured it out how to fix this problem. It seems like there is a crashed happen on the java. It can be because you have multiple JDK/JRE installed on your mac.
What I did to fix this, I uninstalled all of my JDK/JRE according to this following instruction https://www.java.com/en/download/help/mac_uninstall_java.html and also do the following after you did the instruction on the link I provided.
Uninstalling the JDK on macOS
To uninstall the JDK on macOS, you must have Administrator privileges.
Note: Do not attempt to uninstall Java by removing the Java tools from /usr/bin. This directory is part of the system software and any changes will be reset by Apple the next time that you perform an update of the OS.
- Go to /Library/Java/JavaVirtualMachines.
- Remove the directory where the JDK is installed by running the rm command as a root user or by using the sudo tool:$ rm -rf jdk-1.8.jdk
After you have done both two steps above, restart your mac, and download then install Amazon Corretto 8 from Matlab website. Restart your mac, and open your MATLAB_R2023B
11 comentarios
the cyclist
el 25 de Oct. de 2023
@Alfarizy, I'd be curious the result of the following test for you, if you don't mind. Execute the following code from the Command Window (not by putting them in a file and executing the file):
figure
scatter(rand(7,1),rand(7,1))
Then, try to close the resulting figure by using the X in the figure window (not by using the close command).
Does the figure close normally, or does MATLAB hang?
dim-ask
el 25 de Oct. de 2023
@the cyclist I did all the process but still matlab hangs when I press X to a simple figure so apparently it does not solve that. But if somebody has a different experience I would like to know.
I am waiting for mathworks people to come back to me, they suggested to remove accessibility permissions from other apps but this did not help either. Anybody here made it work somehow? I am afraid we will just have to wait for some OS update, it is beyond frustrating. I have to use the "new desktop" which is a good idea, but its current state is not for serious work (no custom shortcuts? wtf).
超恒
el 25 de Oct. de 2023
Thanks, but, if the JDK/JRE is need by other applied, since I can't uninstall it , how to fix this problem ?
dim-ask
el 26 de Oct. de 2023
@超恒 The answer below suggest this, I guess in the second step you set which environment matlab should use.
But I guess you can just run
version -java
inside matlab to see which environment matlab uses. But as I have the same issue without other jvms installed, that most probably does not solve anything
Pengyu Chen
el 27 de Oct. de 2023
Maybe you can run the following command from a Terminal (not MATLAB). This command will set MATLAB to use the specified (Amazon Corretto) Java, even if there is no other jvms.
<matlabroot>/bin/matlab_jenv <path to Java jre>
Aceson
el 27 de Oct. de 2023
what is the root dir for matlab? I only have matlab app sitting in my desktop...
Aceson
el 27 de Oct. de 2023
Pengyu Chen
el 28 de Oct. de 2023
@Aceson The default path is
/Applications/MATLAB_R2023b.app
Aceson
el 28 de Oct. de 2023
Jinbo Zhang
el 28 de Oct. de 2023
1 voto
Seem reinstall or reset Open-JRE have not solve all problem. Matlab also hang up, when ploting, editing, add external display, open gui or appdesign in SOMETIME, hard to predict. Both of my mac mini, mac air, and mac studio is in such condition. Maybe it is not a right time to use MATLAB2023b with Sonoma. This is a prerelease state not release state!
1 comentario
David
el 26 de Nov. de 2023
Agreed with you
Matteo Savoia
el 1 de Nov. de 2023
1 voto
Both R2023a and R2023b crash on my Intel MacBook Pro (late 2009) with Sonoma. With previous macOS version it worked fine.
I have also installed Amazon Corretto 8 but nothing changed.
I do not think it is related to the processors architecture (since I am on an Intel i9 and have the same issue).
I have to stick with the Windows 11 version for the time being..
3 comentarios
Weizhe Chen
el 5 de Nov. de 2023
Does R2023b v23.2.0.2409890 Update3 solve the probelem?
john
el 6 de Nov. de 2023
@Weizhe Chen Unfortunately no. Let's hope Update 4 or Matlab 2024a fixes the issue.
Kristofer
el 6 de Nov. de 2023
I was able to get it work on my M2 Macbook Pro on Sonoma by uninstalling the Oracle JRE and then installing Amazon Coretto 8
Hans Scharler
el 4 de Dic. de 2023
1 voto
From another support article: https://www.mathworks.com/matlabcentral/answers/2044833-is-matlab-compatible-with-macos-sonoma
MathWorks is currently aware of the following issues when running MATLAB on macOS Sonoma:
1. MATLAB crashes when using an Individual or Designated Computer license
2. MATLAB crashes when using Oracle Java on Apple Silicon
When launching the Apple Silicon version of MATLAB, MATLAB defaults to a previously installed Oracle Java and crashes. For instructions on how to point MATLAB to Amazon Corretto 8, see this article.
3. The Intel version of MATLAB crashes when generating a C++ MEX file.
This crash occurs after MEX is invoked. For more information and a workaround, see this this article.
4. Chinese characters in MATLAB UI
When the Chinese language is present as a secondary language on the machine, portions of the MATLAB UI display Chinese characters even when preferred locale is set to English. For more information, see this article.
3 comentarios
greg wurtz
el 8 de Dic. de 2023
I have a designated license on MacOS 14.1.2 on an M2 CPY (2023 Mavbook Air) and everythiung is working well. No crashes manipulating figures, etc.
David Fedida
el 13 de Dic. de 2023
MATLAB crashes after a few program runs for me 2023a or 2023b using OS Sonoma, it was fine using Big Sur. I have an Intel I7 MacPro 2019. Interestingly, it only crashes if I try and close a figure that the program plots. It will close one or two plots and the next time it locks up. So, I can use MATLAB if I don't close any figures unitl I have finished my programming, Any ideas how to fix this?
Rodrigo
el 14 de En. de 2024
i found a way to close it without crashing, instead of closing with the red x try closing it with cmd + w which is the fast way to close a window, it worked for me :)
geofo
el 23 de En. de 2024
1 voto
Hi Simone! I am not working at Matlab, I am just a user like you. Sorry to tell you that this problem persisted for a very long time now (some years), so it is unlikely Matlab and Apple will fix this in the following days. You need to find some other solution to fix your project. I know two solutions: (1) write in the startup.m file the two lines from the post above or (2) buy a Linux / Windows computer and install Matlab on it. Good luck!
2 comentarios
xinhui li
el 23 de En. de 2024
Could you please show me the path of startup.m? There are 3 startup.m in my laptop.
geofo
el 23 de En. de 2024
In Mac computers it should be under Documents/MATLAB/. You can check in Matlab "Home" tab, click on "Set Path" icon and check the first path in the list, this is it. If there is no startup file under the directory, make one. If you are still unsure which startup file is Matlab using among those you have, add a line to each of the three files like disp("This is number 1"), disp("This is number 2"), etc.
Pengyu Chen
el 26 de Oct. de 2023
0 votos
When you installed MATLAB R2023b for Apple silicon, it may have inherited Java settings from a previous release that are not compatible with native MATLAB for Apple silicon. Amazon Corretto Java 8 is the only officially supported JRE for MATLAB on Apple silicon. For further information, you can check the following link:
5 comentarios
Valtar
el 26 de Oct. de 2023
This solution did not work for me :(
Pengyu Chen
el 27 de Oct. de 2023
What's your jdk version?
Weizhe Chen
el 3 de Nov. de 2023
This solution did not work for me either :(
超恒
el 18 de Nov. de 2023
This solution did not work for me either :(
Pengyu Chen
el 18 de Nov. de 2023
So wierd :(
Jinbo Zhang
el 28 de Oct. de 2023
0 votos
I found if you use apple remote desktop to access your Desktop, and MATLAB is just on your screen. MATLAB will be hang up.................
greg wurtz
el 2 de Nov. de 2023
Editada: greg wurtz
el 3 de Nov. de 2023
0 votos
Hello,
I installed 2023b under Sonoma on a Mac with an Intel chip and it has not crashed yet. However, I also am also running the same config on a Mac with an M2 chip (this is another install of 2023b for Apple Silicon). This one launches and processes code but eventually freezes.
addition on 11/3 12:07 EST: Marlab 2023b freezes using the M2 platform only when plotting as far as I can tell.
5 comentarios
Weizhe Chen
el 3 de Nov. de 2023
To my understanding, this bug is related to MacOS 14, independent of CPU.
greg wurtz
el 3 de Nov. de 2023
I just double checked and I cannot get the version working on Intel to crash.
greg wurtz
el 6 de Nov. de 2023
Looking into this a bit further, Matlab is not crashing unless I am trying to manually close a figure. Closing a figure from the command window is not a problem.
the cyclist
el 8 de Nov. de 2023
@greg wurtz, I learned from MW support that if you have the focus on a different window (i.e. click on literally any other window), you can successfully manually close a MATLAB figure window.
It's a pretty annoying work-around, but it does seem to work for me.
greg wurtz
el 8 de Nov. de 2023
this works indeed. Thanks!
junyi
el 8 de Nov. de 2023
0 votos
hey bro,i had the same question .My macos system is 14.1,i unload matlab firstly.Then check https://www.mathworks.com/support/requirements/apple-silicon.html you will find you need download java 8 and Amazon Corretto 8. And you should know that some of products are not suitable for macos ,so just download Matlab ,and click on the matlab icon,you will find you can open it .Good luck!!!
2 comentarios
greg wurtz
el 8 de Nov. de 2023
that is not solving the problem.
junyi
el 9 de Dic. de 2023
check whether u download right version of java or Amazo Corretto.Then try again.
Sometimes ,maybe the file was damaged when downloading, but the chance is tiny.
PD
el 8 de Nov. de 2023
0 votos
I just found out that Turning off the Display contrast in Accessibility -> Display may solve this problem, just set the Display contrast to normal and restart the mac, and then the Matlab will no more freeze after turning off the figure.
4 comentarios
Walter Roberson
el 8 de Nov. de 2023
!!
超恒
el 18 de Nov. de 2023
my setup is always normal, problem still
灵通 仲
el 4 de Dic. de 2023
how to set?
the cyclist
el 11 de Dic. de 2023
Just as another data point on this, MathWorks support team worked a lot with me on "It's an Accessibility issue", and that route never solved the problem for me.
David
el 26 de Nov. de 2023
0 votos
Oh, that's quite a rollercoaster! It's awesome that Matlab 2023b was running smoothly on your macOS 13.6. The decision to update to Sonoma, however, seems to have introduced a hiccup with Matlab crashing on launch. It's always frustrating when an upgrade leads to unexpected issues. The silver lining is that you're not alone in this, with similar reports on Stack Overflow. Here's hoping the community can pool its expertise to find a solution, and you'll soon have Matlab running seamlessly on Sonoma. Fingers crossed for a quick resolution!
2 comentarios
john
el 26 de Nov. de 2023
No matter how expert the community is, only MathWorks has the source code and can give the proper patch for this bug.
However, the community has its solutions :D and you can find a fix for this bug somewhere on the internet. I hope that MW finds it soon and releases it in their 5th update. fingers crossed!
David
el 27 de Nov. de 2023
Sure we hope so this issue sloved soon!!
Touraj Tajbakhsh
el 11 de Dic. de 2023
Here is a workaround to prevent MATLAB from hanging when closing or docking a figure. Please insert the following code into your startup.m file:
% avoid hangs when closing a figure
set(groot, 'defaultFigureCloseRequestFcn', 'close(gcf)');
set(groot, 'defaultFigureWindowStyle', 'docked');
warning('off', 'MATLAB:close:RecursionOnClose');
% Additional settings for docked figures to prevent hanging
set(groot, 'defaultFigureDockControls', 'on');
2 comentarios
Xiliang Luo
el 11 de Dic. de 2023
Does not work. Matlab needs to get a fix or new release.
xinhui li
el 23 de En. de 2024
Which startup.m? Could you please show me the path?
geofo
el 11 de Dic. de 2023
0 votos
A variant of the suggested code shown below worked for me. The question is still why nobody at Mathworks is able to fix this problem for 3 years now if it just means two lines of code?
set(groot, 'defaultFigureCloseRequestFcn', 'close(gcf)');
warning off MATLAB:Figure:RecursionOnClose;
2 comentarios
David Fedida
el 14 de Dic. de 2023
This worked for me too
Binod
el 17 de Dic. de 2023
does not work this method in MacOS 14.2 sonoma, M1, 8 GB
Binod
el 17 de Dic. de 2023
0 votos
Same problem with me ... tried multiple options, but useless!
OS: macOS Sonom 14.2
Chip: M1
Matlab R2022b
Issue: Close a figure by clicking the red cross on the figure, matlab will freeze and unresponsive.
1 comentario
Tim Lueth
el 10 de Jul. de 2024
I have those problems on OSX 14.5 Sonoma on Mac and Intel and with different Matlab version on some days with slow internet connections. using matlab is not possible on those days at all. I noticed that the two mentioned lines have to be modified to give 'whomever' some time to react.
set(groot, 'defaultFigureCloseRequestFcn', 'pause(0.05); close(gcf)'); % PAUSE!
warning off MATLAB:Figure:RecursionOnClose;
Inserting the pause solved it on my mac immediately
geofo
el 17 de Dic. de 2023
0 votos
Hi Binod! I uderstand your frustration as I stopped using Mac after I had this same problem each time Mac Sonoma 14 version was updated. I saw in your message after you posted it (got email from Maltabl) that there is a new Mac Sonoma Version 14.2, I had 14.1.2, So I updated all my Mac computers to see what happens. My Macs are as follows:
Mac Air M1, 8 GB
MacMini M1, 16 GB
Macbook Pro 16" with I9, 16 GB
MacBookPro 16" with M1, 32 GB
After the update all of them worked well with Matlab with the two lines added in startup.m I wrote about, Matlab is not freezing anymore:
set(groot, 'defaultFigureCloseRequestFcn', 'close(gcf)');
warning off MATLAB:Figure:RecursionOnClose;
This means it must be something special with your setup. Have you installed the Java amazon-correto? Have you installed the Matlab version for M-processors? Sorry, but I don't have more advices except you can do a favour to yourself and buy a Dell with a multi-core CPU, install Matlab on it and it will work like a charm. I was never a fan of Microsoft Windows, but it works extremely well these days. After I made the change, I didn't use Mac anymore. Good luck!
Zhenhao Zhou
el 24 de En. de 2024
0 votos
Updating to the newly released macOS 14.3 has solved all figure UI related issues!!!! Can close figures normally, and editing figures using property editor is also functioning well! I think Apple has finally solved this issue(s) that has been there for years!
1 comentario
James Ganong
el 1 de Mzo. de 2024
I found a way that works for me using the prerelease of MATLAB 2024a and Amazon Corretto 11.
Here are the details:
With MacOS Sonoma 14.3.1 on Apple Silicon and MATLAB 2023b I was getting the following messages, and MATLAB would apper to hang:
objc[1675]: Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x23c196340) and /Applications/MATLAB_R2023b.app/bin/maca64/Frameworks/Chromium Embedded Framework.framework/Libraries/libGLESv2.dylib (0x108959e70). One of the two will be used. Which one is undefined.
CodeCache is full. Compiler has been disabled.
Try increasing the code cache size using -XX:ReservedCodeCacheSize=
I tried MATLAB 2024a prerelease, and got a similar message and hang:
jeg@barberfish cafe_dive % /Applications/MATLAB_R2024a.app/bin/matlab
objc[1823]: Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x23c196340) and /Applications/MATLAB_R2024a.app/bin/maca64/Frameworks/Chromium Embedded Framework.framework/Libraries/libGLESv2.dylib (0x10c859e70). One of the two will be used. Which one is undefined.
CodeCache is full. Compiler has been disabled.
Try increasing the code cache size using -XX:ReservedCodeCacheSize=
Finally, I unistalled Amazon Corretto 8, following the instructions at https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/macos-install.html#macos-uninstall and installed Amazon Correto 11 setting JAVA_HOME follwing instructions at https://docs.aws.amazon.com/corretto/latest/corretto-11-ug/macos-install.html
and now the last line of the errors messages no longer appears and it is no longer appearing to hang:
% matlab
WARNING: package sun.awt.X11 not in java.desktop
WARNING: package sun.awt.X11 not in java.desktop
objc[2933]: Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x23c196340) and /Applications/MATLAB_R2023b.app/bin/maca64/Frameworks/Chromium Embedded Framework.framework/Libraries/libGLESv2.dylib (0x10d059e70). One of the two will be used. Which one is undefined.
James Huth
el 15 de Jul. de 2024
0 votos
Has this issue now been solved? I had been using R2023b in the Fall 2023/ January 2024 and experienced same crashed when trying to close Simulink figures. Was told by Mathworks tech support that it was an Apple + Java issue.
Am still on R2023b... but also now Mac Sonoma 14.5. Is the problem resolved for everyone using R2023b? I wanted to hold off on jump to R2024a since I still have colleagues using R2023b.
1 comentario
I've inserted the two recommended lines of "gofo" 2023-12-17 into startup.m but added a pause of (0.05) that was required on faster Macs. The two code lines solved exactly this problem on all of my Intel Macs and Silicon Macs 2018-2024 using 2024a and independently (!) on the JAVA version.
set(groot, 'defaultFigureCloseRequestFcn', 'pause(0.05); close(gcf)'); % PAUSE!
warning off MATLAB:Figure:RecursionOnClose;
geofo
el 15 de Jul. de 2024
0 votos
The problem is solved, I have Matlab 2024b installed on Macs with both Intel and M1 processors and it works.
Categorías
Más información sobre Introduction to Installation and Licensing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!