Issue with AUv3 Plugin Causing Host Crashes Due to Extreme Parameter Range

Hi JUCE Team,

One of our users reported that the AUv3 plugin Neon by Aaron Meyers causes our Host to crash. After debugging, I traced the issue to a problematic parameter in Neon that has an extremely large discrete range:

-Min value: 0
-Max value: 9e+18
-Num steps: 9e+18 (due to discrete = true)

This causes AudioProcessorParameter::getAllValueStrings() to crash because it attempts to iterate over an impractically large range (9e+18 steps), which is impossible to handle.

  1. The issue reproduces in JUCE’s Audio Plugin Host as well, confirming it’s not specific to our Host.
  2. The crash occurs when getAllValueStrings() iterates from 0 to getNumSteps() - 1 (9e+18).
  3. Other hosts (non-JUCE-based) seem to handle this parameter correctly.
StringArray AudioProcessorParameter::getAllValueStrings() const
{
    if (isDiscrete() && valueStrings.isEmpty())
    {
        auto maxIndex = getNumSteps() - 1;

        for (int i = 0; i < getNumSteps(); ++i)
            valueStrings.add (getText ((float) i / (float) maxIndex, 1024));
    }

    return valueStrings;
}

Has anyone else run into this kind of issue before?

Best,
Samuele

It’s ridiculous to use a Discrete parameter for a range that large. Why would you need that? If they want only integers, then using a step value of 1.0 would be a better choice. You could protect your host by changing it to not be discrete when the number of steps is greater than some reasonable value. Or contact the vendor and report it as a bug in their plugin.

1 Like

Hosts shouldn’t crash because of plugin mistakes. A cap on the number of discrete steps is reasonable.

Thanks for the suggestions.

I completely agree that hosts should handle plugin quirks more robustly. Before making any changes to JUCE’s modules, I would check with their team to see if this is a known issue and whether they have a recommended fix or workaround in place.

If JUCE doesn’t have a solution yet, I’ll implement a safeguard in my host to prevent crashes. Meanwhile, I’ll also report the issue to the plugin vendor.

Please could you clarify the behaviour you’re seeing? Do you get an actual crash (segfault or similar, host immediately quits), or does the host just become unresponsive, or something else?

I tried modifying one of the demo plugins to add a discrete parameter with lots of steps. This caused the AudioPluginHost to become unresponsive, but it didn’t crash.

I’ve attached a patch that fixes the unresponsiveness for me. I haven’t tested Neon itself because it’s a paid download. Please could you try applying this patch on the develop branch and check whether it resolves the issues you were seeing with this plugin?

au-param-steps.patch (4.7 KB)

The above change seems worthwhile, even if it doesn’t completely resolve the issues you were seeing, so it’s been merged to develop here:

We’ve also pushed a similar change that prevents the GenericAudioProcessorEditor from querying huge numbers of parameter strings:

Please let us know if you still encounter issues after updating.

Hi Reuk,

Thanks for resolving this! I tested the fix and it seems to work now.

I’ll keep you updated if anything comes up in the next few days.

Appreciate your support!

Best,
Samuele

1 Like