Past couple of days I’ve been seeing some really weird crashes all over the code base.
auto tag = preset->getTag();
availableTags.insert (tag); //This works
// Add description to the set
availableTags.insert (preset->getTag()); //This doesn’t work and crashes.
The crash is happening at juce::StringHolderUtils::release where the ref count is -1, so it looks like the ref count is never being incremented.
We’re using Clion and juce 7 and up to recently we never had this issue. It is happening everywhere in the code base, the code is old and worked for years with no issues. My feeling is that maybe there is some issue with std::make_unique and an sdk update where juce::Strings are not having their ref count updated. But that’s a guess.
Are you able to build and test with Address Sanitizer? If so, please provide a representative trace showing the stack traces of the bad memory access and any relevant allocations.
Have you tried doing a completely clean build? Do the crashes persist afterwards?
Does the behaviour change depending on the build config, Debug vs Release?
Do you see the same kinds of crashes in any of the JUCE examples? If so, is the crash resolved in the same example when building with JUCE 8? If the issue is caused by a bug in JUCE 7 then it may already have been fixed in JUCE 8.
In order to debug the issue ourselves, it would be helpful if you could establish that the issue is still present on the develop branch, then provide steps to repro the issue, either in one of the JUCE examples, or in a minimal blank project.