Why is MATLAB crashing on macOS with crash log showing CoreAudio library?

8 views (last 30 days)
On macOS, crashes have occurred when:
  • using "clear all" or "clear mex" commands
  • using some audio functionality (e.g. audioplayer, audioread, audiorecorder, sound, soundsc)
  • plugging in or unplugging headphones from Mac laptop
  • muting or unmuting laptop
  • closing the lid of laptop or computer going to sleep
  • using Psychtoolbox to produce audio sounds
  • publishing scripts workflows 
The workaround below may help, if the crash log matches these:
[ 8] 0x00007fff33d82ec8 /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio+00102088 _ZN9HALObject17PropertiesChangedEjPK26AudioObjectPropertyAddress+00001280
[ 9] 0x00007fff33d8773f /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio+00120639 _ZN9HALDevice17PropertiesChangedEjPK26AudioObjectPropertyAddress+00000421
OR
[ 8] 0x00007fff305333d6 HALObject::PropertiesChanged(unsigned int, AudioObjectPropertyAddress const*)+00001280 at /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio+107478 (no debugging symbols found)
[ 9] 0x00007fff30537f4a HALDevice::PropertiesChanged(unsigned int, AudioObjectPropertyAddress const*)+00000422 at /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio+126794 (no debugging symbols found)
Full stack traces can look like this:
Stack Trace (from fault):
[ 0] 0x000000010f06af54 bin/maci64/libmwfl.dylib+00053076 _ZN10foundation4core4diag15stacktrace_base7captureERKNS1_14thread_contextEm+00000052
[ 1] 0x000000010f06fe26 bin/maci64/libmwfl.dylib+00073254 _ZN10foundation4core4test17terminate_handledEv+00003958
[ 2] 0x000000010f06ec49 bin/maci64/libmwfl.dylib+00068681 _ZN10foundation4core4diag13terminate_logEPKcPK17__darwin_ucontext+00000185
[ 3] 0x00000001151682f0 bin/maci64/libmwmcr.dylib+00574192 _Z19mnPrintErrorMessageRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE+00010208
[ 4] 0x0000000115165f72 bin/maci64/libmwmcr.dylib+00565106 _Z19mnPrintErrorMessageRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE+00001122
[ 5] 0x0000000115164681 bin/maci64/libmwmcr.dylib+00558721 mnFatalSignalHandler+00000145
[ 6] 0x00007fff5c737f5a /usr/lib/system/libsystem_platform.dylib+00008026 _sigtramp+00000026
[ 7] 0x00007fff5c4c0770 /usr/lib/system/libsystem_c.dylib+00296816 __vfprintf+00016214
[ 8] 0x00007fff33f339a5 /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio+00096677 _ZN9HALObject17PropertiesChangedEjPK26AudioObjectPropertyAddress+00000745
[ 9] 0x00007fff33f382eb /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio+00115435 _ZN9HALDevice17PropertiesChangedEjPK26AudioObjectPropertyAddress+00000437
[ 10] 0x00007fff33f479c1 /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio+00178625 _ZN9HALSystem28AudioObjectPropertiesChangedEPP28AudioHardwarePlugInInterfacejjPK26AudioObjectPropertyAddress+00000163
[ 11] 0x00007fff33f569e1 /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio+00240097 _ZN19HALC_ProxyIOContext10IOWorkLoopEv+00001369
[ 12] 0x00007fff33f562bc /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio+00238268 _ZN19HALC_ProxyIOContext13IOThreadEntryEPv+00000128
[ 13] 0x00007fff33f55ffe /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio+00237566 _ZN13HALB_IOThread5EntryEPv+00000072
[ 14] 0x00007fff5c741661 /usr/lib/system/libsystem_pthread.dylib+00013921 _pthread_body+00000340
[ 15] 0x00007fff5c74150d /usr/lib/system/libsystem_pthread.dylib+00013581 _pthread_body+00000000
[ 16] 0x00007fff5c740bf9 /usr/lib/system/libsystem_pthread.dylib+00011257 thread_start+00000013

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 5 Dec 2023
Edited: MathWorks Support Team on 20 Dec 2023
This issue is addressed in MATLAB R2020b and later releases. For earlier releases, the best known workaround is to remove following instances in your code (scripts and/or functions):
clear all
and 
clear mex
If you are using Psychtoolbox (3rd party toolbox), you may still be getting this crash in MATLAB R2020b and later releases. In such case, please contact the authors of the toolbox for assistance.

More Answers (0)

Products


Release

No release entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!