[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

gcc2.95, libttf2, xfree86, and Alpha



Due to what appears to be a code generation issue, libttf2 1.4pre.20011029-1 and XFree86 4.2 segfault on Alpha when attempting to render some TrueType fonts.

I have not fully traced this code gen error to the source that triggers it in libttf2, but it appears to be similar to the one in gtk+ where adjacent 'short' fields in a struct get corrupted when writing into one or the other. You can reproduce it by building the source for libttf2 and running the example programs (I used 'ftview 12 Arial.ttf').

Compiling libttf2 without -O2 (without any -O flag) on Alpha works around this problem, as does compiling with gcc-3.0. I would recommend to the libttf2 maintainer to follow one of these courses of action to close this bug. (I'll forward this message to the bug).

The situation in XFree86 is more difficult. This bug is pretty major for X because any attempt to use an affected TrueType font causes the server to exit. This bug has been present for a long time (certainly since XFree86 4.1) and is still present in 4.2. X uses the freetype sources (major version 1, now renamed libttf2 by Debian) directly, building pieces of the library into the libfreetype.a extension module, rather than relying on the library from the package. I can see four ways around the bug for X:

* Modify this extension's build procedure, on Alpha, to not use optimization. We certainly don't want to compile the entire X server without optimization. * Build X with gcc-3.0. I have built the latest experimental XFree86 4.2 packages with gcc-3.0 and they do fix this problem, and seem to work OK. * Get X to switch to freetype 2 (libfreetype6 on Debian). This is a non-trivial change, as the API was completely rewritten. Freetype 2 also has problems on Alpha (e.g. misrendered glyphs) but I have not yet looked into them. * Find the code that triggers this code gen bug and modify it to make the compiler happy. This approach turned out to be unworkable for gtk+ on Alpha because there were other similar failures.

Comments?

-Doug



Reply to: