I’m using the plug-in host, built in the usual way (through Xcode on OSX). I’m generating VSTs using the JUCE code, but built with a different build system (I mention this in the off-chance that I missed a flag or something). I can load any of my VSTs into the plugin host when there is only a single VST in the search path folders. It works. When I add a second VST, I reliably get a crash (EXC_BAD_ACCESS) with the stack trace below when calling dispatch(plugInOpcodeGetProgramName, …). This is repeatable with different first and second plugins. My AudioProcessor::getProgramName() returns String() for all of my plugins, like it does in the demo plugin.
Any thoughts?
#2 0x00000001086986f7 in JuceVSTWrapper::dispatcherCB(VstEffectInterface*, int, int, long long, void*, float) ()
#3 0x00000001000da2b5 in juce::VSTPluginInstance::dispatch(int, int, long long, void*, float) const at /Users/chetgnegy/NeptuneStudios/Neptune/Source/ThirdParty/Juce/JUCE/examples/audio plugin host/Builds/MacOSX/../../../../modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp:1234
#4 0x00000001000f01fd in juce::VSTPluginInstance::updateStoredProgramNames() at /Users/chetgnegy/NeptuneStudios/Neptune/Source/ThirdParty/Juce/JUCE/examples/audio plugin host/Builds/MacOSX/../../../../modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp:1869
#5 0x00000001000efd7a in juce::VSTPluginInstance::initialise(double, int) at /Users/chetgnegy/NeptuneStudios/Neptune/Source/ThirdParty/Juce/JUCE/examples/audio plugin host/Builds/MacOSX/../../../../modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp:780
#6 0x00000001000da93c in juce::VSTPluginInstance::initialiseEffect(double, int) at /Users/chetgnegy/NeptuneStudios/Neptune/Source/ThirdParty/Juce/JUCE/examples/audio plugin host/Builds/MacOSX/../../../../modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp:734
#7 0x00000001000cc550 in juce::VSTPluginFormat::createPluginInstance(juce::PluginDescription const&, double, int, void*, void (*)(void*, juce::AudioPluginInstance*, juce::String const&)) at /Users/chetgnegy/NeptuneStudios/Neptune/Source/ThirdParty/Juce/JUCE/examples/audio plugin host/Builds/MacOSX/../../../../modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp:2868
#8 0x00000001000bedec in juce::AudioPluginFormat::createPluginInstanceOnMessageThread(juce::PluginDescription const&, double, int, juce::AudioPluginFormat::InstantiationCompletionCallback*) at /Users/chetgnegy/NeptuneStudios/Neptune/Source/ThirdParty/Juce/JUCE/examples/audio plugin host/Builds/MacOSX/../../../../modules/juce_audio_processors/format/juce_AudioPluginFormat.cpp:207
#9 0x00000001000bec37 in juce::AudioPluginFormat::createPluginInstanceAsync(juce::PluginDescription const&, double, int, juce::AudioPluginFormat::InstantiationCompletionCallback*) at /Users/chetgnegy/NeptuneStudios/Neptune/Source/ThirdParty/Juce/JUCE/examples/audio plugin host/Builds/MacOSX/../../../../modules/juce_audio_processors/format/juce_AudioPluginFormat.cpp:138
#10 0x00000001000bf500 in juce::AudioPluginFormatManager::createPluginInstanceAsync(juce::PluginDescription const&, double, int, juce::AudioPluginFormat::InstantiationCompletionCallback*) at /Users/chetgnegy/NeptuneStudios/Neptune/Source/ThirdParty/Juce/JUCE/examples/audio plugin host/Builds/MacOSX/../../../../modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp:135
#11 0x000000010000211e in FilterGraph::addFilter(juce::PluginDescription const*, double, double) at /Users/chetgnegy/NeptuneStudios/Neptune/Source/ThirdParty/Juce/JUCE/examples/audio plugin host/Source/FilterGraph.cpp:99
#12 0x000000010000ed3d in GraphEditorPanel::createNewPlugin(juce::PluginDescription const*, int, int) at /Users/chetgnegy/NeptuneStudios/Neptune/Source/ThirdParty/Juce/JUCE/examples/audio plugin host/Source/GraphEditorPanel.cpp:869
#13 0x000000010000ec68 in GraphEditorPanel::mouseDown(juce::MouseEvent const&) at /Users/chetgnegy/NeptuneStudios/Neptune/Source/ThirdParty/Juce/JUCE/examples/audio plugin host/Source/GraphEditorPanel.cpp:862
What are you attempting to access when you hit this? What are the states of all the variables? The stack trace on its own is not enough to narrow down the problem very much.
Here are the list of args to dispatchFunction prior to the crash. This is 100% reproducible for me. Note that if I open StreamPlugin and Constellation in the reverse order, it is always the second one that breaks on the same line. I can successfully open multiple instances of the first plugin at once, it’s once I open the first different plugin.
You’ll also notice I’m trying to build the old VST format at v4.3.1. First off… I’m sorry, I know devs hate when someone brings them old code and complains. I’m picking this project up again after 2 years and I need to finish the job of getting my build system working for the state of the world then before I upgrade. (This whole adventure has been in trying to build JUCE with Bazel). So FWIW, I think this is not a bug in the JUCE library code. I never had these issues when building the plugins as JUCE recommends. (I’m sure you’re shaking your head at me now, haha) Any insights are appreciated.
EDIT: It seems to be coming from an address near vstEffect, I don’t think I can actually conclude that it is within the bounds of that object from the information given.
It’s possible that it’s some kind of confusion/collision when you have two dynamic libraries loaded into memory. If a build problem isn’t too unlikely then I’d suggest looking at the linking arguments and symbol visibility.
OK, I will. Thank you. You mention symbol visibility (keeping in mind that my main experience in learning about linkers is this very issue), but I would expect that if there was a visibility issue that loading the plugin at all would be problematic.
Any specific symbols to look at beyond debugFunction?
I haven’t solved this yet, but I did want to thank you for the useful link. I’m learning a lot and I suspect your hunches are good that this is related to the problem.