Stack trace shows MessageManagerLock, etc… in one thread, and juce::Component::removeFromDesktop(), etc… in another thread.
The DemoOpenGLCanvas destructor calls the detach() method of OpenGLContext. Shouldn’t that prevent this problem?
[code]Date/Time: 2012-09-13 11:44:11 -0700
OS Version: 10.6.8 (Build 10K549)
Architecture: x86_64
Report Version: 7
Command: Plugin Host
Path: /Users/scottawardle/Library/Developer/Xcode/DerivedData/Plugin_Host-ejxmhciwyhrzridkvciuthmpzvci/Build/Products/Release/PluginHost.app/Contents/MacOS/Plugin Host
Version: 1.0.0 (1.0.0)
Parent: launchd [202]
PID: 5902
Event: hang
Duration: 5.48s (sampling started after 2 seconds)
Steps: 14 (100ms sampling interval)
Pageins: 0
Pageouts: 0
Process: Plugin Host [5902]
Path: /Users/scottawardle/Library/Developer/Xcode/DerivedData/Plugin_Host-ejxmhciwyhrzridkvciuthmpzvci/Build/Products/Release/PluginHost.app/Contents/MacOS/Plugin Host
UID: 501
Thread 35ed1 DispatchQueue 100
User stack:
14 ??? (in Plugin Host + 5589) [0x25d5]
14 ??? (in Plugin Host + 1510560) [0x171ca0]
14 ??? (in Plugin Host + 1510245) [0x171b65]
14 ??? (in Plugin Host + 623870) [0x994fe]
14 -[NSApplication run] + 821 (in AppKit) [0x9a2421f3]
14 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 156 (in AppKit) [0x9a27fdd6]
14 _DPSNextEvent + 847 (in AppKit) [0x9a280595]
14 BlockUntilNextEventMatchingListInMode + 81 (in HIToolbox) [0x9599fa3e]
14 ReceiveNextEventCommon + 158 (in HIToolbox) [0x9599faf5]
14 RunCurrentEventLoopInMode + 392 (in HIToolbox) [0x9599fe04]
14 CFRunLoopRunInMode + 97 (in CoreFoundation) [0x92d3d1f1]
14 CFRunLoopRunSpecific + 452 (in CoreFoundation) [0x92d3d3c4]
14 __CFRunLoopRun + 1071 (in CoreFoundation) [0x92d3deef]
14 __CFRunLoopDoSources0 + 1201 (in CoreFoundation) [0x92d402c1]
14 __NSThreadPerformPerform + 506 (in Foundation) [0x90740671]
14 ??? (in Plugin Host + 1516203) [0x1732ab]
14 ??? (in Plugin Host + 1527971) [0x1760a3]
14 ??? (in Plugin Host + 1527790) [0x175fee]
14 ??? (in Plugin Host + 1485073) [0x16b911]
14 ??? (in Plugin Host + 1119726) [0x1125ee]
14 ??? (in Plugin Host + 1548101) [0x17af45]
14 ??? (in Plugin Host + 1693216) [0x19e620]
14 ??? (in Plugin Host + 1693637) [0x19e7c5]
14 ??? (in Plugin Host + 1104474) [0x10ea5a]
14 ??? (in Plugin Host + 1130732) [0x1150ec]
14 ??? (in Plugin Host + 1128053) [0x114675]
14 ??? (in Plugin Host + 1548566) [0x17b116]
14 ??? (in Plugin Host + 1609386) [0x189eaa]
14 ??? (in Plugin Host + 14671) [0x494f]
14 ??? (in Plugin Host + 14740) [0x4994]
14 ??? (in Plugin Host + 1264181) [0x135a35]
14 ??? (in Plugin Host + 1545954) [0x17a6e2]
14 ??? (in Plugin Host + 259697) [0x40671]
14 ??? (in Plugin Host + 260202) [0x4086a]
14 ??? (in Plugin Host + 260599) [0x409f7]
14 ??? (in Plugin Host + 261419) [0x40d2b]
14 ??? (in Plugin Host + 253897) [0x3efc9]
14 ??? (in Plugin Host + 260738) [0x40a82]
14 ??? (in Plugin Host + 205666) [0x33362]
14 AudioEffect::dispatchEffectClass(AEffect*, int, int, int, void*, float) + 61 (in VST_VBAP) [0x1458ef9d]
14 JuceVSTWrapper::dispatcher(int, int, int, void*, float) + 310 (in VST_VBAP) [0x14590606]
14 JuceVSTWrapper::deleteEditor(bool) + 154 (in VST_VBAP) [0x1459251a]
14 juce::detachComponentFromWindowRef(juce::Component*, void*) + 392 (in VST_VBAP) [0x14593708]
14 juce::Component::removeFromDesktop() + 79 (in VST_VBAP) [0x14496d6f]
14 juce::NSViewComponentPeer::~NSViewComponentPeer() + 17 (in VST_VBAP) [0x1453c931]
14 juce::NSViewComponentPeer::~NSViewComponentPeer() + 104 (in VST_VBAP) [0x1453dbf8]
14 -[NSView removeFromSuperview] + 367 (in AppKit) [0x9a2a1911]
14 -[NSView _setWindow:] + 1934 (in AppKit) [0x9a253da1]
14 CFArrayApplyFunction + 224 (in CoreFoundation) [0x92d36220]
14 __NSViewRecursionHelper + 40 (in AppKit) [0x9a2a32dd]
14 -[NSView _setWindow:] + 1696 (in AppKit) [0x9a253cb3]
14 -[NSSurface setWindow:] + 51 (in AppKit) [0x9a36bdc1]
14 -[NSSurface _disposeSurface] + 145 (in AppKit) [0x9a36c398]
14 -[NSNotificationCenter postNotificationName:object:] + 56 (in Foundation) [0x9072c05d]
14 -[NSNotificationCenter postNotificationName:object:userInfo:] + 128 (in Foundation) [0x9071ec50]
14 _CFXNotificationPostNotification + 186 (in CoreFoundation) [0x92d5c16a]
14 __CFXNotificationPost + 947 (in CoreFoundation) [0x92d5c763]
14 _nsnote_callback + 176 (in Foundation) [0x90729db3]
14 CGLClearDrawable + 58 (in OpenGL) [0x998aba48]
14 semaphore_wait_signal_trap + 10 (in libSystem.B.dylib) [0x91c8fb42]
Kernel stack:
14 semaphore_wait_continue + 0 [0x22a88f]
Thread 35eda DispatchQueue 1634545000
User stack:
14 start_wqthread + 30 (in libSystem.B.dylib) [0x91cb55c6]
14 _pthread_wqthread + 390 (in libSystem.B.dylib) [0x91cb5781]
14 _dispatch_worker_thread2 + 240 (in libSystem.B.dylib) [0x91cb5cfe]
14 _dispatch_queue_invoke + 163 (in libSystem.B.dylib) [0x91cb5f59]
14 kevent + 10 (in libSystem.B.dylib) [0x91cb6382]
Kernel stack:
14 kevent + 97 [0x47a699]
Thread 35ee9
User stack:
14 thread_start + 34 (in libSystem.B.dylib) [0x91cbd0de]
14 _pthread_start + 345 (in libSystem.B.dylib) [0x91cbd259]
14 CAPThread::Entry(CAPThread*) + 140 (in CoreAudio) [0x98070488]
14 HP_IOThread::ThreadEntry(HP_IOThread*) + 17 (in CoreAudio) [0x98070571]
14 HP_IOThread::WorkLoop() + 1892 (in CoreAudio) [0x98070cda]
14 CAGuard::WaitUntil(unsigned long long) + 289 (in CoreAudio) [0x980733dd]
14 CAGuard::WaitFor(unsigned long long) + 219 (in CoreAudio) [0x980703ab]
14 pthread_cond_timedwait_relative_np + 47 (in libSystem.B.dylib) [0x91cec5a8]
14 semaphore_timedwait_signal_trap + 10 (in libSystem.B.dylib) [0x91c8fb5a]
Kernel stack:
14 semaphore_wait_continue + 0 [0x22a88f]
Thread 35eeb
User stack:
14 thread_start + 34 (in libSystem.B.dylib) [0x91cbd0de]
14 _pthread_start + 345 (in libSystem.B.dylib) [0x91cbd259]
14 CAPThread::Entry(CAPThread*) + 140 (in CoreAudio) [0x98070488]
14 HP_IOThread::ThreadEntry(HP_IOThread*) + 17 (in CoreAudio) [0x98070571]
14 HP_IOThread::WorkLoop() + 1892 (in CoreAudio) [0x98070cda]
14 CAGuard::WaitUntil(unsigned long long) + 289 (in CoreAudio) [0x980733dd]
14 CAGuard::WaitFor(unsigned long long) + 219 (in CoreAudio) [0x980703ab]
14 pthread_cond_timedwait_relative_np + 47 (in libSystem.B.dylib) [0x91cec5a8]
14 semaphore_timedwait_signal_trap + 10 (in libSystem.B.dylib) [0x91c8fb5a]
Kernel stack:
14 semaphore_wait_continue + 0 [0x22a88f]
Thread 35eec
User stack:
14 thread_start + 34 (in libSystem.B.dylib) [0x91cbd0de]
14 _pthread_start + 345 (in libSystem.B.dylib) [0x91cbd259]
14 CAPThread::Entry(CAPThread*) + 96 (in CoreMIDI) [0x2a5ca6]
14 XThread::RunHelper(void*) + 17 (in CoreMIDI) [0x2a62d9]
14 MIDIProcess::RunMIDIInThread() + 150 (in CoreMIDI) [0x2c397a]
14 XServerMachPort::ReceiveMessage(int&, void*, int&) + 155 (in CoreMIDI) [0x2a50c1]
14 mach_msg_trap + 10 (in libSystem.B.dylib) [0x91c8fafa]
Kernel stack:
14 ipc_mqueue_receive_continue + 0 [0x210d84]
Thread 35f2c
User stack:
14 thread_start + 34 (in libSystem.B.dylib) [0x91cbd0de]
14 _pthread_start + 345 (in libSystem.B.dylib) [0x91cbd259]
14 ??? (in Plugin Host + 496271) [0x7a28f]
14 ??? (in Plugin Host + 429578) [0x69e0a]
14 ??? (in Plugin Host + 631020) [0x9b0ec]
14 ??? (in Plugin Host + 431087) [0x6a3ef]
14 ??? (in Plugin Host + 529491) [0x82453]
14 pthread_cond_timedwait$UNIX2003 + 72 (in libSystem.B.dylib) [0x91cbd2b1]
14 __semwait_signal + 10 (in libSystem.B.dylib) [0x91cbdaa2]
Kernel stack:
14 semaphore_wait_continue + 0 [0x22a88f]
Thread 35f42
User stack:
14 thread_start + 34 (in libSystem.B.dylib) [0x91cbd0de]
14 _pthread_start + 345 (in libSystem.B.dylib) [0x91cbd259]
14 threadEntryProc + 70 (in VST_VBAP) [0x143de6a6]
14 juce::Thread::threadEntryPoint() + 103 (in VST_VBAP) [0x143c4fb7]
14 non-virtual thunk to juce::OpenGLContext::CachedImage::run() + 20 (in VST_VBAP) [0x14582774]
14 juce::OpenGLContext::CachedImage::run() + 271 (in VST_VBAP) [0x1458268f]
14 juce::OpenGLContext::CachedImage::renderFrame() + 189 (in VST_VBAP) [0x1458283d]
14 non-virtual thunk to DemoOpenGLCanvas::renderOpenGL() + 20 (in VST_VBAP) [0x14301da4]
14 DemoOpenGLCanvas::renderOpenGL() + 83 (in VST_VBAP) [0x143018c3]
14 juce::MessageManagerLock::MessageManagerLock(juce::Thread*) + 40 (in VST_VBAP) [0x14406858]
14 juce::MessageManagerLock::attemptLock(juce::Thread*, juce::ThreadPoolJob*) + 584 (in VST_VBAP) [0x14406b58]
14 juce::WaitableEvent::wait(int) const + 26 (in VST_VBAP) [0x143c476a]
14 juce::WaitableEventImpl::wait(int) + 192 (in VST_VBAP) [0x143e9480]
14 pthread_cond_timedwait$UNIX2003 + 72 (in libSystem.B.dylib) [0x91cbd2b1]
14 __semwait_signal + 10 (in libSystem.B.dylib) [0x91cbdaa2]
Kernel stack:
14 semaphore_wait_continue + 0 [0x22a88f]
Thread 35f44
User stack:
14 thread_start + 34 (in libSystem.B.dylib) [0x91cbd0de]
14 _pthread_start + 345 (in libSystem.B.dylib) [0x91cbd259]
14 threadEntryProc + 70 (in VST_VBAP) [0x143de6a6]
14 juce::Thread::threadEntryPoint() + 103 (in VST_VBAP) [0x143c4fb7]
14 juce::TimerThread::run() + 170 (in VST_VBAP) [0x1440b54a]
14 juce::Thread::wait(int) const + 27 (in VST_VBAP) [0x143c589b]
14 juce::WaitableEventImpl::wait(int) + 192 (in VST_VBAP) [0x143e9480]
14 pthread_cond_timedwait$UNIX2003 + 72 (in libSystem.B.dylib) [0x91cbd2b1]
13 __semwait_signal + 10 (in libSystem.B.dylib) [0x91cbdaa2]
1 _pthread_cond_wait + 1552 (in libSystem.B.dylib) [0x91cbd8c7]
1 pthread_mutex_lock + 627 (in libSystem.B.dylib) [0x91c956cf]
1 __spin_lock + 13 (in commpage [libSystem.B.dylib]) [0xffff026d]
Kernel stack:
12 semaphore_wait_continue + 0 [0x22a88f]
1 lo_unix_scall + 280 [0x2a1fd8]
1 unix_syscall + 579 [0x4f7f90]
1 __semwait_signal_nocancel + 273 [0x48e04f]
1 semaphore_timedwait_signal_trap_internal + 226 [0x22ad74]
1 semaphore_destroy + 825 [0x22ac50]
1 thread_block + 33 [0x227654]
1 thread_block_reason + 309 [0x2275b0]
1 thread_go + 1961 [0x22698c]
1 thread_setrun + 1360 [0x225bba]
1 machine_idle + 239 [0x2ad11b]
1 lo_allintrs + 302 [0x2a1c2e]
1 interrupt + 192 [0x2ab423]
1 lapic_interrupt + 108 [0x2b32f2]
1 mp_kdp_exit + 868 [0x2b4560]
1 sync_iss_to_iks + 124 [0x2aabf6]
Binary Images:
0x1000 - 0x23aff3 com.rawmaterialsoftware.pluginhost 1.0.0 (1.0.0) /Users/scottawardle/Library/Developer/Xcode/DerivedData/Plugin_Host-ejxmhciwyhrzridkvciuthmpzvci/Build/Products/Release/PluginHost.app/Contents/MacOS/Plugin Host
0x295000 - 0x2e1ffb com.apple.audio.midi.CoreMIDI 1.7.1 (42) /System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI
0x142ff000 - 0x147b8ff7 com.scea.VST_VBAP 1.0.0 (1.0.0) <0E55E5AE-1DC8-3B6F-B68A-57F7494C3696> /Users/scottawardle/Library/Audio/Plug-Ins/VST/VST_VBAP.vst/Contents/MacOS/VST_VBAP
0x90714000 - 0x90985fef com.apple.Foundation 6.6.8 (751.63) <69B3441C-B196-F2AD-07F8-D8DD24E4CD8C> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
0x91c8f000 - 0x91e36ff7 libSystem.B.dylib ??? (???) <2DCD13E3-1BD1-6F25-119A-3863A3848B90> /usr/lib/libSystem.B.dylib
0x92d01000 - 0x92e7cfe7 com.apple.CoreFoundation 6.6.6 (550.44) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x9596b000 - 0x95c8ffef com.apple.HIToolbox 1.6.5 (???) <21164164-41CE-61DE-C567-32E89755CB34> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
0x98050000 - 0x980cafff com.apple.audio.CoreAudio 3.2.6 (3.2.6) <156A532C-0B60-55B0-EE27-D02B82AA6217> /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
0x998a9000 - 0x998b7ff7 com.apple.opengl 1.6.14 (1.6.14) <82622F67-E032-0BF6-A78D-50B346E8D0FD> /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
0x9a238000 - 0x9ab1bff7 com.apple.AppKit 6.6.8 (1038.36) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
0xffff0000 - 0xffff1fff commpage [libSystem.B.dylib] ??? (???) <2DCD13E3-1BD1-6F25-119A-3863A3848B90> /usr/lib/libSystem.B.dylib
[/code]