Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 57796 - Freetype 2.1.9 causes Mozilla and Firefox to crash when viewing some sites.
Summary: Freetype 2.1.9 causes Mozilla and Firefox to crash when viewing some sites.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: x86 Linux
: Normal major (vote)
Assignee: Gentoo X packagers
URL: https://freedesktop.org/bugzilla/show...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-20 19:27 UTC by Chris Smith
Modified: 2005-11-20 11:15 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Fix to the problem =) (fix_xftint.h.patch,781 bytes, patch)
2004-08-14 08:45 UTC, Ronald Hummelink
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Smith 2004-07-20 19:27:14 UTC
http://www.theregister.com/ will cause Firefox to crash after upgrading Freetype to 2.1.9. Downgrading to 2.1.7. resolves issue.

Reproducible: Always
Steps to Reproduce:
1.emerge =freetype-2.1.9
2.open http://www.theregister.com/ with Firefox
3.Application crashes

Actual Results:  
Application crashes

Expected Results:  
Properly display page.

xorg
nvidia
Comment 1 Chris Smith 2004-07-22 14:58:18 UTC
This now appears to be isolated to web pages requesting the Helvetica font. When Mozilla/Firefox attempts to render Helvetica with Freetype 2.1.9 it crashes.
Comment 2 Aaron Gyes 2004-07-22 15:15:19 UTC
Me too, with Epiphany.
Comment 3 Ronald Hummelink 2004-07-27 18:09:22 UTC
If I revert this patch:

http://cvs.freetype.org/cgi-bin/viewcvs.cgi/freetype2/src/pcf/pcfdrivr.c.diff?r1=1.7&r2=1.8

I seem to end up with a stable freetype.

However, i'm unable to properly judge the side effects of backing out this patch.
Comment 4 foser (RETIRED) gentoo-dev 2004-08-03 06:46:21 UTC
This is not a mozilla problem, but a problem with xorg-x11 xft in combination with freetype >2.1.7 (which is in p.mask).

We are looking into this problem.
Comment 5 Ronald Hummelink 2004-08-03 08:08:23 UTC
Surely its not a mozilla specific problem, pcf fonts are definetly involved though:

I'm too inexperienced with this to see why reverting the patch above makes the stuff stable, the backtrace doesn't seem to go to libfreetype as yet, but then, i can be mistaken because i hardly know what to look at.

louise ~ # gdb gnome-font-viewer
GNU gdb 6.1.1
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) run file:///usr/share/fonts/75dpi/courB12-ISO8859-1.pcf.gz
Starting program: /usr/bin/gnome-font-viewer file:///usr/share/fonts/75dpi/courB12-ISO8859-1.pcf.gz
[Thread debugging using libthread_db enabled]
[New Thread 1088303808 (LWP 29894)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1088303808 (LWP 29894)]
0x40ab1263 in strlen () from /lib/libc.so.6
(gdb) bt
#0  0x40ab1263 in strlen () from /lib/libc.so.6
#1  0x40037a00 in _XftReleaseFile (f=0x811e498) at xftfreetype.c:292
#2  0x40038db7 in XftFontOpenPattern (dpy=0x805b980, pattern=0x0) at xftfreetype.c:1020
#3  0x0804b169 in main (argc=2, argv=0xbffff4d4) at font-view.c:68
Comment 6 Donnie Berkholz (RETIRED) gentoo-dev 2004-08-03 20:08:29 UTC
What happens if you recompile and restart X after upgrading freetype?
Comment 7 Ronald Hummelink 2004-08-04 00:35:52 UTC
Still segfaults gnome font viewer the very same way.
Comment 8 Ronald Hummelink 2004-08-04 01:07:00 UTC
The problem lies solely in Xft

Xft CVS from xlibs.freedesktop.org fixes it.

see also the last bit on the freetype devel maillist (their archives were broken until recently)

Comment 9 Donnie Berkholz (RETIRED) gentoo-dev 2004-08-04 16:39:06 UTC
The problem does not lie solely with Xft, as foser and I have discussed outside of this bug. The external Xft that fixes things is _exactly_ the same code as the Xft within 6.7.0 release. Something else is happening.

What I can confirm is that neither the freetype nor the fontconfig included within the monolithic X (xorg-x11 in this case) are built. It seems possible, however, that the Xft within the monolithic X (wrongly) uses freetype/fontconfig includes from within the build rather than the system ones.
Comment 10 Donnie Berkholz (RETIRED) gentoo-dev 2004-08-04 16:42:49 UTC
The above is assuming this is the same bug foser and I discussed, which may not be the case. But please diff *.[ch] files in xc/lib/Xft/ with your CVS checkout of Xft.
Comment 11 Ronald Hummelink 2004-08-04 18:23:32 UTC
I can drop external libXft all the way down to 2.1.3 and up to CVS HEAD and see no segfaults.

