# JUCE Assertion failure in juce\_NormalisableRange.h:272 (lldb)

**URL:** <https://forum.juce.com/t/juce-assertion-failure-in-juce-normalisablerange-h-272-lldb/32162>\
**Category:** General JUCE discussion\
**Created:** [March 7, 2019, 11:13pm UTC](https://forum.juce.com/t/juce-assertion-failure-in-juce-normalisablerange-h-272-lldb/32162 "2019-03-07T23:13:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rickidemmery](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@rickidemmery](https://forum.juce.com/u/rickidemmery)\
**Post date:** [March 7, 2019, 11:13pm UTC](https://forum.juce.com/t/juce-assertion-failure-in-juce-normalisablerange-h-272-lldb/32162/1 "2019-03-07T23:13:30Z")

</div>

Hi!

Every time I run the Audio Plugin Host in Xcode it immediately quits and I get:

jassert (clampedValue == value);  
JUCE Message Thread (1): EXC\_BREAKPOINT (code=EXC\_I386\_BPT, subcode=0x0)

JUCE Assertion failure in juce\_NormalisableRange.h:272  
(lldb)

It was previously working fine but now just compiling the AudioPluginHost causes a crash. I haven’t altered anything in the code and tried compiling the latest one from GitHub with no success. Is this an Xcode issue? I’m brand new to JUCE and programming in general so excuse me if i’m being stupid.

Cheers!

Ricki

---

<div class="post-metadata">

**Author:** ![alassandro](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/alassandro/32/4297_2.png) [@alassandro](https://forum.juce.com/u/alassandro)\
**Post date:** [March 7, 2019, 11:35pm UTC](https://forum.juce.com/t/juce-assertion-failure-in-juce-normalisablerange-h-272-lldb/32162/2 "2019-03-07T23:35:05Z")

</div>

Note that `jassert()` is a wrapper for the C++ assertion function. It will cause the program to halt just to show you that something isn’t right, but the program can actually continue normally if you choose ‘Continue’ in the debugger.

That specific assertion in `juce::NormalisableRange` is for out of range numbers. This could be due to a parameter range changing, causing saved data to suddenly not be “in-range”. It basically happens any time you try converting a number and the result isn’t between `0.0` and `1.0`.

An example that will make that assertion fire is:

```auto
#include "../JuceLibraryCode/JuceHeader.h"

int main (int argc, char* argv[])
{
    NormalisableRange<float> range(0.0f, 100.0f);
    range.convertTo0to1(-50.0f);
    return 0;
}

```

When the assertion hits, you can use the stack trace view in Xcode’s left panel… the little sandwich looking icon 🙂 It will let you see up the chain of function calls and find where the problem is _really_ occurring.

To take the previous example, the assertion happens in `NormalisableRange::clampTo0To1()`, but the cause of all of it was us calling `NormalisableRange::convertTo0to1()` with an out-of-range number from within our `main()` function:

 ![04%20PM](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/7/771d181f94642ee45d030d2e65c776812efc165b.png)

Not sure why the AudioHost project is causing the assertion to happen… but this should at least help you find the source of the problem!

---

<div class="post-metadata">

**Author:** ![rickidemmery](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@rickidemmery](https://forum.juce.com/u/rickidemmery)\
**Post date:** [March 7, 2019, 11:59pm UTC](https://forum.juce.com/t/juce-assertion-failure-in-juce-normalisablerange-h-272-lldb/32162/3 "2019-03-07T23:59:37Z")

</div>

Looking through the stack trace view, I’ve realized I saved a preset layout within the host which it is trying to load every time I open it. My guess is that there is an issue with the plugin I’ve built, crashing the Plug-in Host.

Is there a preferences file or something that I can trash to get back to the original layout?

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![alassandro](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/alassandro/32/4297_2.png) [@alassandro](https://forum.juce.com/u/alassandro)\
**Post date:** [March 8, 2019, 12:11am UTC](https://forum.juce.com/t/juce-assertion-failure-in-juce-normalisablerange-h-272-lldb/32162/4 "2019-03-08T00:11:10Z")

</div>

Not sure where the host actually keeps that data… but you may be able to just continue in the debugger and eventually the assertion should stop. I’m assuming it’s just trying to set the values once, so it will end up hitting the assertion once for each parameter and then it will be fine.

The continue function for the debugger is available in the menu

![01%20PM](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/f/fabcfc74ae336d6d0148a83eadecd3235c50b9d5.png)

or in the bottom panel (the ‘play’ button right of blue arrow)

![47%20PM](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/a/abb3ac00eef69d4954eaaf9731b013298908f067.png)

---

<div class="post-metadata">

**Author:** ![rickidemmery](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@rickidemmery](https://forum.juce.com/u/rickidemmery)\
**Post date:** [March 8, 2019, 12:19am UTC](https://forum.juce.com/t/juce-assertion-failure-in-juce-normalisablerange-h-272-lldb/32162/5 "2019-03-08T00:19:56Z")

</div>

After clicking the continue button multiple times I was able to get the app running for long enough to save a new layout and it is now working fine.

Once again, thank you!
