Latest juce.Plugin demo hangs host on closing when UI opened

Does it still crash if you close the plugin’s window before you try to quit?

It does not crash if I close the jucedemoplugin’s GUI before quitting.

Also, it crashed when launching the first time, while scanning the VST’s.
And of course it crash again, if I try to ‘rescan’ the VST plugins while jucedemoplugin is inside VST folder.

It’s 100% reproducible. I suggest you try to dowload the reaper demo ?

NB : since the mod you sent, the crash log ‘evolved’

Thanks,

Salvator

I just tried it in reaper, and can’t get it to crash at all… Are you using the latest version of reaper?

Hello.
Bad news. Now - there is AU crash in same case.
So, I use Logic 7(latest juce, x86).
If I close logic(via program menu) when plugin window is active - all works.
But if i click on Logic AU(to make it active) and close program - i’ll got a error.
Also, GB9 affected too.

In debugger looks like AudioProcessor destructor called before gui released.
I’ll send you some screenshots to email.

Michail.

Sorry for delay - crazy energy supply block kill my hard drives.

Fix under testing.

Also, there is same issue with ProTools(PE_LE 8.0, Mac, 10.5.5).
On closing with GUI opened - strange crash(no plugin code report).

I’ll try to investigate problem.

MIchail.

AU fix works - thanks.
Michail.

Hello,

Sorry for late reply.
I’m using reaper 3.06 (20 july 2009) and JuceDemoPlugin from tip 757.
Still crash when quiting while VST GUI is active.

I did not tried jucedemo on PT(for some obscure reason, this time I got linking error when trying to build RTAS) but with my own plugin, I too experiemented the mentionned crash with protools L8 8, OSX 10.5.7.
There was no such problem until I updated around tip 755 and up)

Thanks,

Salvator

Well, I’ve just tried the VST and AU versions of the demo plugin in that version of Reaper, and it all closes just fine for me…

Hello.
Looks like it works only for Logic and GB9…

Crash log closing GUI opened ProTools LE 8:

Thread 0 Crashed:
0 libobjc.A.dylib 0x95869688 objc_msgSend + 24
1 com.apple.AppKit 0x90300632 -[NSWindow _cancelPerformSelectors] + 398
2 com.apple.AppKit 0x902fecd3 -[NSWindow dealloc] + 1175
3 com.apple.Foundation 0x94cde44f NSPopAutoreleasePool + 1007
4 com.apple.HIToolbox 0x91cc71ae HIPopAutoreleasePool + 20
5 com.apple.HIToolbox 0x91cc8934 ToolboxEventDispatcherHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 2948
6 com.apple.HIToolbox 0x91c9a6bc DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 2134
7 com.apple.HIToolbox 0x91c9973d SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 405
8 com.apple.HIToolbox 0x91cb6092 SendEventToEventTarget + 52
9 com.apple.HIToolbox 0x91d22c60 ToolboxEventDispatcher + 86
10 com.apple.HIToolbox 0x91d1f4ba RunApplicationEventLoop + 222
11 com.digidesign.framework.DFW 0x00943ce9 DFW_EventLoop::RunApplicationEventLoop() + 11
12 com.digidesign.framework.DFW 0x008e22a1 TApplication::Run() + 45
13 …gidesign.framework.ProTools 0x0288cba2 LaunchProTools + 2266
14 com.digidesign.ProToolsLE 0x0000800c 0x1000 + 28684
15 com.digidesign.ProToolsLE 0x00002b62 0x1000 + 7010
16 com.digidesign.ProToolsLE 0x00002a89 0x1000 + 6793

But it case of PT i cant repeate with JuceDemo plugin. But used code was worked for 1.45, 1.46 juces…

