Ableton Live AU crash on duplicate

Hi Guys,

I’m having a crash when duplicating a track with my AU plugin in Ableton Live that crash somewhere in Live code. (even with UI closed)
Bypassing getStateInformation and setStateInformation lead to the same issue.

Works fine in VST and in other host in AU.

Does someone have the same crash ?

Thanks !

What does the stack trace look like when it crashes? You can find the crash reports in ~/Library/Logs/DiagnosticReports

A little script that I use to get crash reports from customers on macOS I thought might be helpful:

#!/bin/bash
mkdir ~/Desktop/CrashReports
echo "Collecting Crash Reports..."
IFS=$'\n'
for CRASH in $(grep -l -i "$1" ~/Library/Logs/DiagnosticReports/*); do
  cp "$CRASH" ~/Desktop/CrashReports/
done
zip -r ~/Desktop/CrashReports.zip ~/Desktop/CrashReports

Save into a file called collectcrashes.sh then chmod +x collectcrashes.sh

You use it like : ./collectcrashes.sh <search_term>

So replace <search_term> with your plugin name.

1 Like

I can crash in the debugger. The only issue is, it’s not in my code

I wondering if it’s not something related to AU property retain as there was an issue like that in the past if I remember correctly.

Oh. :neutral_face:

I just tried one of mine and it was fine to duplicate a track with AUv2 on it (both insert & instrument) in Live 10.

I guess you’re stuck with removing things piece by piece from processor & editor constructors (maybe start by making the editor constructor do nothing, then you’ll at least know which path to take) until it stops crashing. Good luck.

edit: my plugins are using a fork that’s at 6.1.5

I removed the UI, dummy prepareToPlay, onProcessInPlace, getStateInformation, setStateInformation and it’s still crashing…

The interesting thing is that I have
*Live[84328:612261] AudioUnitGetProperty: ioDataSize == 0 on entry

Does this rings a bell to the Juce team ?

I can now reproduce it using the MultiOutSynth plugin demo

Just change

    MultiOutSynth()
        : AudioProcessor (BusesProperties()
                          .withOutput("Main Out", juce::AudioChannelSet::stereo(), true)
                          .withOutput("Out 2", juce::AudioChannelSet::stereo(), true)
                          .withOutput("Out 3", juce::AudioChannelSet::stereo(), true)
                          .withOutput("Out 4", juce::AudioChannelSet::stereo(), true)
                          .withOutput("Out 5", juce::AudioChannelSet::stereo(), true)
                          .withOutput("Out 6", juce::AudioChannelSet::stereo(), true)
                          .withOutput("Out 7", juce::AudioChannelSet::stereo(), true)
                          .withOutput("Out 8", juce::AudioChannelSet::stereo(), true)
                          .withOutput("Out 9", juce::AudioChannelSet::stereo(), true)
                          .withOutput("Out 10", juce::AudioChannelSet::stereo(), true)
                          .withOutput("Out 11", juce::AudioChannelSet::stereo(), true)
                          .withOutput("Out 12", juce::AudioChannelSet::stereo(), true)
                          .withOutput("Out 13", juce::AudioChannelSet::stereo(), true)
                          .withOutput("Out 14", juce::AudioChannelSet::stereo(), true)
                          .withOutput("Out 15", juce::AudioChannelSet::stereo(), true)
                          .withOutput("Out 16", juce::AudioChannelSet::stereo(), true)
                          .withOutput("Out 17", juce::AudioChannelSet::stereo(), true))

and

bool canAddBus    (bool isInput) const override   { return false; }
bool canRemoveBus (bool isInput) const override   { return false; }

Now just add the AUv2 plugin in Live and duplicate the track.
Boom.

1 Like

If I use

bool canAddBus    (bool isInput) const override   { return true; }
bool canRemoveBus (bool isInput) const override   { return true; }

in my plugin, it fixes my issue.
Live issue or something weird in Juce wrapper ?

2 Likes

We’ve also had users experience that bug (and we also have a multi out synth). Would be great to know what the correct course of action is.

If it was a dramatic crash… like it closed ableton.

My personal experience it’s some sort of user parameter attached to the processor.
Or
A real time array or pointer.

The synth I’m working on uses an owned array of custom buffers and I have to put

If(sampleRate > 0) or
If(buffer.getnumchannels() > 0)

Since suspending isn’t an option for me.

Idk, if that helps. I also had to move my convolution to a unique ptr and check itself, because deconstruction would break its internal fft processing

If(uniquepointer != nullptr)

@TypeWriter The issue is not a dangling pointer as it happens in the MultiOutSynth which is very minimal.
It’s only related to canAddBus and canRemoveBus

2 Likes

My bad I re-read the thread with a fresh set of eyes. I assumed it was crashing after the canAddBus or canRemoveBus in the block, with selected bus outputs.

So the main audioProcessor busses are crashing when copied and pasted within an AU within Ableton?
Unless canAddBus or canRemoveBus are overridden.

It seems I was coming from a different angle…
If you were to comment out your block entirely and not override the functions would it still cause the crash?

If so, it is a mishap in the bus array during construction when copied.

Otherwise something wonky is going on with the prepareToPlay and processBlock sequence in Ableton when copied.

That was all I was trying to say, however it seems resolved.

I appreciate the help, but this post is more targeted toward Juce dev as the issue seems to be either in Juce or probably even more in Ableton Live.

1 Like

squeaky wheel gets the grease.

Best of luck,

I just tried reproducing the bug with these changes but I haven’t been successful. I’m using Ableton Live 11 on an M1 mac. I’ll try to reproduce this on an Intel mac tomorrow. Any ideas of what I’m doing wrong?

Have you added as well

bool canAddBus    (bool isInput) const override   { return false; }
bool canRemoveBus (bool isInput) const override   { return false; }

I can reproduce this on my intel machine. I’ll update this thread once I understand the nature of this issue a bit more. Thanks for reporting.

2 Likes

Can you check if the following patch fixes the crash for you?

diff --git a/modules/juce_audio_plugin_client/AU/AudioUnitSDK/AUScopeElement.cpp b/modules/juce_audio_plugin_client/AU/AudioUnitSDK/AUScopeElement.cpp
index 571a24a75..a77f75605 100644
--- a/modules/juce_audio_plugin_client/AU/AudioUnitSDK/AUScopeElement.cpp
+++ b/modules/juce_audio_plugin_client/AU/AudioUnitSDK/AUScopeElement.cpp
@@ -385,7 +385,10 @@ std::vector<AudioUnitElement> AUScope::RestoreElementNames(CFDictionaryRef inNam
                                static_cast<CFStringRef>(CFDictionaryGetValue(inNameDict, keys[i]));
                        if ((elName != nullptr) && (CFGetTypeID(elName) == CFStringGetTypeID())) {
                                AUElement* const element = GetElement(intKey);
-                               if (element != nullptr) {
+                               auto* const currentName = element->GetName().get();
+
+                               if (element != nullptr && (currentName == nullptr
+                                           || CFStringCompare(elName, currentName, 0) != kCFCompareEqualTo)) {
                                        element->SetName(elName);
                                        restoredElements.push_back(intKey);
                                }

You call getName on element and then check for nullptr ?

1 Like