AU host crashes in IOThread in macOS 11 and later - objective-c

I've problem with an AU host (based on Audio Toolbox/Core Audio, not AVFoundation) when running on macOS 11 or later and Apple Silicon – it crashes after some operations in GUI. The weird is, it crashes in IOThread. Could this be caused by some inappropriate operation in GUI (eg. outside the main thread) that effects the IOThread? Sounds quite improbable to me. And I did not find anything suspicious in the code.
There are two logs in the debugger:
[AUHostingService Client] connection interrupted.
rt_sender::signal_wait failed: 89
And here is the crash log:
Code Type: ARM-64 (Native)
Parent Process: ??? [1]
OS Version: macOS 11.6.1 (20G224)
Report Version: 12
Crashed Thread: 14 com.apple.audio.IOThread.client
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [2509]
VM Regions Near 0:
-->
__TEXT 104150000-104248000 [ 992K] r-x/r-x SM=COW /Volumes/...
Application Specific Information:
Performing #selector(selectModule:) from sender NSMenuItem 0x600001033db0
Thread 14 Crashed:: com.apple.audio.IOThread.client
0 libsystem_platform.dylib 0x000000019847e6dc _platform_memset + 108
1 com.apple.audio.AudioToolboxCore 0x000000019987dd5c AUOOPRenderingClient::render(unsigned long, AUOOPRenderClientUser const&, bool, unsigned int*, AudioTimeStamp const*, unsigned int, unsigned int, AudioBufferList*, AURenderEvent const*, int (unsigned int*, AudioTimeStamp const*, unsigned int, long, AudioBufferList*) block_pointer) + 212
2 com.apple.audio.AudioToolboxCore 0x00000001998d4390 __38-[AUAudioUnit_XPC internalRenderBlock]_block_invoke + 288
3 com.apple.audio.AudioToolboxCore 0x000000019993d4f4 __26-[AUAudioUnit renderBlock]_block_invoke + 288
4 com.apple.audio.AudioToolboxCore 0x00000001998c1d9c AUv3InstanceBase::Render(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int, AudioBufferList&) + 132
5 com.apple.audio.AudioToolboxCore 0x00000001999f7234 AUIB_Render(void*, unsigned int*, AudioTimeStamp const*, unsigned int, unsigned int, AudioBufferList*) + 68
6 com.apple.audio.units.Components 0x000000012064c01c 0x120600000 + 311324
7 com.apple.audio.units.Components 0x00000001206515b4 0x120600000 + 333236
8 com.apple.audio.units.Components 0x0000000120651d54 0x120600000 + 335188
9 com.apple.audio.units.Components 0x0000000120632af4 0x120600000 + 207604
10 com.apple.audio.units.Components 0x00000001206cf468 0x120600000 + 849000
11 com.apple.audio.units.Components 0x000000012064c01c 0x120600000 + 311324
12 com.apple.audio.units.Components 0x00000001206515b4 0x120600000 + 333236
13 com.apple.audio.units.Components 0x0000000120651d54 0x120600000 + 335188
14 com.apple.audio.units.Components 0x0000000120632af4 0x120600000 + 207604
15 com.apple.audio.units.Components 0x00000001206cf468 0x120600000 + 849000
16 com.apple.audio.units.Components 0x000000012064c01c 0x120600000 + 311324
17 com.apple.audio.units.Components 0x00000001206515b4 0x120600000 + 333236
18 com.apple.audio.units.Components 0x0000000120651d54 0x120600000 + 335188
19 com.apple.audio.units.Components 0x0000000120632af4 0x120600000 + 207604
20 com.apple.audio.units.Components 0x00000001206cf468 0x120600000 + 849000
21 com.myFramework 0x00000001173d603c ausdk::AUInputElement::PullInputWithBufferList(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int, AudioBufferList&) + 184 (AUInputElement.h:84)
22 com.myFramework 0x00000001173d5f70 ausdk::AUInputElement::PullInput(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int) + 212 (AUInputElement.cpp:82)
23 com.myFramework 0x00000001173d2808 ausdk::AUEffectBase::Render(unsigned int&, AudioTimeStamp const&, unsigned int) + 92 (AUEffectBase.cpp:295)
24 com.myFramework 0x00000001173bd9f8 ausdk::AUBase::RenderBus(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int) + 80
25 com.myFramework 0x00000001173c355c ausdk::AUBase::DoRenderBus(unsigned int&, AudioTimeStamp const&, unsigned int, ausdk::AUOutputElement&, unsigned int, AudioBufferList&) + 152 (AUBase.h:549)
26 com.myFramework 0x00000001173c3048 ausdk::AUBase::DoRender(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int, AudioBufferList&) + 1228 (AUBase.cpp:1307)
27 com.myFramework 0x00000001173d9694 ausdk::AUMethodRender(void*, unsigned int*, AudioTimeStamp const*, unsigned int, unsigned int, AudioBufferList*) + 124 (AUPlugInDispatch.cpp:327)
28 com.apple.audio.units.Components 0x000000012064c01c 0x120600000 + 311324
29 com.apple.audio.units.Components 0x00000001206515b4 0x120600000 + 333236
30 com.apple.audio.units.Components 0x0000000120651d54 0x120600000 + 335188
31 com.apple.audio.units.Components 0x0000000120632af4 0x120600000 + 207604
32 com.apple.audio.units.Components 0x00000001206cf468 0x120600000 + 849000
33 com.apple.audio.units.Components 0x000000012064c01c 0x120600000 + 311324
34 com.apple.audio.units.Components 0x00000001206515b4 0x120600000 + 333236
35 com.apple.audio.units.Components 0x0000000120651d54 0x120600000 + 335188
36 com.apple.audio.units.Components 0x0000000120632af4 0x120600000 + 207604
37 com.apple.audio.units.Components 0x00000001206cf468 0x120600000 + 849000
38 com.apple.audio.units.Components 0x000000012064c01c 0x120600000 + 311324
39 com.apple.audio.units.Components 0x00000001206515b4 0x120600000 + 333236
40 com.apple.audio.units.Components 0x0000000120651d54 0x120600000 + 335188
41 com.apple.audio.units.Components 0x0000000120632af4 0x120600000 + 207604
42 com.apple.audio.units.Components 0x00000001206cf468 0x120600000 + 849000
43 com.apple.audio.units.Components 0x000000012064c01c 0x120600000 + 311324
44 com.apple.audio.units.Components 0x000000012060e7ac 0x120600000 + 59308
45 com.apple.audio.AudioToolboxCore 0x000000019986033c AudioConverterChain::CallInputProc(unsigned int) + 436
46 com.apple.audio.AudioToolboxCore 0x0000000199863cd4 AudioConverterChain::FillBufferFromInputProc(unsigned int*, CABufferList*) + 388
47 com.apple.audio.AudioToolboxCore 0x00000001998453ac BufferedAudioConverter::GetInputBytes(unsigned int, unsigned int&, CABufferList const*&) + 200
48 com.apple.audio.AudioToolboxCore 0x00000001999f77a8 CBRConverter::RenderOutput(CABufferList*, unsigned int, unsigned int&, AudioStreamPacketDescription*) + 120
49 com.apple.audio.AudioToolboxCore 0x00000001998456d8 BufferedAudioConverter::FillBuffer(unsigned int&, AudioBufferList&, AudioStreamPacketDescription*) + 396
50 com.apple.audio.AudioToolboxCore 0x00000001998607c4 AudioConverterChain::RenderOutput(CABufferList*, unsigned int, unsigned int&, AudioStreamPacketDescription*) + 128
51 com.apple.audio.AudioToolboxCore 0x00000001998456d8 BufferedAudioConverter::FillBuffer(unsigned int&, AudioBufferList&, AudioStreamPacketDescription*) + 396
52 com.apple.audio.AudioToolboxCore 0x000000019990bbcc AudioConverterFillComplexBuffer + 788
53 com.apple.audio.units.Components 0x000000012060e01c 0x120600000 + 57372
54 com.apple.audio.units.Components 0x0000000120632af4 0x120600000 + 207604
55 com.apple.audio.units.Components 0x0000000120611a2c 0x120600000 + 72236
56 com.apple.audio.CoreAudio 0x0000000199dbf138 invocation function for block in HALC_ProxyIOContext::HALC_ProxyIOContext(unsigned int, unsigned int) + 5484
57 com.apple.audio.CoreAudio 0x0000000199f38388 HALB_IOThread::Entry(void*) + 88
58 libsystem_pthread.dylib 0x0000000198433878 _pthread_start + 320
59 libsystem_pthread.dylib 0x000000019842e5e0 thread_start + 8
Thread 14 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000200 x3: 0x0000000000000000
x4: 0x000000016c109250 x5: 0x000000016c10a6a0 x6: 0x0000000000000080 x7: 0x0000000000000000
x8: 0x00000000fffefb47 x9: 0x0000000000000002 x10: 0x00006003f202a065 x11: 0x0000000000000007
x12: 0x0000000000000005 x13: 0x00006000014a40c0 x14: 0x00000001175fe1c8 x15: 0x0000000203886158
x16: 0x000000019847e610 x17: 0x0000000206f57cb0 x18: 0x0000000000000000 x19: 0x0000000000000000
x20: 0x000060000371ca30 x21: 0x0000000198446644 x22: 0x0000000198446644 x23: 0x000060000371ca20
x24: 0x0000000000000000 x25: 0x00000000fffefb43 x26: 0x000000130014b47a x27: 0x00000002033a2b70
x28: 0x000060000371ca20 fp: 0x000000016c108ff0 lr: 0x000000019987dd5c
sp: 0x000000016c108ef0 pc: 0x000000019847e6dc cpsr: 0x80001000
far: 0x0000000000000000 esr: 0x92000046
Thanks
Tomas

