I’m using AudioVisualizerComponent for an oscilloscope, and a simple FFT graphing component. I’m getting intermittent run time errors, where calling Graphics::strokePath has an assertion failure (both x and y values are NaN). Here’s my stack trace:
#0 0x0000000100284e76 in juce::Path::startNewSubPath(float, float)
#1 0x00000001002febe3 in juce::PathStrokeHelpers::addSubPath(juce::Path&, juce::Array<juce::PathStrokeHelpers::LineSection, juce::DummyCriticalSection, 0>&, bool, float, float, juce::PathStrokeType::JointStyle, juce::PathStrokeType::EndCapStyle, juce::PathStrokeHelpers::Arrowhead const*)
#2 0x000000010028c739 in juce::PathStrokeHelpers::createStroke(float, juce::PathStrokeType::JointStyle, juce::PathStrokeType::EndCapStyle, juce::Path&, juce::Path const&, juce::AffineTransform const&, float, juce::PathStrokeHelpers::Arrowhead const*)
#3 0x000000010028c196 in juce::PathStrokeType::createStrokedPath(juce::Path&, juce::Path const&, juce::AffineTransform const&, float) const
#4 0x0000000100290c22 in juce::Graphics::strokePath(juce::Path const&, juce::PathStrokeType const&, juce::AffineTransform const&) const
I cannot reproduce the assertion failure every time I run my app, it happens about 40% of the time.
When compiling with optimizations I get the following error printed to the console:
<Error>: Error: this application, or a library it uses, has passed an invalid numeric value (NaN, or not-a-number) to CoreGraphics API and this value is being ignored.Please fix this problem.
I have verified that I’m not passing any NaN or Inf values to Path::startNewSubpath or Path::lineTo (the only path functions I’m using). Any suggestions on how to debug this problem, or what might be causing it?

