Crash on shutdown... midi thread?


#1

[code]Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x000000003f000000
Crashed Thread: 0

Thread 0 Crashed:
0 libSystem.B.dylib 0xffff01a4 __atomic_add32 + 4 (cpu_capabilities.h:230)
1 libSystem.B.dylib 0x92c30dbc __cxa_finalize + 241
2 libSystem.B.dylib 0x92c30cb0 exit + 33
3 com.mycompany.MyApp 0x00002c93 _start + 217
4 com.mycompany.MyApp 0x00002bb9 start + 41

Thread 1:
0 libSystem.B.dylib 0x92c08286 mach_msg_trap + 10
1 libSystem.B.dylib 0x92c0fa7c mach_msg + 72
2 com.apple.audio.midi.CoreMIDI 0x02e02f0f XServerMachPort::ReceiveMessage(int&, void*, int&) + 101
3 com.apple.audio.midi.CoreMIDI 0x02df5477 MIDIInPortThread::Run() + 111
4 com.apple.audio.midi.CoreMIDI 0x02df907d XThread::RunHelper(void*) + 17
5 com.apple.audio.midi.CoreMIDI 0x02e039ee CAPThread::Entry(CAPThread*) + 96
6 libSystem.B.dylib 0x92c39155 _pthread_start + 321
7 libSystem.B.dylib 0x92c39012 thread_start + 34

Thread 0 crashed with X86 Thread State (32-bit):
eax: 0xffffffff ebx: 0x0025ab3c ecx: 0xffffffff edx: 0x3f000000
edi: 0x00000015 esi: 0x029c6e88 ebp: 0xbffffad8 esp: 0xbffffab8
ss: 0x0000001f efl: 0x00010286 eip: 0xffff01a4 cs: 0x00000017
ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037
cr2: 0x3f000000

Binary Images:
0x1000 - 0x555fe7 +com.mycompany.MyApp (1.0) <310ec246caf709d62cc4a714e6bf0ad3> /Applications/My-App.app/Contents/MacOS/My-App
0x2df1000 - 0x2e0eff7 com.apple.audio.midi.CoreMIDI 1.6.1 (42) /System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI[/code]

etc…

I haven’t had much time to investigate… wondering if anyone has seen this. I do add a midiInputCallback to the device manager in one of my classes which is derived from juce::Thread, and I don’t actively remove it… possibly related? I think I tried removing the callback in the classes destructor, but that probably corrupted the callback list. I’ll post more info when I have a chance to debug it some more. Thx.