Related

WxWidgets crash. App is run from cmdLine with some cmdLine args. wxCriticalSectionLocker seems to run in a loop until it crashes. This occur randomly

Running an application from cmd with some cmdLine args. WxWidget parses the arguments and passes them to my application. Some methods are run in my app based on those params and than the app finishes. In some cases WxWidget crashes with the following stack. Any suggestions on why this might happen?
0x1022e0184 std::__1::__compressed_pair_elem<std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >::__rep, 0, false>::__get() const + 4 (compressed_pair.h:67)
1 0x1022e0175 std::__1::__compressed_pair<std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >::__rep, std::__1::allocator<wchar_t> >::first() const + 21 (compressed_pair.h:156)
2 0x1022e0095 std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >::__is_long() const + 21 (string:1459)
3 0x1022e0369 std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >::size() const + 25 (string:978)
4 0x1022e0e95 std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >::length() const + 21 (string:979)
5 0x1022ddbd5 wxString::length() const + 21 (string.h:1405)
6 0x1020f3ca8 wxPrivate::wxStringAsBufHelper<wchar_t>::Get(wxString const&, unsigned long*) + 40 (string.h:3796)
7 0x1020f3c34 wxCharTypeBuffer<wchar_t> wxString::tchar_str<wchar_t>(unsigned long*) const + 52 (string.h:1627)
8 0x1020f3af5 wxStringTypeBufferBase<wchar_t>::wxStringTypeBufferBase(wxString&, unsigned long) + 69 (string.h:3906)
9 0x1020f3aa5 wxStringTypeBuffer<wchar_t>::wxStringTypeBuffer(wxString&, unsigned long) + 37 (string.h:3990)
10 0x1020ee785 wxStringTypeBuffer<wchar_t>::wxStringTypeBuffer(wxString&, unsigned long) + 37 (string.h:3990)
11 0x1020ee612 wxString::FromAscii(char const*, unsigned long) + 98 (string.cpp:1169)
12 0x1020ee80c wxString::FromAscii(char const*) + 60 (string.cpp:1187)
13 0x102155f0a wxMutexInternal::HandleLockResult(int) + 266 (threadpsx.cpp:371)
14 0x102155dc4 wxMutexInternal::Lock() + 100 (threadpsx.cpp:305)
15 0x10215ec57 wxMutex::Lock() + 151 (thrimpl.cpp:43)
16 0x101c30c65 wxCriticalSection::Enter() + 21 (thread.h:291)
17 0x101c30c43 wxCriticalSectionLocker::wxCriticalSectionLocker(wxCriticalSection&) + 35 (thread.h:307)
18 0x101c2d09d wxCriticalSectionLocker::wxCriticalSectionLocker(wxCriticalSection&) + 29 (thread.h:306)
19 0x1020cc870 wxLog::GetComponentLevel(wxString const&) + 32 (log.cpp:630)
20 0x1022dddcb wxLog::IsLevelEnabled(unsigned long, wxString const&) + 59 (log.h:419)
21 0x102155f1f wxMutexInternal::HandleLockResult(int) + 287 (threadpsx.cpp:371)
22 0x102155dc4 wxMutexInternal::Lock() + 100 (threadpsx.cpp:305)
23 0x10215ec57 wxMutex::Lock() + 151 (thrimpl.cpp:43)
24 0x101c30c65 wxCriticalSection::Enter() + 21 (thread.h:291)
25 0x101c30c43 wxCriticalSectionLocker::wxCriticalSectionLocker(wxCriticalSection&) + 35 (thread.h:307)
26 0x101c2d09d wxCriticalSectionLocker::wxCriticalSectionLocker(wxCriticalSection&) + 29 (thread.h:306)
27 0x1020cc870 wxLog::GetComponentLevel(wxString const&) + 32 (log.cpp:630)
28 0x1022dddcb wxLog::IsLevelEnabled(unsigned long, wxString const&) + 59 (log.h:419)
29 0x102155f1f wxMutexInternal::HandleLockResult(int) + 287 (threadpsx.cpp:371)
30 0x102155dc4 wxMutexInternal::Lock() + 100 (threadpsx.cpp:305)
31 0x10215ec57 wxMutex::Lock() + 151 (thrimpl.cpp:43)
32 0x101c30c65 wxCriticalSection::Enter() + 21 (thread.h:291)
33 0x101c30c43 wxCriticalSectionLocker::wxCriticalSectionLocker(wxCriticalSection&) + 35 (thread.h:307)
34 0x101c2d09d wxCriticalSectionLocker::wxCriticalSectionLocker(wxCriticalSection&) + 29 (thread.h:306)
35 0x1020cc870 wxLog::GetComponentLevel(wxString const&) + 32 (log.cpp:630)
36 0x1022dddcb wxLog::IsLevelEnabled(unsigned long, wxString const&) + 59 (log.h:419)
37 0x102155f1f wxMutexInternal::HandleLockResult(int) + 287 (threadpsx.cpp:371)
38 0x102155dc4 wxMutexInternal::Lock() + 100 (threadpsx.cpp:305)
39 0x10215ec57 wxMutex::Lock() + 151 (thrimpl.cpp:43)
40 0x101c30c65 wxCriticalSection::Enter() + 21 (thread.h:291)
41 0x101c30c43 wxCriticalSectionLocker::wxCriticalSectionLocker(wxCriticalSection&) + 35 (thread.h:307)
42 0x101c2d09d wxCriticalSectionLocker::wxCriticalSectionLocker(wxCriticalSection&) + 29 (thread.h:306)
43 0x1020cc870 wxLog::GetComponentLevel(wxString const&) + 32 (log.cpp:630)
44 0x1022dddcb wxLog::IsLevelEnabled(unsigned long, wxString const&) + 59 (log.h:419)
45 0x102155f1f wxMutexInternal::HandleLockResult(int) + 287 (threadpsx.cpp:371)
46 0x102155dc4 wxMutexInternal::Lock() + 100 (threadpsx.cpp:305)
47 0x10215ec57 wxMutex::Lock() + 151 (thrimpl.cpp:43)
48 0x101c30c65 wxCriticalSection::Enter() + 21 (thread.h:291)
Could not find any relevant solutions or indication of why this might occur.
Application does not have any UI.
The problem is that pthread_mutex_lock() fails with an unexpected error (i.e. not one of EDEADLK, EINVAL or ETIMEDOUT) and trying to log this error results in the same error again and, so, to stack overflow (making this site a good choice for discussing this!).
It would be interesting to know what is the value passed to HandleLockResult(), i.e. what is the actual error, if you can look it up. And, of course, if you can provide simple example reproducing the problem, you should open a bug report in wxWidgets for this.

