Bug: MacOS Fonts causing other GUIs to crash

We’ve had several reports recently that our plug-ins have been causing iZotope’s plug-ins to crash when their GUIs are opened (somewhere below [NSView _setWindow:], according to the crash log).

This seems to be caused by us loading fonts from memory, and removing the call to CTFontManagerRegisterGraphicsFont here is the only way to resolve the crash.

Looking at the code there, I believe it’s only recently become an issue as we have increased our minimum supported MacOS version to 10.8, which has triggered these calls to begin in new builds.

Is there any chance this could be a JUCE bug, or is it more likely to be an OSX bug?

1 Like

The line you suggest removing appears to be relatively new (2 years). Did you try to bisect and see if it used to be fine and the problem was caused by recent changes?

1 Like

From what I’ve seen so far this has been an issue since the code was reformatted to support the MacOS font manager (as you say, about two years ago). As I mentioned above, it’s only started to manifest now because we’ve updated our minimum OS requirement to 10.8, which satisfies the pre-processor definition wrapping up the code in question.

I’m starting to suspect there may be something simple going on like we’re registering the same fonts (Source Sans Pro is the one causing an issue, but I have yet to test with other fonts we have available) and MacOS doesn’t like it. Because Apple. There could also be a clash with the SDK we’re compiling against. We are using 10.15 SDK, iZotope are using 10.13 SDK.

So there are a few other things with this specific case I can investigate, but I was rather hoping this was something the guys at JUCE would know more about than me and would have a better idea about what could be going wrong.

Sure, but if possible I’d recommend going the extra mile when reporting bugs, it will increase your chances on getting the fix sooner and will help point the JUCE team in the right direction.

1 Like

I’ve been struggling with font crashes for a few years as well, I think there are a few other threads about it like: Occasional glyph crash and Typeface::createSystemTypefaceFor Leaks on Mac

The issue I see is that glyphs start randomly disappearing / getting scrambled and then shortly after the program crashes. Only caused by using memory font on macOS.

I’ve spent a decent amount of time looking into it, never been able to find the cause.

3 Likes

I’ve quickly put together a test repository which demonstrates this crash:

1 Like