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

Johan Vos jvos at openjdk.java.net
Thu Jun 11 13:28:51 UTC 2020

On Thu, 11 Jun 2020 00:30:55 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> 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'
>> character.  As for what to replace the '0' char with, maybe a space? @prrace can probably suggest something.
> Interestingly enough, I don't see a crash due to the 0 character, but I am seeing some new assertion warnings expecting
> `length >= 0` even in cases where there isn't a 0 character.

I saw that assertion as well, but that can come from cases where empty TextRun instances are used (start == end). In
that case, the length is 0, which pango considers silly, but it won't crash on that (the content array is never
examined in that case)


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

More information about the openjfx-dev mailing list