Hi Jules,
I was a little unspecific in the ‘latest Juce.plugin…’-Thread.
The demo plugin crashes as well as my plugin when more GUIs (sometimes only three) are closed fast by clicking on the close button. This won’t happen when the GUIs are closed from Cubase (by closing the project or quiting Cubase, version is 5.5) and it also dosn’t happen in Reaper. Juce is the current tip.
When run from the debugger only the exception type (GDB: Program received signal EXC_BAD_ACCESS) is given. Sometimes the debug console tells about a stop in juce_VST_wrapper.cpp at line 1110 (jassert (! recursionCheck);), but I can’t reproduce this.
A delay (usleep(20000);) inside the editor’s destructor helps a bit but doesn’t solve this. When more plugins are open it still crashes quite fast. I’m also not sure whether the stop in juce-VST_wrapper.cpp happend too without the delay.
The crash-log is:
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000027
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Application Specific Information:
objc_msgSend() selector name: release
Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x9643eed7 objc_msgSend + 23
1 com.steinberg.cubase 0x015b5a06 CResampleBase::~CResampleBase() + 3836742
2 com.steinberg.cubase 0x01635e71 CResampleBase::~CResampleBase() + 4362161
3 com.steinberg.cubase 0x014c82fb CResampleBase::~CResampleBase() + 2864187
4 com.steinberg.cubase 0x014c24f8 CResampleBase::~CResampleBase() + 2840120
5 com.steinberg.cubase 0x015b9dbb CResampleBase::~CResampleBase() + 3854075
6 com.steinberg.cubase 0x015bb318 CResampleBase::~CResampleBase() + 3859544
7 com.apple.HIToolbox 0x924b0f2f DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1567
8 com.apple.HIToolbox 0x924b01f6 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 411
9 com.apple.HIToolbox 0x924d29bb SendEventToEventTarget + 52
10 com.apple.HIToolbox 0x925cfe4f HIWindowButtonView::SendWindowEvent(unsigned long, unsigned long) + 207
11 com.apple.HIToolbox 0x925cff00 HIWindowButtonView::ControlHitSelf(OpaqueControlRef*, short, unsigned long) + 156
12 com.apple.HIToolbox 0x924c57a3 HIView::EventHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 9309
13 com.apple.HIToolbox 0x924b0f2f DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1567
14 com.apple.HIToolbox 0x924b01f6 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 411
15 com.apple.HIToolbox 0x924d29bb SendEventToEventTarget + 52
16 com.apple.HIToolbox 0x92521e56 SendControlHit(HIView*, OpaqueEventRef*, short, unsigned long) + 296
17 com.apple.HIToolbox 0x92521cd7 HIView::NotifyControlHit(OpaqueEventRef*, short, unsigned long) + 45
18 com.apple.HIToolbox 0x925866fb HIView::ClickInternal(CGPoint const&, unsigned long, void (*)(OpaqueControlRef*, short), OpaqueEventRef*, bool) + 245
19 com.apple.HIToolbox 0x92587cb4 HIView::ClickSelf(OpaqueEventRef*) + 368
20 com.apple.HIToolbox 0x924c3c81 HIView::EventHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 2363
21 com.apple.HIToolbox 0x924b0f2f DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1567
22 com.apple.HIToolbox 0x924b01f6 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 411
23 com.apple.HIToolbox 0x924d29bb SendEventToEventTarget + 52
24 com.apple.HIToolbox 0x92520d26 HIView::Click(OpaqueEventRef*) + 480
25 com.apple.HIToolbox 0x92520af3 HandleClickAsHIView(OpaqueWindowPtr*, OpaqueEventRef*) + 151
26 com.apple.HIToolbox 0x9251f3d0 HandleWindowClick(OpaqueWindowPtr*, Point, short, unsigned long, OpaqueEventRef*) + 491
27 com.apple.HIToolbox 0x9251eed3 HandleMouseEvent(OpaqueEventHandlerCallRef*, OpaqueEventRef*) + 786
28 com.apple.HIToolbox 0x9251e7de StandardWindowEventHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 93
29 com.apple.HIToolbox 0x924b0f2f DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1567
30 com.apple.HIToolbox 0x924b01f6 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 411
31 com.apple.HIToolbox 0x9251d441 CallNextEventHandler + 95
32 com.steinberg.cubase 0x015b8e06 CResampleBase::~CResampleBase() + 3850054
33 com.steinberg.cubase 0x015bb318 CResampleBase::~CResampleBase() + 3859544
34 com.apple.HIToolbox 0x924b0f2f DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1567
35 com.apple.HIToolbox 0x924b01f6 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 411
36 com.apple.HIToolbox 0x924d29bb SendEventToEventTarget + 52
37 com.apple.HIToolbox 0x924e457b ToolboxEventDispatcherHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 1417
38 com.apple.HIToolbox 0x924b1380 DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 2672
39 com.apple.HIToolbox 0x924b01f6 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 411
40 com.apple.HIToolbox 0x9251d441 CallNextEventHandler + 95
41 com.steinberg.cubase 0x015e7a8a CResampleBase::~CResampleBase() + 4041674
42 com.apple.HIToolbox 0x924b0f2f DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1567
43 com.apple.HIToolbox 0x924b01f6 SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 411
44 com.apple.HIToolbox 0x924d29bb SendEventToEventTarget + 52
45 com.apple.AppKit 0x981cf3fa -[NSCarbonWindow sendEvent:] + 151
46 com.apple.AppKit 0x97f2eaff -[NSApplication sendEvent:] + 6431
47 com.steinberg.cubase 0x015dbc04 CResampleBase::~CResampleBase() + 3992900
48 com.apple.AppKit 0x97ec25bb -[NSApplication run] + 917
49 com.steinberg.cubase 0x015dd590 CResampleBase::~CResampleBase() + 3999440
50 com.steinberg.cubase 0x0135a409 CResampleBase::~CResampleBase() + 1365321
51 com.steinberg.cubase 0x0130b760 CResampleBase::~CResampleBase() + 1042592
52 com.steinberg.cubase 0x00c8603f 0x1000 + 13127743
53 com.steinberg.cubase 0x0102cb40 0x1000 + 16956224
54 com.steinberg.cubase 0x000028e6 0x1000 + 6374
Thread 1: Dispatch queue: com.apple.libdispatch-manager
0 libSystem.B.dylib 0x99312942 kevent + 10
1 libSystem.B.dylib 0x9931305c _dispatch_mgr_invoke + 215
2 libSystem.B.dylib 0x99312519 _dispatch_queue_invoke + 163
3 libSystem.B.dylib 0x993122be _dispatch_worker_thread2 + 240
4 libSystem.B.dylib 0x99311d41 _pthread_wqthread + 390
5 libSystem.B.dylib 0x99311b86 start_wqthread + 30
Thread 2:
0 libSystem.B.dylib 0x993119d2 __workq_kernreturn + 10
1 libSystem.B.dylib 0x99311f68 _pthread_wqthread + 941
2 libSystem.B.dylib 0x99311b86 start_wqthread + 30
Thread 3: FThread
0 libSystem.B.dylib 0x992ec14e semaphore_timedwait_trap + 10
1 com.steinberg.cubase 0x016463ea CResampleBase::~CResampleBase() + 4429098
2 com.steinberg.cubase 0x0064126e 0x1000 + 6554222
3 libSystem.B.dylib 0x993e1af2 _pthread_body + 27
Thread 4:
0 libSystem.B.dylib 0x992ec0fa mach_msg_trap + 10
1 libSystem.B.dylib 0x992ec867 mach_msg + 68
2 com.apple.audio.midi.CoreMIDI 0x02187f31 XServerMachPort::ReceiveMessage(int&, void*, int&) + 155
3 com.apple.audio.midi.CoreMIDI 0x021a68fe MIDIProcess::RunMIDIInThread() + 150
4 com.apple.audio.midi.CoreMIDI 0x02189149 XThread::RunHelper(void*) + 17
5 com.apple.audio.midi.CoreMIDI 0x02188b16 CAPThread::Entry(CAPThread*) + 96
6 libSystem.B.dylib 0x9931981d _pthread_start + 345
7 libSystem.B.dylib 0x993196a2 thread_start + 34
Thread 5:
0 libSystem.B.dylib 0x992ec20e mach_wait_until + 10
1 ...ple.CoreServices.CarbonCore 0x90ef1a18 MPDelayUntil + 43
2 ...ple.CoreServices.CarbonCore 0x90f0143e Delay + 107
3 ...opellerheads.rewire.library 0x1b4577e8 RWPUnregisterDeviceImp + 21574
4 ...opellerheads.rewire.library 0x1b472a5c RWPUnregisterDeviceImp + 132794
5 libSystem.B.dylib 0x9931981d _pthread_start + 345
6 libSystem.B.dylib 0x993196a2 thread_start + 34
Thread 6: VST Loader
0 libSystem.B.dylib 0x992ec142 semaphore_wait_signal_trap + 10
1 com.steinberg.cubase 0x015ec382 CResampleBase::~CResampleBase() + 4060354
2 com.steinberg.cubase 0x00cb39e8 0x1000 + 13314536
3 libSystem.B.dylib 0x993e1af2 _pthread_body + 27
Thread 7: VST Loader
0 libSystem.B.dylib 0x992ec142 semaphore_wait_signal_trap + 10
1 com.steinberg.cubase 0x015ec382 CResampleBase::~CResampleBase() + 4060354
2 com.steinberg.cubase 0x00cb39e8 0x1000 + 13314536
3 libSystem.B.dylib 0x993e1af2 _pthread_body + 27
Thread 8: VST Loader
0 libSystem.B.dylib 0x992ec142 semaphore_wait_signal_trap + 10
1 com.steinberg.cubase 0x015ec382 CResampleBase::~CResampleBase() + 4060354
2 com.steinberg.cubase 0x00cb39e8 0x1000 + 13314536
3 libSystem.B.dylib 0x993e1af2 _pthread_body + 27
Thread 9: VST Loader
0 libSystem.B.dylib 0x992ec142 semaphore_wait_signal_trap + 10
1 com.steinberg.cubase 0x015ec382 CResampleBase::~CResampleBase() + 4060354
2 com.steinberg.cubase 0x00cb39e8 0x1000 + 13314536
3 libSystem.B.dylib 0x993e1af2 _pthread_body + 27
Thread 10: VST Loader
0 libSystem.B.dylib 0x992ec142 semaphore_wait_signal_trap + 10
1 com.steinberg.cubase 0x015ec382 CResampleBase::~CResampleBase() + 4060354
2 com.steinberg.cubase 0x00cb39e8 0x1000 + 13314536
3 libSystem.B.dylib 0x993e1af2 _pthread_body + 27
Thread 11: VST Loader
0 libSystem.B.dylib 0x992ec142 semaphore_wait_signal_trap + 10
1 com.steinberg.cubase 0x015ec382 CResampleBase::~CResampleBase() + 4060354
2 com.steinberg.cubase 0x00cb39e8 0x1000 + 13314536
3 libSystem.B.dylib 0x993e1af2 _pthread_body + 27
Thread 12: VST Preloader
0 libSystem.B.dylib 0x992ec14e semaphore_timedwait_trap + 10
1 com.steinberg.cubase 0x01646e36 CResampleBase::~CResampleBase() + 4431734
2 com.steinberg.cubase 0x00cb4933 0x1000 + 13318451
3 com.steinberg.cubase 0x00cb4ae8 0x1000 + 13318888
4 libSystem.B.dylib 0x993e1af2 _pthread_body + 27
Thread 13: Timer
0 libSystem.B.dylib 0x992ec14e semaphore_timedwait_trap + 10
1 com.steinberg.cubase 0x01646e36 CResampleBase::~CResampleBase() + 4431734
2 com.steinberg.cubase 0x00a6bbe1 0x1000 + 10922977
3 libSystem.B.dylib 0x993e1af2 _pthread_body + 27
Thread 14: Video Performer
0 libSystem.B.dylib 0x992ec136 semaphore_wait_trap + 10
1 com.steinberg.videoengine 0x1b3c239b GetPluginFactory + 112939
2 com.steinberg.videoengine 0x1b3e0479 GetPluginFactory + 236041
3 libSystem.B.dylib 0x993e1af2 _pthread_body + 27
Thread 15:
0 libSystem.B.dylib 0x992ec136 semaphore_wait_trap + 10
1 com.ableton.live-engine 0x25804af0 0x25800000 + 19184
2 com.ableton.live-engine 0x25818e26 0x25800000 + 101926
3 com.ableton.live-engine 0x25805f45 0x25800000 + 24389
4 libSystem.B.dylib 0x9931981d _pthread_start + 345
5 libSystem.B.dylib 0x993196a2 thread_start + 34
Thread 16: filesystem urgent scanner
0 libSystem.B.dylib 0x992ec142 semaphore_wait_signal_trap + 10
1 libSystem.B.dylib 0x99319cbc _pthread_cond_wait + 1089
2 libSystem.B.dylib 0x99362203 pthread_cond_wait + 48
3 com.steinberg.cubase 0x0164656c CResampleBase::~CResampleBase() + 4429484
4 com.steinberg.cubase 0x01267104 CResampleBase::~CResampleBase() + 369220
5 libSystem.B.dylib 0x993e1af2 _pthread_body + 27
Thread 17: mediabase writer
0 libSystem.B.dylib 0x992ec142 semaphore_wait_signal_trap + 10
1 libSystem.B.dylib 0x99319cbc _pthread_cond_wait + 1089
2 libSystem.B.dylib 0x99362203 pthread_cond_wait + 48
3 com.steinberg.cubase 0x0164656c CResampleBase::~CResampleBase() + 4429484
4 com.steinberg.cubase 0x00cf8c88 0x1000 + 13597832
5 libSystem.B.dylib 0x993e1af2 _pthread_body + 27
Thread 18: Worker Thread
0 libSystem.B.dylib 0x992ec142 semaphore_wait_signal_trap + 10
1 libSystem.B.dylib 0x99319cbc _pthread_cond_wait + 1089
2 libSystem.B.dylib 0x99362203 pthread_cond_wait + 48
3 com.steinberg.cubase 0x0164656c CResampleBase::~CResampleBase() + 4429484
4 com.steinberg.cubase 0x01267104 CResampleBase::~CResampleBase() + 369220
5 libSystem.B.dylib 0x993e1af2 _pthread_body + 27
Thread 19: Video Diascope
0 libSystem.B.dylib 0x992ec136 semaphore_wait_trap + 10
1 com.steinberg.videoengine 0x1b3c239b GetPluginFactory + 112939
2 com.steinberg.videoengine 0x1b414153 GetPluginFactory + 448227
3 libSystem.B.dylib 0x993e1af2 _pthread_body + 27
Thread 20:
0 libSystem.B.dylib 0x993119d2 __workq_kernreturn + 10
1 libSystem.B.dylib 0x99311f68 _pthread_wqthread + 941
2 libSystem.B.dylib 0x99311b86 start_wqthread + 30
Thread 21:
0 libSystem.B.dylib 0x993119d2 __workq_kernreturn + 10
1 libSystem.B.dylib 0x99311f68 _pthread_wqthread + 941
2 libSystem.B.dylib 0x99311b86 start_wqthread + 30
Thread 22:
0 libSystem.B.dylib 0x9931a066 __semwait_signal + 10
1 libSystem.B.dylib 0x99319d22 _pthread_cond_wait + 1191
2 libSystem.B.dylib 0x99319875 pthread_cond_timedwait$UNIX2003 + 72
3 ...rialsoftware.JuceDemoPlugin 0x1b005401 juce::WaitableEventImpl::wait(int) + 175
4 ...rialsoftware.JuceDemoPlugin 0x1afd5320 juce::WaitableEvent::wait(int) const + 26
5 ...rialsoftware.JuceDemoPlugin 0x1ae6798d juce::Thread::wait(int) const + 27
6 ...rialsoftware.JuceDemoPlugin 0x1af1d701 juce::InternalTimerThread::run() + 349
7 ...rialsoftware.JuceDemoPlugin 0x1ae67c8b juce::Thread::threadEntryPoint(juce::Thread*) + 167
8 ...rialsoftware.JuceDemoPlugin 0x1afe6596 juce::threadEntryProc(void*) + 40
9 libSystem.B.dylib 0x9931981d _pthread_start + 345
10 libSystem.B.dylib 0x993196a2 thread_start + 34
Thread 23: Baios Processing Thread
0 libSystem.B.dylib 0x992ec136 semaphore_wait_trap + 10
1 com.steinberg.baios 0x14c8f54b bundleEntry + 165995
2 com.steinberg.baios 0x14c75cd3 bundleEntry + 61427
3 libSystem.B.dylib 0x993e1af2 _pthread_body + 27
Thread 24:
0 libSystem.B.dylib 0x992ec15a semaphore_timedwait_signal_trap + 10
1 libSystem.B.dylib 0x99319ca5 _pthread_cond_wait + 1066
2 libSystem.B.dylib 0x99348848 pthread_cond_timedwait_relative_np + 47
3 com.apple.audio.CoreAudio 0x9655e805 CAGuard::WaitFor(unsigned long long) + 219
4 com.apple.audio.CoreAudio 0x96561837 CAGuard::WaitUntil(unsigned long long) + 289
5 com.apple.audio.CoreAudio 0x9655f134 HP_IOThread::WorkLoop() + 1892
6 com.apple.audio.CoreAudio 0x9655e9cb HP_IOThread::ThreadEntry(HP_IOThread*) + 17
7 com.apple.audio.CoreAudio 0x9655e8e2 CAPThread::Entry(CAPThread*) + 140
8 libSystem.B.dylib 0x9931981d _pthread_start + 345
9 libSystem.B.dylib 0x993196a2 thread_start + 34
Thread 25:
0 libSystem.B.dylib 0x992ec15a semaphore_timedwait_signal_trap + 10
1 libSystem.B.dylib 0x99319ca5 _pthread_cond_wait + 1066
2 libSystem.B.dylib 0x99348848 pthread_cond_timedwait_relative_np + 47
3 com.apple.audio.CoreAudio 0x9655e805 CAGuard::WaitFor(unsigned long long) + 219
4 com.apple.audio.CoreAudio 0x96561837 CAGuard::WaitUntil(unsigned long long) + 289
5 com.apple.audio.CoreAudio 0x9655f134 HP_IOThread::WorkLoop() + 1892
6 com.apple.audio.CoreAudio 0x9655e9cb HP_IOThread::ThreadEntry(HP_IOThread*) + 17
7 com.apple.audio.CoreAudio 0x9655e8e2 CAPThread::Entry(CAPThread*) + 140
8 libSystem.B.dylib 0x9931981d _pthread_start + 345
9 libSystem.B.dylib 0x993196a2 thread_start + 34
Thread 26: ASIOX Thread
0 libSystem.B.dylib 0x992ec136 semaphore_wait_trap + 10
1 com.steinberg.CoreAudio2ASIO 0x173a0d0b GetPluginFactory + 78251
2 com.steinberg.CoreAudio2ASIO 0x173983e3 GetPluginFactory + 43139
3 libSystem.B.dylib 0x993e1af2 _pthread_body + 27
Thread 27: Vst Audio Process Thread
0 libSystem.B.dylib 0x992ec142 semaphore_wait_signal_trap + 10
1 com.steinberg.cubase 0x015ecb98 CResampleBase::~CResampleBase() + 4062424
2 com.steinberg.cubase 0x00affc90 0x1000 + 11529360
3 com.steinberg.cubase 0x00b00757 0x1000 + 11532119
4 libSystem.B.dylib 0x993e1af2 _pthread_body + 27
(In the other thread often only the first 10 items where shown; is this sufficient? )
Chris