the .h files between xorg Xft and libXft 2.1.6 do not differ (cept a cvs comment in Xft.h)
the .c files do not differ, except for xftfreetype.c. Difference are not huge, and more significantly, I can use the xorg version of this file in the external lib install and /not/ get segfaults.
Visa versa, using xftfreetpe.c from the 2.1.6 release doesn't fix segfault when build in the xorg tree.


I did some semi senseless hacking.

I took 2.1.6 libXft release and build it.

using the gcc command that links up libXft.so.2.1.2 one by one i replaced the .o files with the .o files from a build-by-portage xorg/Xft tree. segfaults started  after it started using the xftfreetype.o build by xorg tree.

Appears to me /something/ in the building of xftfreetype.o by the xorg tree introduces an error.
Comment 12 Donnie Berkholz (RETIRED) gentoo-dev 2004-08-04 18:34:25 UTC
Might be worth diffing the generated Makefiles and looking for something significant. Nice work so far. Did you keep substituting in the rest of the files after finding that xftfreetype.o broke it? It sounds a little like once you hit one breakage, you stopped. There could be many.
Comment 13 Donnie Berkholz (RETIRED) gentoo-dev 2004-08-04 18:40:18 UTC
Also, from xorg@freedesktop.org list:

> Appearantly there was a problem between 2.1.6 and 2.1.7 and there
> are indications that there also is a problem between 2.1.7 and 2.1.8.

Anything built with 2.1.6 would segfault when started with 2.1.7,
because the ABI was silently changed.
Comment 14 Donnie Berkholz (RETIRED) gentoo-dev 2004-08-04 19:04:07 UTC
It might be worth trying xorg CVS. A bunch of stuff related to its semi-broken freetype has been committed in the last couple of days. You can probably leave the host.def blank -- I think the defaults are about what we want. The xc/BUILD document details what you need, but basically 'make World' and 'make install DESTDIR=/path/to/some/empty/location.' By the way, relative paths don't work for the install -- gotta be absolute.
Comment 15 Ronald Hummelink 2004-08-04 22:09:21 UTC
RE 12:

Replaced one by one using more and more of the xorg .o files. didn't try individually.

Diffing the makefiles is next to useless. The xorg ones are made by Imake, the seperate tree by autoconf; sizes differ massively.

I did keep logs of the build in only the Xft subdir, if you have interest in them i can post them tonight.
Comment 16 Ronald Hummelink 2004-08-04 22:14:17 UTC
Note: I also generated the full preprocessed version of xftfreetype.c in both trees manually. Sizes differ marginally between the 2 trees at ~310K, but when diffed there is huge differences. Some .h's seem to be taken from the internal tree, where the standalone takes them from system, but this may be legitimate still... need to investigate more.

Still feel there may be a buildsystem bug (why oh why does Keith want to autotool this stuff so much ;-) )
Comment 17 Donnie Berkholz (RETIRED) gentoo-dev 2004-08-05 21:10:18 UTC
I've got build logs too. What I don't have right now is time to analyze them closely. So that's what would be excellent for you to do. If you cared to attach a diff of the preprocessed files, that may also be helpful. With accompanying analysis, of course. =)
Comment 18 Donnie Berkholz (RETIRED) gentoo-dev 2004-08-12 15:01:27 UTC
https://freedesktop.org/bugzilla/show_bug.cgi?id=1047
Comment 19 Ronald Hummelink 2004-08-13 05:32:40 UTC
Rebuild Xorg 6.7.0-r2 but added the patch to xftfreetype.c from xlibs cvs.

Doesn't fix segfaulting for me. Installing stand alone libXft on top still does.
Comment 20 Donnie Berkholz (RETIRED) gentoo-dev 2004-08-13 15:13:59 UTC
Sorry, bad link. https://freedesktop.org/bugzilla/show_bug.cgi?id=1062
Comment 21 Ronald Hummelink 2004-08-14 08:45:26 UTC
Created attachment 37427 [details, diff]
Fix to the problem =)

Applied this patch in local overlay for xorg-x11 and no longer get the infamous
crashers ;-)
Comment 22 Donnie Berkholz (RETIRED) gentoo-dev 2004-10-07 16:51:46 UTC
Please reopen if this isn't fixed in 6.8.
Comment 23 Joshua Baergen (RETIRED) gentoo-dev 2005-11-20 11:14:52 UTC
This should be fixed in all current X versions.
Comment 24 Joshua Baergen (RETIRED) gentoo-dev 2005-11-20 11:15:04 UTC
Fixed.