react native ios crash on launch UIKitCore

we're getting a small number but regular crashes on launch in a production app.
We have Crashlytics and Sentry but i cant see any references to the react code.
Here is a couple of stacktraces
Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x2d318 __abort_with_payload + 8
1 libsystem_kernel.dylib 0x2fc24 abort_with_payload_wrapper_internal + 104
2 libsystem_kernel.dylib 0x2fbbc abort_with_payload_wrapper_internal + 30
3 libobjc.A.dylib 0x2d0b4 _objc_fatalv(unsigned long long, unsigned long long, char const*, char*) + 116
4 libobjc.A.dylib 0x2d040 _objc_fatalv(unsigned long long, unsigned long long, char const*, char*) + 30
5 libobjc.A.dylib 0x5acc weak_register_no_lock + 392
6 libobjc.A.dylib 0xa924 objc_storeWeak + 448
7 UIKitCore 0x2a2ee0 -[_UIBoundingPath initWithCoordinateSpace:] + 96
8 UIKitCore 0x613fc4 -[_UIComplexBoundingPath initWithCoordinateSpace:orientation:scale:boundingPathBitmap:] + 112
9 UIKitCore 0x3f11d0 -[_UIScreenComplexBoundingPathUtilities boundingPathForWindow:] + 2836
10 UIKitCore 0x675ddc -[UIWindow _boundingPath] + 204
11 UIKitCore 0x1b1650 -[UIView(UIViewBoundingPathSupportInternal) _effectiveBoundingPathAndBoundingPathView:] + 244
12 UIKitCore 0x4bab4c -[UIView(UIViewBoundingPathSupport) _rectTuckedAgainstBoundingPathEdge:withSize:cornerRadii:minimumPadding:] + 260
13 UIKitCore 0x6b74f8 -[_UISheetLayoutInfo _unsafeInsets] + 160
14 UIKitCore 0x71f18 -[_UISheetLayoutInfo _marginsWhenFloating] + 184
15 UIKitCore 0x3aca4c -[_UISheetLayoutInfo _isEdgeAttached] + 52
16 UIKitCore 0x467ffc -[_UISheetLayoutInfo _reversedIndexOfLastUndimmedDetent] + 84
17 UIKitCore 0x2d713c -[_UISheetLayoutInfo _activeDetentValues] + 348
18 UIKitCore 0x24b990 -[_UISheetLayoutInfo _offsetForCurrentActiveDetent] + 48
19 UIKitCore 0x583b5c -[_UISheetLayoutInfo _frameOfPresentedViewInContainerView] + 100
20 UIKitCore 0x3cad98 -[UISheetPresentationController _containerViewLayoutSubviews] + 652
21 UIKitCore 0x2231dc -[UITransitionView layoutSubviews] + 92
22 UIKitCore 0x18c17c -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2592
23 QuartzCore 0x407fc CA::Layer::layout_if_needed(CA::Transaction*) + 532
24 QuartzCore 0x32c60 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 136
25 QuartzCore 0x475b4 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 452
26 QuartzCore 0x504a8 CA::Transaction::commit() + 704
27 QuartzCore 0x323a0 CA::Transaction::flush_as_runloop_observer(bool) + 88
28 UIKitCore 0x53e6e0 _UIApplicationFlushCATransaction + 72
29 UIKitCore 0x7d8d5c _UIUpdateSequenceRun + 84
30 UIKitCore 0xe5fedc schedulerStepScheduledMainSection + 144
31 UIKitCore 0xe5f6a4 runloopSourceCallback + 92
32 CoreFoundation 0xbb414 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
33 CoreFoundation 0xcc1a0 __CFRunLoopDoSource0 + 208
34 CoreFoundation 0x5694 __CFRunLoopDoSources0 + 268
35 CoreFoundation 0xb05c __CFRunLoopRun + 828
36 CoreFoundation 0x1ebc8 CFRunLoopRunSpecific + 600
37 GraphicsServices 0x1374 GSEventRunModal + 164
38 UIKitCore 0x514b58 -[UIApplication _run] + 1100
39 UIKitCore 0x296090 UIApplicationMain + 364
40 App. 0x72a4 main + 8 (main.m:8)
Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x2d318 __abort_with_payload + 8
1 libsystem_kernel.dylib 0x2fc24 abort_with_payload_wrapper_internal + 104
2 libsystem_kernel.dylib 0x2fbbc abort_with_payload_wrapper_internal + 30
3 libobjc.A.dylib 0x2d0b4 _objc_fatalv(unsigned long long, unsigned long long, char const*, char*) + 116
4 libobjc.A.dylib 0x2d040 _objc_fatalv(unsigned long long, unsigned long long, char const*, char*) + 30
5 libobjc.A.dylib 0x5acc weak_register_no_lock + 392
6 libobjc.A.dylib 0xa924 objc_storeWeak + 448
7 UIKitCore 0x2a2ee0 -[_UIBoundingPath initWithCoordinateSpace:] + 96
8 UIKitCore 0x613fc4 -[_UIComplexBoundingPath initWithCoordinateSpace:orientation:scale:boundingPathBitmap:] + 112
9 UIKitCore 0x3f11d0 -[_UIScreenComplexBoundingPathUtilities boundingPathForWindow:] + 2836
10 UIKitCore 0x675ddc -[UIWindow _boundingPath] + 204
11 UIKitCore 0x1b1650 -[UIView(UIViewBoundingPathSupportInternal) _effectiveBoundingPathAndBoundingPathView:] + 244
12 UIKitCore 0x4bab4c -[UIView(UIViewBoundingPathSupport) _rectTuckedAgainstBoundingPathEdge:withSize:cornerRadii:minimumPadding:] + 260
13 UIKitCore 0x6b74f8 -[_UISheetLayoutInfo _unsafeInsets] + 160
14 UIKitCore 0x71f18 -[_UISheetLayoutInfo _marginsWhenFloating] + 184
15 UIKitCore 0x3aca4c -[_UISheetLayoutInfo _isEdgeAttached] + 52
16 UIKitCore 0x467ffc -[_UISheetLayoutInfo _reversedIndexOfLastUndimmedDetent] + 84
17 UIKitCore 0x2d713c -[_UISheetLayoutInfo _activeDetentValues] + 348
18 UIKitCore 0x24b990 -[_UISheetLayoutInfo _offsetForCurrentActiveDetent] + 48
19 UIKitCore 0x583b5c -[_UISheetLayoutInfo _frameOfPresentedViewInContainerView] + 100
20 UIKitCore 0x3cad98 -[UISheetPresentationController _containerViewLayoutSubviews] + 652
21 UIKitCore 0x2231dc -[UITransitionView layoutSubviews] + 92
22 UIKitCore 0x18c17c -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2592
23 QuartzCore 0x407fc CA::Layer::layout_if_needed(CA::Transaction*) + 532
24 QuartzCore 0x32c60 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 136
25 QuartzCore 0x475b4 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 452
26 QuartzCore 0x504a8 CA::Transaction::commit() + 704
27 QuartzCore 0x323a0 CA::Transaction::flush_as_runloop_observer(bool) + 88
28 UIKitCore 0x53e6e0 _UIApplicationFlushCATransaction + 72
29 UIKitCore 0x7d8d5c _UIUpdateSequenceRun + 84
30 UIKitCore 0xe5fedc schedulerStepScheduledMainSection + 144
31 UIKitCore 0xe5f6a4 runloopSourceCallback + 92
32 CoreFoundation 0xbb414 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
33 CoreFoundation 0xcc1a0 __CFRunLoopDoSource0 + 208
34 CoreFoundation 0x5694 __CFRunLoopDoSources0 + 268
35 CoreFoundation 0xb05c __CFRunLoopRun + 828
36 CoreFoundation 0x1ebc8 CFRunLoopRunSpecific + 600
37 GraphicsServices 0x1374 GSEventRunModal + 164
38 UIKitCore 0x514b58 -[UIApplication _run] + 1100
39 UIKitCore 0x296090 UIApplicationMain + 364
40 App. 0x77f8 main + 8 (main.m:8)
41 ??? 0x105a99da4 (Missing)
my only clue is from "initWithCoordinateSpace:orientation:scale:boundingPathBitmap" If there was a corrupt http image reference could this be causing a crash somewhere?
We are also using Firebase in-app-messaging. Could this be crashing the app on startup?

