RFR: 8338478: [macos] Crash in CoreText with certain strings using JDK 22 or later

Kevin Rushforth kcr at openjdk.org
Mon Aug 19 13:48:58 UTC 2024


On Sat, 17 Aug 2024 21:02:59 GMT, Phil Race <prr at openjdk.org> wrote:

> The test in the bug report crashes reliably with JDK 22 on retina.
> It coincides with an update to the macOS compilers which seem likely to eagerly invalidate the target of a CFRelease on the native CTFontRef.
> Adding a ReachabilityFence to prevent the GC from collecting CTFontStrike until after the method has finished using the native fontRef from the strike fixes it.
> The same pattern is observed in 3 other methods (although no crash)  and a fence is added there too.
> 
> There is an existing test, which is how this problem was found.

The code changes look good.

All my testing is as expected: PangoTest fails (crashes) without the fix and passes with the fix on my M1 running macOS 14.5. The CoreTextCrash program attached to the JBS bug crashes without the fix and passes with the fix on both my M1 and on my Intel Mac running macOS 13.6.9.

-------------

Marked as reviewed by kcr (Lead).

PR Review: https://git.openjdk.org/jfx/pull/1537#pullrequestreview-2245598099


More information about the openjfx-dev mailing list