[RESOLVED - my bad] AudioUnit crashing at very end of Logic's scan

I’m updating an old pre-JUCE plugin to JUCE 6.0.5, and am getting an odd error at the very end of the scan in Logic Pro X. Something is crashing when destroying the Processor class. Here is the relevant output:

Termination Signal: Illegal instruction: 4
Termination Reason: Namespace SIGNAL, Code 0x4
Terminating Process: exc handler [1718]

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 com.Antares.AutoTune 0x000000010fff2a38 juce::AudioProcessorParameter::~AudioProcessorParameter() + 8 (juce_AudioProcessor.cpp:1447)
1 com.Antares.AutoTune 0x000000011004502f std::__1::default_deletejuce::AudioProcessorParameter::operator()(juce::AudioProcessorParameter*) const + 47 (memory:2339)
2 com.Antares.AutoTune 0x0000000110044faf std::__1::unique_ptr<juce::AudioProcessorParameter, std::__1::default_deletejuce::AudioProcessorParameter >::reset(juce::AudioProcessorParameter*) + 95 (memory:2652)
3 com.Antares.AutoTune 0x0000000110044f49 std::__1::unique_ptr<juce::AudioProcessorParameter, std::__1::default_deletejuce::AudioProcessorParameter >::~unique_ptr() + 25 (memory:2605)
4 com.Antares.AutoTune 0x000000010ffecd65 std::__1::unique_ptr<juce::AudioProcessorParameter, std::__1::default_deletejuce::AudioProcessorParameter >::~unique_ptr() + 21 (memory:2605)
5 com.Antares.AutoTune 0x0000000110003a48 juce::AudioProcessorParameterGroup::AudioProcessorParameterNode::~AudioProcessorParameterNode() + 56 (juce_AudioProcessorParameterGroup.cpp:29)
6 com.Antares.AutoTune 0x0000000110003a95 juce::AudioProcessorParameterGroup::AudioProcessorParameterNode::~AudioProcessorParameterNode() + 21 (juce_AudioProcessorParameterGroup.cpp:29)
7 com.Antares.AutoTune 0x0000000110070d98 juce::ContainerDeletePolicyjuce::AudioProcessorParameterGroup::AudioProcessorParameterNode::destroy(juce::AudioProcessorParameterGroup::AudioProcessorParameterNode*) + 56 (juce_ContainerDeletePolicy.h:54)
8 com.Antares.AutoTune 0x0000000110070abe juce::OwnedArray<juce::AudioProcessorParameterGroup::AudioProcessorParameterNode, juce::DummyCriticalSection>::deleteAllObjects() + 94 (juce_OwnedArray.h:859)
9 com.Antares.AutoTune 0x0000000110070a0c juce::OwnedArray<juce::AudioProcessorParameterGroup::AudioProcessorParameterNode, juce::DummyCriticalSection>::~OwnedArray() + 28 (juce_OwnedArray.h:64)
10 com.Antares.AutoTune 0x0000000110004065 juce::OwnedArray<juce::AudioProcessorParameterGroup::AudioProcessorParameterNode, juce::DummyCriticalSection>::~OwnedArray() + 21 (juce_OwnedArray.h:65)
11 com.Antares.AutoTune 0x0000000110003ff8 juce::AudioProcessorParameterGroup::~AudioProcessorParameterGroup() + 56 (juce_AudioProcessorParameterGroup.cpp:62)
12 com.Antares.AutoTune 0x000000010ffe9c95 juce::AudioProcessorParameterGroup::~AudioProcessorParameterGroup() + 21 (juce_AudioProcessorParameterGroup.cpp:62)
13 com.Antares.AutoTune 0x000000010ffe9e8f juce::AudioProcessor::~AudioProcessor() + 399 (juce_AudioProcessor.cpp:66)

I don’t use any AudioProcessotParameterGroup objects that I know of, at least not directly. When scanning in auval, after all tests have passed, it says “illegal instruction: 4”. When run from Xcode, it says “Program ended with exit code: 4”.

I am using JUCE_FORCE_LEGACY_PARAMETER_AUTOMATION_TYPE = 1, so that my old pre-JUCE parameters can be used, and am adding them in my Processor using createAndAddParameter() (which is deprecated, I know). So maybe I’m doing something wrong there?

Any thoughts? I can run auvaltool from Xcode, but not if Debug Executable is checked, so I don’t know how I can debug this.

Follow-up: In Logic, after this happens, it says “not authorized” in the Plug-In Manager window, and won’t show up as a plugin, even though the Use box is checked. Huh? This isn’t a copy-protected build, so what gives?

Have you copied auvaltool to some other place than /usr/bin? I copied it into my home directory (based on advice I’d read here) which then allows to run auvaltool under the XCode debugger.

edit: here was the advice, need to resign it too : AU Validation Crash Passing all tests?

Yes, but Xcode then says:

Message from debugger: Error 1
Program ended with exit code: -1

Assuming you also resigned it, I guess this is some GateKeeper/Notarisation bullshit :confused: Thanks Apple…

It looks like there is an std::unique_ptr being held in an OwnedArray and a double delete may be happening?

Are you initializing params as unique_ptrs and then using them to call addParameter?

Nope. Using the (deprecated) createAndAddParameter().

I found it. I was assigning our bypass parameter to the master bypass parameter, but also keeping the pointer myself, which got deleted, which then led to it being deleted again when clearing the parameterTree member of the AudioProcessor. (For AU, we don’t add that parameter at all usually, but since it was in our old pre-JUCE code, I have to add something in that spot to keep backwards compatibility. I just need to not assign it to a local variable that gets deleted.)

1 Like