RFR: 8246348: Crash in libpango on Ubuntu 20.04 with some unicode chars

Kevin Rushforth kcr at openjdk.java.net
Thu Jun 11 00:20:01 UTC 2020

On Tue, 9 Jun 2020 19:33:01 GMT, Johan Vos <jvos at openjdk.org> wrote:

> This addresses https://bugs.openjdk.java.net/browse/JDK-8246348

modules/javafx.graphics/src/main/java/com/sun/javafx/font/freetype/PangoGlyphLayout.java line 87:

> 86:
> 87:     private Map<TextRun, Long> runUtf8 = new HashMap<>();
> 88:     public void layout(TextRun run, PGFont font, FontStrike strike, char[] text) {

In order for this to work, each TextRun would need to be immutable (at least during the life of this PangoGlyphLayout)
and there would need to be a 1-1 mapping between the TextRun and the string pointer, independent of anything else. Is
this the case? I'm seeing some crashes in OSPango.g_utf8_offset_to_pointer when testing. I don't know if they are
related to this or not.

modules/javafx.graphics/src/main/java/com/sun/javafx/font/freetype/PangoGlyphLayout.java line 90:

> 89:         for (char c: text) {
> 90:             if (c == 0) c = '\f';
> 91:         }

This won't actually do anything (it just sets a local variable that immediately goes out of scope). I don't think that
we want to modify the array itself, so you will probably want to make a copy of the array in the case there is a '0'

As for what to replace the '0' char with, maybe a space? @prrace can probably suggest something.


PR: https://git.openjdk.java.net/jfx/pull/249

More information about the openjfx-dev mailing list