Call to AudioConverterFillComplexBuffer results in CrashIfClientProvidedBogusAudioBufferList only on MacOS Sierra

I have an audio program that makes a call to AudioConverterFillComplexBuffer with the following code:
OSStatus error = AudioConverterFillComplexBuffer(recorderObj->audioConverter,
MyAudioConverterCallback,
(__bridge void *)playerLocal,
&ioOutputDataPackets,
convertedData,
&streamDesc);
When this code runs on 10.6-10.11, it works fine. When the code runs on 10.12, it crashes with the following message
Crashed Thread: 16 com.apple.audio.IOThread.client
Exception Type: EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: 0x0000000000000001, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Illegal instruction: 4
Termination Reason: Namespace SIGNAL, Code 0x4
Terminating Process: exc handler [0]
The call stack ends in CrashIfClientProvidedBogusAudioBufferList.
Most articles, documentation and mailing lists would say that I have a bad output buffer but for the life of me, I cannot tell what I would be doing wrong but still have my code work on all versions of MacOS but the latest. Here is how I am setting up the buffer:
AudioBufferList *convertedData = (AudioBufferList*)malloc(sizeof(AudioBufferList) * 2);
convertedData->mNumberBuffers = 1;
convertedData->mBuffers[0].mNumberChannels = 2;
convertedData->mBuffers[0].mDataByteSize = 64 * 1024;
convertedData->mBuffers[0].mData = (UInt8 *)malloc(sizeof(UInt8) * 64 * 1024);
Here is the full stack at the point of the crash
Thread 16 Crashed:: com.apple.audio.IOThread.client
0 com.apple.audio.toolbox.AudioToolbox 0x00007fff89b9a330 CADebuggerStop() + 4
1 com.apple.audio.toolbox.AudioToolbox 0x00007fff89a21e71 CrashIfClientProvidedBogusAudioBufferList + 97
2 com.apple.audio.toolbox.AudioToolbox 0x00007fff89a2f710 AudioConverterChain::CallInputProc(unsigned int) + 646
3 com.apple.audio.toolbox.AudioToolbox 0x00007fff89a2f386 AudioConverterChain::FillBufferFromInputProc(unsigned int*, CABufferList*) + 130
4 com.apple.audio.toolbox.AudioToolbox 0x00007fff89a2f2ee BufferedAudioConverter::GetInputBytes(unsigned int, unsigned int&, CABufferList const*&) + 178
5 com.apple.audio.toolbox.AudioToolbox 0x00007fff89a2f1b2 CBRConverter::RenderOutput(CABufferList*, unsigned int, unsigned int&, AudioStreamPacketDescription*) + 106
6 com.apple.audio.toolbox.AudioToolbox 0x00007fff89a2225d BufferedAudioConverter::FillBuffer(unsigned int&, AudioBufferList&, AudioStreamPacketDescription*) + 281
7 com.apple.audio.toolbox.AudioToolbox 0x00007fff89a2f2c3 BufferedAudioConverter::GetInputBytes(unsigned int, unsigned int&, CABufferList const*&) + 135
8 com.apple.audio.toolbox.AudioToolbox 0x00007fff89a9369b Resampler2Wrapper::RenderOutput(CABufferList*, unsigned int, unsigned int&) + 183
9 com.apple.audio.toolbox.AudioToolbox 0x00007fff89a2225d BufferedAudioConverter::FillBuffer(unsigned int&, AudioBufferList&, AudioStreamPacketDescription*) + 281
10 com.apple.audio.toolbox.AudioToolbox 0x00007fff89a2f2c3 BufferedAudioConverter::GetInputBytes(unsigned int, unsigned int&, CABufferList const*&) + 135
11 com.apple.audio.toolbox.AudioToolbox 0x00007fff89a2f1b2 CBRConverter::RenderOutput(CABufferList*, unsigned int, unsigned int&, AudioStreamPacketDescription*) + 106
12 com.apple.audio.toolbox.AudioToolbox 0x00007fff89a2225d BufferedAudioConverter::FillBuffer(unsigned int&, AudioBufferList&, AudioStreamPacketDescription*) + 281
13 com.apple.audio.toolbox.AudioToolbox 0x00007fff89a2253f AudioConverterChain::RenderOutput(CABufferList*, unsigned int, unsigned int&, AudioStreamPacketDescription*) + 99
14 com.apple.audio.toolbox.AudioToolbox 0x00007fff89a2225d BufferedAudioConverter::FillBuffer(unsigned int&, AudioBufferList&, AudioStreamPacketDescription*) + 281
15 com.apple.audio.toolbox.AudioToolbox 0x00007fff89a21d2f AudioConverterFillComplexBuffer + 282
16 com.pc-intercom.Intercom 0x0000000107a52803 0x107a4a000 + 34819
17 com.apple.audio.units.Components 0x000000010a38c97c AUHAL::AUIOProc(unsigned int, AudioTimeStamp const*, AudioBufferList const*, AudioTimeStamp const*, AudioBufferList*, AudioTimeStamp const*, void*) + 2324
18 com.apple.audio.CoreAudio 0x00007fff8a71f951 HALC_ProxyIOContext::IOWorkLoop() + 4369
19 com.apple.audio.CoreAudio 0x00007fff8a71e667 HALC_ProxyIOContext::IOThreadEntry(void*) + 131
20 com.apple.audio.CoreAudio 0x00007fff8a71e38b HALB_IOThread::Entry(void*) + 75
21 libsystem_pthread.dylib 0x0000000108134aab _pthread_body + 180
22 libsystem_pthread.dylib 0x00000001081349f7 _pthread_start + 286
23 libsystem_pthread.dylib 0x0000000108134221 thread_start + 13
If anyone has any suggestions on how I can debug this issue, I would greatly appreciate the help.
In MyAudioConverterCallback, ioDataPacketCount is supposed to return frames for LPCM (I guess packets are frames for uncompressed audio), so set it to:
*ioDataPacketCount = recorderObj->inputBuffer->mBuffers[0].mDataByteSize/recorderObj->streamFormat.mBytesPerFrame;
Pass a NULL AudioStreamPacketDescription to AudioConverterFillComplexBuffer instead of an array of 1 (this was causing crashes for me on 10.11). Your destination format is LPCM, so packet descriptions are unnecessary because your "packets" are all the same size.
Similarly, your source format is LPCM too, so you can remove the code that returns packet descriptions in MyAudioConverterCallback - it's also wrong.
On my machine, I get non-interleaved stereo for streamFormat which means MyAudioConverterCallback has to fill out ioData->mBuffers[1] too.
When setting up your convertedData AudioBufferList, sizePerPacket was using the source format packet size instead of the destination packet size. It should be:
sizePerPacket = mOutputFormat.mBytesPerPacket;
And finally, even when it's not crashing, this code can't be right because you're recording (say) 512 frames from the microphone, then asking the audio converter to convert 16384 - that's going to give you audio glitches.
The callback is given an audio buffer list pointed to by ioData. This
buffer list may refer to existing buffers owned and allocated by the
audio converter, in which case the callback may use them and copy
input audio data into them. However, the buffer list may also be
empty (mDataByteSize == 0 and/or mData == NULL), in which case the
callback must provide its own buffers. The callback manipulates the
members of ioData to point to one or more buffers of audio data
(multiple buffers are used with non-interleaved PCM data). The
callback is responsible for not freeing or altering this buffer until
it is called again.
In the AudioConverterComplexInputDataProc callback, When I try to return a ioData with it's mBuffers[0].mData == NULL, I got this crash.

