Crash on MessageManager::deleteInstance()


There seems to be a problem when using multiple Juce (VST) plugins in the same host. I am getting occasional crashes when I close the last plugin. Here is the stack trace of the crash:

#0 0x90063f87 in objc_msgSend #1 0x01830ab0 in ?? #2 0x149d5c76 in juce::MessageManager::~MessageManager #3 0x149d5cfc in juce::MessageManager::deleteInstance #4 0x149d801f in juce::shutdownJuce_GUI #5 0x14b0186c in JuceVSTWrapper::~JuceVSTWrapper #6 0x14afdff0 in AudioEffect::dispatchEffectClass #7 0x0003c834 in juce::VSTPluginInstance::~VSTPluginInstance #8 0x000496b4 in juce::AudioProcessorGraph::Node::~Node #9 0x000432d8 in juce::GraphRenderingOps::ProcessBufferOp::~ProcessBufferOp #10 0x00035fce in juce::deleteRenderOpArray #11 0x0003f602 in juce::AudioProcessorGraph::buildRenderingSequence #12 0x0003d15c in non-virtual thunk to juce::AudioProcessorGraph::handleAsyncUpdate() #13 0x0009d5b3 in juce::AsyncUpdater::AsyncUpdaterMessage::messageCallback #14 0x0009e92f in juce::MessageQueue::deliverNextMessage #15 0x0009e9cc in juce::MessageQueue::runLoopCallback #16 0x9576342b in __CFRunLoopDoSources0 #17 0x95760eef in __CFRunLoopRun #18 0x957603c4 in CFRunLoopRunSpecific #19 0x957601f1 in CFRunLoopRunInMode #20 0x90bb3e04 in RunCurrentEventLoopInMode #21 0x90bb3af5 in ReceiveNextEventCommon #22 0x90bb3a3e in BlockUntilNextEventMatchingListInMode #23 0x98b23595 in _DPSNextEvent #24 0x98b22dd6 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] #25 0x98ae51f3 in -[NSApplication run] #26 0x0009b4bb in juce::MessageManager::runDispatchLoop #27 0x001297a3 in juce::JUCEApplication::main #28 0x001298e2 in juce::JUCEApplication::main #29 0x00006be5 in start

To reproduce the problem, it’s quite simple. You can create 6-7 different versions (change the JucePlugin_PluginCode constant for each) of the Juce Demo plugin. Then run the Juce Demo host, scan the folder in which they are, and then try inserting 2-3 of them, then deleting the first, then the others. If you try this a few times, you are sure to get a crash.

It looks as if either the MessageManager could not be deleted, or was already deleted through shutdownJuce_GUI by another plugin(?). I haven’t investigated any further at the moment.

I have made sure to use RELEASE versions of both the plugins and host.

Hope you can come up with some explanation or fix, because this is a big problem for us, with our app crashing randomly at closing time, when deallocating the plugins.



Which version of juce?

Introjucer tells me I have v. 2.0.19

Then I think you can guess what my answer is.

Ok, let me try after updating to 2.0.25. Do you recall fixing anything related to that lately?

No, but your version may pre-date the changes where I obfuscated the internal obj-C class names, preventing cross-module obj-C linkage.

Ok, will try that, though I have the same problem on Windows.

Great! Seems like it’s solved. I couldn’t make it crash with plugins generated under Juce 2.0.25.

I’m getting a similar problem on Windows, but it’s with plugins generated using the Maize sampler tool, so it’s probably the developer at fault, there. I tried with Juce Demo plugins and it doesn’t crash.

Sorry for wasting your time;-)