Crashes in SimpleShapedText

I’ve got reports from a user experiencing crashes in SimpleShapedText which I can’t replicate. They’re on an M2 Mac same as me and as I’m symbolicating with atos, I don’t know the problematic string.

juce::detail::Shaper::getChunksUpToNextSafeBreak(long long) (in Waveform 13) (allocator.h:0)
juce::detail::Shaper::getChunksUpToNextSafeBreak(long long) (in Waveform 13) (juce_SimpleShapedText.cpp:1018)
juce::detail::SimpleShapedText::SimpleShapedText(juce::String const*, juce::detail::ShapedTextOptions const&) (in Waveform 13) (juce_SimpleShapedText.cpp:118)
juce::detail::ShapedText::Impl* std::__1::construct_at[abi:fe180100]<juce::detail::ShapedText::Impl, juce::String, juce::detail::ShapedTextOptions, juce::detail::ShapedText::Impl*>(juce::detail::ShapedText::Impl*, juce::String&&, juce::detail::ShapedTextOptions&&) (in Waveform 13) (construct_at.h:41)
juce::detail::ShapedText::ShapedText(juce::String, juce::detail::ShapedTextOptions) (in Waveform 13) (juce_ShapedText.cpp:160)
juce::GlyphArrangement::addCurtailedLineOfText(juce::Font const&, juce::String const&, float, float, float, bool) (in Waveform 13) (juce_GlyphArrangement.cpp:216)
juce::GlyphArrangement::getStringBounds(juce::Font const&, juce::StringRef) (in Waveform 13) (juce_GlyphArrangement.h:322)

Has anyone else seen anything similar or understand where this could be going wrong?
Or even has any idea how to replicate?
Thanks.

Spurred by this thread, we did some fuzzing tests with asan and found two crashes. One of them produced a stack trace very similar to the one you shared, so here’s hoping that the underlying issue for your crash is also fixed.

Thanks! That does look like it could be it.
I’ll do a build to send to the user and let you know if it worked.

Sounds like this does work for my user so many thanks for this!

I was going to try some fuzzing but never got around to it.
Did you just do it using juce::Random or a fuzzing framework?

Yes, just juce::Random making random Unicode codepoint sequences, and feeding it into ShapedText.

1 Like

Yep all of a sudden after upgrading to Juce 8.07 I am getting the same thing;

Ok here is something new to Juce 8.07. I’m now suddenly getting an error in juce_SimpleShapedText.cpp, caused by hovering over a knob with the following tooltip text, I even edited it down to only a few characters;

"typeSwitch.setTooltip(“Waveshaper Type\n\n\34 wave shaping algorithms”);"

Why will it not parse the above text correctly? I never had any problem with this, unchanged since Juce 5!

See screenshot of error;