Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Metrics window infinite recursion(?) and segfault with complicated GSUB feature #1138
The metrics window seems to go nuts when processing a complicated GSUB feature. I'm not sure exactly what the circumstances are that trigger this, and my example isn't a very clean one, but here's a crash that's reliably reproducible on my 64-bit Linux with the current Git master version:
I tried to collect a stack backtrace, but gave up after 30000 stack frames. It looks like there is some chunk of GUI code going through infinite recursion involving creating a text box or something. Eventually, after a surprisingly long time under the circumstances, it can't expand the stack any further and dies.
The characters in my example, U+1100 U+AC00 U+11A8, are a bit special, which is why I couldn't type some of them directly into this report. Unicode provides more than one way of writing Korean. The most popular way of doing it is with single code points that represent entire syllables; U+AC00 is "GA" and U+AE4D is "GGAG", both of which are allowed as syllables in Korean. However, there are also code points for individual letters and various combinations of letters, so that the same "GGAG" syllable could be spelled U+1101 U+1161 U+1148 ("GG/A/G"), and it's possible to have a lengthy discussion of to what extent it is or isn't okay to mix the different ways of forming syllables (for instance, "GG/A/G" is preferred over "G/G/A/G", and it's questionable whether the latter should be allowed at all). We are having that discussion now on the HarfBuzz mailing list, which is how I discovered this bug in FontForge. The sequence U+1100 U+AC00 U+1148 ("G/GA/G") is pushing the boundaries of what Unicode will allow, but the font in my example contains unfinished experimental substitution tables intended to convert that sequence into a single glyph equivalent to U+AE4D ("GGAG"), by means of several cascading lookups in the ccmp and liga features. And FontForge breaks on those substitutions.