XCode7.3 keep crash when I enable breakpoint to debug

It will not crash when I debug without breakpoint, once enable a breakpoint, XCode will debug to that line of code, then immediately crash。
It crash at thread 22 as bellow:
Thread 22 Crashed:: <DBGLLDBSessionThread (pid=838)> Dispatch queue: DVTInvalidationPreventionQueue
0 com.apple.LLDB.framework 0x0000000118e3d986 clang::ASTContext::getFunctionType(clang::QualType, llvm::ArrayRef<clang::QualType>, clang::FunctionProtoType::ExtProtoInfo const&) const + 294
1 com.apple.LLDB.framework 0x000000011a139964 lldb_private::ClangASTContext::CreateFunctionType(clang::ASTContext*, lldb_private::CompilerType const&, lldb_private::CompilerType const*, unsigned int, bool, unsigned int) + 542
2 com.apple.LLDB.framework 0x0000000119fb290a DWARFASTParserClang::ParseTypeFromDWARF(lldb_private::SymbolContext const&, DWARFDIE const&, lldb_private::Log*, bool*) + 9830
3 com.apple.LLDB.framework 0x000000011a120e68 SymbolFileDWARF::ParseType(lldb_private::SymbolContext const&, DWARFDIE const&, bool*) + 184
4 com.apple.LLDB.framework 0x000000011a11b108 SymbolFileDWARF::GetTypeForDIE(DWARFDIE const&, bool) + 368
5 com.apple.LLDB.framework 0x000000011a11ab21 SymbolFileDWARF::ResolveType(DWARFDIE const&, bool, bool) + 129
6 com.apple.LLDB.framework 0x0000000119fb7ff9 DWARFASTParserClang::CompleteTypeFromDWARF(DWARFDIE const&, lldb_private::Type*, lldb_private::CompilerType&) + 1165
7 com.apple.LLDB.framework 0x000000011a11aedc SymbolFileDWARF::CompleteType(lldb_private::CompilerType&) + 628
8 com.apple.LLDB.framework 0x000000011a1a59cb lldb_private::Type::ResolveClangType(lldb_private::Type::ResolveStateTag) + 1483
9 com.apple.LLDB.framework 0x000000011a1a5c74 lldb_private::Type::GetFullCompilerType() + 26
10 com.apple.LLDB.framework 0x000000011a0007da lldb_private::ValueObject::MaybeCalculateCompleteType() + 352
11 com.apple.LLDB.framework 0x000000011a000568 lldb_private::ValueObject::GetCompilerType() + 18
12 com.apple.LLDB.framework 0x000000011a1c680a lldb_private::Process::IsPossibleDynamicValue(lldb_private::ValueObject&) + 64
13 com.apple.LLDB.framework 0x000000011a005bca lldb_private::ValueObject::CalculateDynamicValue(lldb::DynamicValueType) + 90
14 com.apple.LLDB.framework 0x000000011a005c6f lldb_private::ValueObject::GetDynamicValue(lldb::DynamicValueType) + 65
15 com.apple.LLDB.framework 0x0000000117ff51dd ValueImpl::GetSP(lldb_private::ProcessRunLock::ProcessRunLocker&, lldb_private::Mutex::Locker&, lldb_private::Error&) + 243
16 com.apple.LLDB.framework 0x0000000117fef90a lldb::SBValue::GetSP(ValueLocker&) const + 58
17 com.apple.LLDB.framework 0x0000000117fef9f9 lldb::SBValue::GetName() + 41
18 com.apple.dt.dbg.DebuggerLLDB 0x0000000117f3ad75 -[DBGLLDBDataValue initWithLLDBValueObject:forStackFrame:withParent:updateSummary:] + 234
19 com.apple.dt.dbg.DebuggerLLDB 0x0000000117f3ac29 -[DBGLLDBDataValue initWithLLDBValueObject:forStackFrame:withParent:] + 92
20 com.apple.dt.dbg.DebuggerLLDB 0x0000000117f38370 -[DBGLLDBStackFrame _findSymbolWithName:symbolKind:atLocation:] + 1070
21 com.apple.dt.dbg.DebuggerLLDB 0x0000000117f38748 __93-[DBGLLDBStackFrame requestDataValueForSymbol:symbolKind:atLocation:onQueue:withResultBlock:]_block_invoke + 60
22 com.apple.dt.DVTFoundation 0x000000010d08dfb4 ___DVTPreventInvalidationForObjectAllowingRecursiveCallsDuringBlock_block_invoke_2 + 49
23 libdispatch.dylib 0x00007fff8491b40b _dispatch_client_callout + 8
24 libdispatch.dylib 0x00007fff8492c5a4 _dispatch_sync_f_invoke + 56
25 com.apple.dt.DVTFoundation 0x000000010d08df54 ___DVTPreventInvalidationForObjectAllowingRecursiveCallsDuringBlock_block_invoke + 150
26 libdispatch.dylib 0x00007fff8491b40b _dispatch_client_callout + 8
27 libdispatch.dylib 0x00007fff8492c5a4 _dispatch_sync_f_invoke + 56
28 com.apple.dt.DVTFoundation 0x000000010d08dda3 _DVTPreventInvalidationForObjectAllowingRecursiveCallsDuringBlock + 383
29 com.apple.dt.DVTFoundation 0x000000010d08e10d _DVTPreventInvalidationAllowingRecursiveCallsDuringBlock + 35
30 com.apple.dt.dbg.DebuggerLLDB 0x0000000117f37b80 __45-[DBGLLDBStackFrame _addSessionThreadAction:]_block_invoke + 108
31 com.apple.dt.dbg.DebuggerLLDB 0x0000000117f50755 -[DBGLLDBSession handleNextActionWithState:withRunPending:] + 457
32 com.apple.dt.dbg.DebuggerLLDB 0x0000000117f4aca5 DBGLLDBSessionThread(void*) + 2089
33 libsystem_pthread.dylib 0x00007fff8dc4599d _pthread_body + 131
34 libsystem_pthread.dylib 0x00007fff8dc4591a _pthread_start + 168
35 libsystem_pthread.dylib 0x00007fff8dc43351 thread_start + 13
Thread 22 crashed with X86 Thread State (64-bit):
Include a setting CLANG_ENABLE_MODULE_DEBUGGING = NO stopped the crash for me.

