AU hosting VST crash on effect->processReplacing

Hey Jules, this is Carlos from NyrvSystems (http://nyrvsystems.com)

Our subhost AGENT hast an issue when being used as an AU to host VSTs on OSX triggers an EXC_BAD_ACCESS

The line is 1060 on juce_VSTPluginFormat.cpp:

if ((effect->flags & effFlagsCanReplacing) != 0)

            {

                effect->processReplacing (effect, buffer.getArrayOfWritePointers(), buffer.getArrayOfWritePointers(), numSamples);

            }

This is called after we do an

instance->processBlock(buffer, midiMessages); // this is an instance of AudioProcessor.

We've tried a bunch of stuff but nothing seems to work, same plug as VST hosting VSTs has no issues. only AU.

Is there something we are missing? 

Thanks in advance

Impossible to tell from so little info. Obviously anything at all could be happening within the plugin's process function, and without a stack trace that gives no clues at all.

Most likely you're giving it the wrong number of channels to render into, or not initialising it before you use it, or something like that.

Hey Jules thanks for your reply.

here is the stack trace:


#0    0x00000001327ffb56 in JuceVSTWrapper::processReplacing(float**, float**, int) ()
#1    0x000000011fc98c4d in juce::VSTPluginInstance::processBlock(juce::AudioSampleBuffer&, juce::MidiBuffer&) at /Users/carlosbarbosa/Documents/Nyrv/Development/AgentLite/JuceLibraryCode/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp:1060
#2    0x000000011fb2c70a in HostedPlugin::processBlock(juce::AudioSampleBuffer&, juce::MidiBuffer&, juce::AudioPlayHead*) at /Users/carlosbarbosa/Documents/Nyrv/Development/AgentLite/Source/AudioPluginHosting/HostedPlugin.cpp:183
#3    0x000000011fb2a54b in HostedPluginSlot::processBlock(juce::AudioSampleBuffer&, juce::MidiBuffer&, juce::AudioPlayHead*) at /Users/carlosbarbosa/Documents/Nyrv/Development/AgentLite/Source/AudioPluginHosting/HostedPluginSlot.cpp:80
#4    0x000000011fb27861 in HostedPluginSlotsManager::processBlock(juce::AudioSampleBuffer&, juce::MidiBuffer&, juce::AudioPlayHead*) at /Users/carlosbarbosa/Documents/Nyrv/Development/AgentLite/Source/AudioPluginHosting/HostedPluginSlotsManager.cpp:96
#5    0x000000011fb3f4e9 in PluginsHost::processBlock(juce::AudioSampleBuffer&, juce::MidiBuffer&, juce::AudioPlayHead*) at /Users/carlosbarbosa/Documents/Nyrv/Development/AgentLite/Source/AudioPluginHosting/PluginsHost.cpp:468
#6    0x000000011fb62558 in NyrvAgentAudioProcessor::processStereoBuffer(juce::AudioSampleBuffer&, juce::MidiBuffer&, juce::AudioPlayHead*) at /Users/carlosbarbosa/Documents/Nyrv/Development/AgentLite/Source/PluginProcessor.cpp:824
#7    0x000000011fb62273 in NyrvAgentAudioProcessor::processBlock(juce::AudioSampleBuffer&, juce::MidiBuffer&) at /Users/carlosbarbosa/Documents/Nyrv/Development/AgentLite/Source/PluginProcessor.cpp:506
#8    0x000000011fb96e47 in JuceAU::ProcessBufferLists(unsigned int&, AudioBufferList const&, AudioBufferList&, unsigned int) at /Users/carlosbarbosa/Documents/Nyrv/Development/AgentLite/JuceLibraryCode/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm:936
#9    0x000000011fb82060 in AUEffectBase::Render(unsigned int&, AudioTimeStamp const&, unsigned int) at /Users/carlosbarbosa/Documents/Nyrv/Development/AgentLite/JuceLibraryCode/modules/juce_audio_plugin_client/AU/CoreAudioUtilityClasses/AUEffectBase.cpp:383
#10    0x000000011fb970a1 in JuceAU::Render(unsigned int&, AudioTimeStamp const&, unsigned int) at /Users/carlosbarbosa/Documents/Nyrv/Development/AgentLite/JuceLibraryCode/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm:821
#11    0x000000011fb76d5d in AUBase::RenderBus(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int) at /Users/carlosbarbosa/Documents/Nyrv/Development/AgentLite/JuceLibraryCode/modules/juce_audio_plugin_client/AU/CoreAudioUtilityClasses/AUBase.h:331
#12    0x000000011fb767c7 in AUBase::DoRenderBus(unsigned int&, AudioTimeStamp const&, unsigned int, AUOutputElement*, unsigned int, AudioBufferList&) at /Users/carlosbarbosa/Documents/Nyrv/Development/AgentLite/JuceLibraryCode/modules/juce_audio_plugin_client/AU/CoreAudioUtilityClasses/AUBase.h:811
#13    0x000000011fb7238e in AUBase::DoRender(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int, AudioBufferList&) at /Users/carlosbarbosa/Documents/Nyrv/Development/AgentLite/JuceLibraryCode/modules/juce_audio_plugin_client/AU/CoreAudioUtilityClasses/AUBase.cpp:1497
#14    0x000000011fb80981 in AUBase::ComponentEntryDispatch(ComponentParameters*, AUBase*) at /Users/carlosbarbosa/Documents/Nyrv/Development/AgentLite/JuceLibraryCode/modules/juce_audio_plugin_client/AU/CoreAudioUtilityClasses/AUDispatch.cpp:355
#15    0x000000011fb8671a in AUMIDIEffectBase::ComponentEntryDispatch(ComponentParameters*, AUMIDIEffectBase*) at /Users/carlosbarbosa/Documents/Nyrv/Development/AgentLite/JuceLibraryCode/modules/juce_audio_plugin_client/AU/CoreAudioUtilityClasses/AUMIDIEffectBase.cpp:141
#16    0x000000011fb94f07 in ComponentEntryPoint<JuceAU>::Dispatch(ComponentParameters*, JuceAU*) at /Users/carlosbarbosa/Documents/Nyrv/Development/AgentLite/JuceLibraryCode/modules/juce_audio_plugin_client/AU/CoreAudioUtilityClasses/ComponentBase.h:289
#17    0x000000011fb9171d in AgentAUEntry at /Users/carlosbarbosa/Documents/Nyrv/Development/AgentLite/JuceLibraryCode/modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm:1633
#18    0x00007fff9a51e46d in _AT_AudioUnitRender ()
#19    0x0000000103b750fd in CMDAudioUnit::Process(MDPlugInputBusList const*, MDPlugOutputBusList const*, long, long, long, float const*, eProcessLevel) ()
#20    0x0000000103afb1eb in MDPlug::_Process(MDPlugInputBusList const*, MDPlugOutputBusList const*, long, long, long, float const*, eProcessLevel) ()
#21    0x0000000103ac6a8c in MD::PluginProcess(MDProcInfo*, MDPlug*, float const*, long, long, long, eProcessLevel) ()
#22    0x0000000103ac8a48 in MD::StreamProcessing(eProcessLevel, long, long, long) ()
#23    0x0000000103acc55a in MD::Process(eProcessLevel) ()
#24    0x0000000103ad263a in MD::PrimeProcess() ()
#25    0x0000000103ae836b in MD::PrepareForStart(long) ()
#26    0x0000000103af160e in MDCA::PrepareForStart(long) ()
#27    0x00000001000ad318 in ___lldb_unnamed_function1646$$Logic Pro X ()
#28    0x000000010011f1de in ___lldb_unnamed_function2745$$Logic Pro X ()
#29    0x0000000100a065d1 in ___lldb_unnamed_function24793$$Logic Pro X ()
#30    0x0000000100a080eb in ___lldb_unnamed_function24799$$Logic Pro X ()
#31    0x00000001004bcfcc in ___lldb_unnamed_function8988$$Logic Pro X ()
#32    0x00000001004bf351 in ___lldb_unnamed_function9015$$Logic Pro X ()
#33    0x00000001004bf1df in ___lldb_unnamed_function9014$$Logic Pro X ()
#34    0x00000001004bd669 in ___lldb_unnamed_function8993$$Logic Pro X ()
#35    0x00000001004bd3aa in ___lldb_unnamed_function8992$$Logic Pro X ()
#36    0x00000001006b0f29 in ___lldb_unnamed_function15216$$Logic Pro X ()
#37    0x0000000100765a45 in ___lldb_unnamed_function17518$$Logic Pro X ()
#38    0x00007fff9020d2dc in -[NSWindow _reallySendEvent:isDelayedEvent:] ()
#39    0x00007fff8fb9cc86 in -[NSWindow sendEvent:] ()
#40    0x00000001001c1576 in ___lldb_unnamed_function4280$$Logic Pro X ()
#41    0x00007fff8fb99212 in -[NSApplication sendEvent:] ()
#42    0x000000010069ea6b in ___lldb_unnamed_function14931$$Logic Pro X ()
#43    0x000000010069e9db in ___lldb_unnamed_function14930$$Logic Pro X ()
#44    0x0000000100699171 in ___lldb_unnamed_function14843$$Logic Pro X ()
#45    0x000000010069ea4a in ___lldb_unnamed_function14931$$Logic Pro X ()
#46    0x000000010069e9db in ___lldb_unnamed_function14930$$Logic Pro X ()
#47    0x00007fff8fac2b68 in -[NSApplication run] ()
#48    0x00007fff8fa3f244 in NSApplicationMain ()
#49    0x0000000100664bf5 in ___lldb_unnamed_function13743$$Logic Pro X ()
#50    0x00007fff94ec25c9 in start ()

This works correctly on launch, audio is passed through and modified, only if we press Logic's Stop.. and then Play buttons the EXC_BAD_ACCESS happens.

 

Sorry, can't tell from that... There's a whole bunch of your own code on the stack - presumably there's something going wrong in there, but impossible to guess from what you've said here. It's the kind of problem you really have to work out by carefully debugging it.