In Live host when change two plugin(au and vst) many time fast - got exception here:
or this:
hread 7 Crashed:
0 libobjc.A.dylib 0x95869688 objc_msgSend + 24
1 com.rawmaterialsoftware. 0x16375bcc juce::MessageManager::postMessageToQueue(juce::Message*) + 34 (juce_amalgamated.cpp:37527)
2 com.rawmaterialsoftware. 0x164cb7ba juce::MessageListener::postMessage(juce::Message*) const + 72 (juce_amalgamated.cpp:37471)
3 com.rawmaterialsoftware. 0x164d0200 juce::ChangeListenerList::sendChangeMessage(void*) + 172 (juce_amalgamated.cpp:36962)
4 com.rawmaterialsoftware. 0x164d0277 juce::ChangeBroadcaster::sendChangeMessage(void*) + 33 (juce_amalgamated.cpp:36900)
5 com.rawmaterialsoftware. 0x1635b9aa DemoJuceFilter::processBlock(juce::AudioSampleBuffer&, juce::MidiBuffer&) + 516 (DemoJuceFilter.cpp:188)
6 com.rawmaterialsoftware. 0x165f42ed JuceAU::ProcessBufferLists(unsigned long&, AudioBufferList const&, AudioBufferList&, unsigned long) + 1289 (juce_AU_Wrapper.mm:745)
7 com.rawmaterialsoftware. 0x165f61be JuceAU::Render(unsigned long&, AudioTimeStamp const&, unsigned long) + 144 (juce_AU_Wrapper.mm:643)
8 com.rawmaterialsoftware. 0x163480a3 AUBase::RenderBus(unsigned long&, AudioTimeStamp const&, unsigned long, unsigned long) + 79 (AUBase.h:263)
9 com.rawmaterialsoftware. 0x16348790 AUBase::DoRenderBus(unsigned long&, AudioTimeStamp const&, unsigned long, AUOutputElement*, unsigned long, AudioBufferList&) + 148 (AUBase.h:647)
10 com.rawmaterialsoftware. 0x163462a0 AUBase::DoRender(unsigned long&, AudioTimeStamp const&, unsigned long, unsigned long, AudioBufferList&) + 666 (AUBase.cpp:1296)
11 com.rawmaterialsoftware. 0x1634e643 AudioUnitBaseRender(AUBase*, unsigned long*, AudioTimeStamp const*, unsigned long, unsigned long, AudioBufferList*) + 109
12 com.ableton.live 0x018e783f AAutoHidingBoxView::~AAutoHidingBoxView() + 801
13 com.ableton.live 0x010ddffb catch_exception_raise + 8867235
14 com.ableton.live 0x007cd4c5 0x1000 + 8176837
15 com.ableton.live 0x007cdebe 0x1000 + 8179390
16 com.ableton.live 0x003b36f4 0x1000 + 3876596
17 com.ableton.live 0x003b36f4 0x1000 + 3876596
18 com.ableton.live 0x00515f39 0x1000 + 5328697
19 com.ableton.live 0x007c9594 0x1000 + 8160660
20 com.ableton.live 0x016a0b3d ACommonCombiSlider::~ACommonCombiSlider() + 24397
21 com.ableton.live 0x00517220 0x1000 + 5333536
22 com.ableton.live 0x007c920f 0x1000 + 8159759
23 com.ableton.live 0x0051a418 0x1000 + 5346328
24 com.ableton.live 0x001c41ac 0x1000 + 1847724
25 com.ableton.live 0x001c454a 0x1000 + 1848650
26 com.ableton.live 0x009f3389 catch_exception_raise + 1614129
27 com.ableton.live 0x01276256 catch_exception_raise + 10539006
28 com.apple.audio.CoreAudio 0x94beffdf HP_IOProc::Call(AudioTimeStamp const&, AudioTimeStamp const&, AudioBufferList const*, AudioTimeStamp const&, AudioBufferList*) + 319
29 com.apple.audio.CoreAudio 0x94befcd0 IOA_Device::CallIOProcs(AudioTimeStamp const&, AudioTimeStamp const&, AudioTimeStamp const&) + 274
30 com.apple.audio.CoreAudio 0x94befbac HP_IOThread::PerformIO(AudioTimeStamp const&) + 1246
31 com.apple.audio.CoreAudio 0x94bedf87 HP_IOThread::WorkLoop() + 1239
32 com.apple.audio.CoreAudio 0x94bedaab HP_IOThread::ThreadEntry(HP_IOThread*) + 17
33 com.apple.audio.CoreAudio 0x94bde300 CAPThread::Entry(CAPThread*) + 96
34 libSystem.B.dylib 0x94f866f5 _pthread_start + 321
35 libSystem.B.dylib 0x94f865b2 thread_start + 34

It is repeatable for Juce demo too.

GB9 crash logs coming soon :slight_smile:

I was trying to debug it, but without results.
Sometime i got crash after call to platformSpecificShoutdown for Mac message queue(on sending change messages).

Michail.

I can’t reproduce either of these. The PT one looks like a reference count error on the window, but that’s all working just fine. Are you doing anything in your plugin like popping up other windows?

And are you running with the latest tip? I made a few minor message-related fixes recently, that might help with the Live problem. And any more details you can give about how to reproduce it would be helpful.

Hello,

I experiment the exact same ‘crash on quit’, that Nkey mentioned with PT LE8.

Note : the very same jucedemoplugin don’t crash PT LE 7.4.2, but with 8, it’s 100% reproducible if GUI is open while quitting.

Thanks,

Salvator

Thanks. I’m still using PT7.4 so I guess I’ll need to get 8 and try it.

Hello Jules,

Any progress for this crash ?

Many Thanks,

Salvator

Sorry, haven’t had time to look yet!

Hi,

adding

MessageManager::getInstance()->runDispatchLoopUntil (20);
at the end of removeSubWindow in juce_RTAS_MacUtilities.mm seems to fix the crash ‘on quit’ with ProTools 8.

Emmanuel

Very interesting… thanks, that seems to make sense. Have you tried it in PT7? Doing the same trick for VSTs was a bit of a nightmare - in some hosts it worked, in others it made things worse.

I’d be tempted to also do this instead:

for (int i = 20; --i >= 0;) MessageManager::getInstance()->runDispatchLoopUntil (1);

(Which just reduces the risk that it might return too soon without processing the important message).

yes, it works with PT7.4 on Mac 10.4.11 and PT8.0.3 on Mac 10.6.1

I’ve updated JUCE to the latest tip but still I get the dreaded objc_msgSend crash when deleting my plugin from Live (both 6 and 7) with the editor window open.

The strange thing is that I have two different products, both compiled with the same up to date tip of JUCE (but different objc prefix) and only one of them is prone to this crash. The other does close just fine.

I’ve thought this may be to some conflict between the two binaries despite the objc prefix, or between the binary of the AU version and the VST one, so I deleted everything but the VST of the crashing plugin, and the crash still remains.

I’ve tried editing the number of iteration and the duration of the timeout in the cleanup cycle of MessageManager, (tried with 200 iteration and a time of 10 instead of 1) but still with no luck.

Any hints on what could be the problem? I’ve tried debugging it, but it seems that none of the JUCE method are in the call stack when the crash happens.

I never managed to reproduce that - last time I checked the demo in Live it was working just fine.