How to debug crash during spritekit rendering?

I'm making an IOS game using spritekit, and also integrated crashlytics for error reporting. I'm receiving the following error report periodically, and I'm unable to reproduce it, and unsure how to even start going about finding the problem. Any ideas would be greatly appreciated.
Thread : Crashed: com.apple.spritekit.renderQueue
0 SpriteKit 0x2faed240 SKCShapeSprite::_NEW_copyRenderPathData(SKRenderQuad*, bool) const + 711
1 ??? 0x0061b9d0
2 SpriteKit 0x2fb12d09 SKCShapeSprite::copyRenderPathData(SKRenderQuad*, bool) + 40
3 SpriteKit 0x2fb0fdbd SKCRenderer::preprocessSpriteImp(std::__1::vector<SKCRenderer::SpriteRenderInfo, std::__1::allocator<SKCRenderer::SpriteRenderInfo> >&, SKRenderQuadPool&, SKCSprite const*, _GLKMatrix4 const&, float, unsigned int&, bool) + 428
4 SpriteKit 0x2fb10987 SKCRenderer::preprocessSpriteImp(std::__1::vector<SKCRenderer::SpriteRenderInfo, std::__1::allocator<SKCRenderer::SpriteRenderInfo> >&, SKRenderQuadPool&, SKCSprite const*, _GLKMatrix4 const&, float, unsigned int&, bool) + 3446
5 SpriteKit 0x2fb10987 SKCRenderer::preprocessSpriteImp(std::__1::vector<SKCRenderer::SpriteRenderInfo, std::__1::allocator<SKCRenderer::SpriteRenderInfo> >&, SKRenderQuadPool&, SKCSprite const*, _GLKMatrix4 const&, float, unsigned int&, bool) + 3446
6 SpriteKit 0x2fb0b0d7 SKCRenderer::preprocessAndSubmitSpriteInternal(std::__1::vector<SKCRenderer::SpriteRenderInfo const*, std::__1::allocator<SKCRenderer::SpriteRenderInfo const*> >&, std::__1::vector<SKCRenderer::SpriteRenderInfo, std::__1::allocator<SKCRenderer::SpriteRenderInfo> >&, SKRenderQuadPool&, SKCSprite const*, _GLKMatrix4 const&) + 94
7 SpriteKit 0x2fb0f94f SKCRenderer::preprocessAndSubmitSprite(SKCSprite const*, _GLKMatrix4 const&) + 154
8 SpriteKit 0x2fb0da69 SKCRenderer::submitScene(SKScene*, bool) + 524
9 SpriteKit 0x2fb11ba9 SKCRenderer::renderScene(SKScene*, bool) + 152
10 SpriteKit 0x2faa95f7 -[SKView _renderContent] + 1102
11 libdispatch.dylib 0x3a3758b7 _dispatch_client_callout + 22
12 libdispatch.dylib 0x3a37cb69 _dispatch_barrier_sync_f_invoke + 48
13 SpriteKit 0x2faa917b -[SKView renderContent] + 82
14 SpriteKit 0x2faa5f15 __29-[SKView setUpRenderCallback]_block_invoke + 116
15 SpriteKit 0x2fad7509 -[SKDisplayLink _callbackForNextFrame:] + 248
16 QuartzCore 0x2f679aa3 CA::Display::DisplayLinkItem::dispatch() + 98
17 QuartzCore 0x2f67990b CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 366
18 IOMobileFramebuffer 0x33f2e82b IOMobileFramebufferVsyncNotifyFunc + 90
19 IOKit 0x2d68c801 IODispatchCalloutFromCFMessage + 256
20 CoreFoundation 0x2c71d8e5 __CFMachPortPerform + 132
21 CoreFoundation 0x2c72ddab __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
22 CoreFoundation 0x2c72dd47 __CFRunLoopDoSource1 + 346
23 CoreFoundation 0x2c72c349 __CFRunLoopRun + 1608
24 CoreFoundation 0x2c67a621 CFRunLoopRunSpecific + 476
25 CoreFoundation 0x2c67a433 CFRunLoopRunInMode + 106
26 GraphicsServices 0x33a290a9 GSEventRunModal + 136
27 UIKit 0x2fc65359 UIApplicationMain + 1440