Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 60470 - xorg-x11-6.7.99.903 causes ttmkfdir to segfault
Summary: xorg-x11-6.7.99.903 causes ttmkfdir to segfault
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
: 61345 62098 (view as bug list)
Depends on:
Blocks: 60292
  Show dependency tree
 
Reported: 2004-08-15 14:00 UTC by SpanKY
Modified: 2004-09-04 10:20 UTC (History)
6 users (show)

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


Attachments
strace-out (strace-out,44.15 KB, text/plain)
2004-08-15 14:12 UTC, SpanKY
Details
correct some encoding from xorg (correct-encoding.patch,2.55 KB, patch)
2004-08-25 14:44 UTC, Benoit Boissinot
Details | Diff
patch for ttmkfdir, it now checks the bound, and we avoid segfault (ttmkfdir-3.0.9-encoding.patch,634 bytes, patch)
2004-08-25 17:51 UTC, Benoit Boissinot
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description SpanKY gentoo-dev 2004-08-15 14:00:09 UTC
tested on two diff machines (one with gcc-3.3.x and one with gcc-3.4.x) and both times this happened

root@phear 0 ~ # /etc/init.d/xfs restart
 * Stopping X Font Server...                                        [ ok ]
 * Scanning font directories...                                     [ ok ]
 * Indexing font directories...
 *   /usr/share/fonts/75dpi...                                      [ ok ]
 *   /usr/share/fonts/100dpi...                                     [ ok ]
 *   /usr/share/fonts/misc...                                       [ ok ]
 *   /usr/share/fonts/Type1...                                      [ ok ]
 *   /usr/share/fonts/Speedo...                                     [ ok ]
 *   /usr/share/fonts/util...                                       [ ok ]
 *   /usr/share/fonts/local...                                      [ ok ]
 *   /usr/share/fonts/TTF...
/etc/init.d/xfs: line 230: 25681 Segmentation fault      /usr/X11R6/bin/ttmkfdir -x 2 -e /usr/share/fonts/encodings/encodings.dir -o ${x}/fonts.scale -d ${x} >/dev/null                                                [ ok ]
 * Updating FC cache...                                             [ ok ]
 * Starting X Font Server...                                        [ ok ]

root@phear 0 vapier # /usr/X11R6/bin/ttmkfdir -x 2 -e /usr/share/fonts/encodings/encodings.dir -o /usr/share/fonts/TTF/fonts.scale -d /usr/share/fonts/TTF
Segmentation fault
Comment 1 SpanKY gentoo-dev 2004-08-15 14:02:06 UTC
Portage 2.0.51_pre17 (default-linux/x86/2004.0, gcc-3.3.4, glibc-2.3.4.20040808-r0, 2.6.7 i686 AMD Athlon(tm) Processor)             
=================================================================
System uname: 2.6.7 i686 AMD Athlon(tm) Processor
Gentoo Base System version 1.5.2
distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.14.90.0.8-r1
Headers:  sys-kernel/linux26-headers-2.6.7-r4
Libtools: sys-devel/libtool-1.5.6
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-tbird -O2 -pipe -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/alias /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-tbird -O2 -pipe -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache noauto noinfo sandbox sfperms"
GENTOO_MIRRORS=" http://gentoo.oregonstate.edu/ http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://gentoo/gentoo-portage"
USE="3dnow acl acpi adns apache2 caps cdr crypt curl dedicated dvd dvdr esd ethereal fam gd gd-external gif gpm imap imlib imlib2 ipv6 joystick jpeg maildir mikmod mmx mpeg mysql ncurses nocardbus nptl offensive oggvorbis pam pdflib perl pic png pnp prelude python readline samba sasl sdl skey socks5 ssl tcpd truetype x86 xml xml2 xv zlib video_cards_radoen"
Comment 2 SpanKY gentoo-dev 2004-08-15 14:09:23 UTC
more notes:

rebuilding ttmkfdir doesnt fix anything

rebuilding freetype-2.x does not fix anything

just downgrading to 6.7.0-r2 and segfaults stop
Comment 3 SpanKY gentoo-dev 2004-08-15 14:11:55 UTC
gdb isnt too helpful:

root@phear 0 vapier # gdb --args /usr/X11R6/bin/ttmkfdir -x 2 -e /usr/share/fonts/encodings/encodings.dir -o /usr/share/fonts/TTF/fonts.scale -d /usr/share/fonts/TTF
(no debugging symbols found)...Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run
Starting program: /usr/X11R6/bin/ttmkfdir -x 2 -e /usr/share/fonts/encodings/encodings.dir -o /usr/share/fonts/TTF/fonts.scale -d /usr/share/fonts/TTF
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x08056e1f in std::operator+<char, std::char_traits<char>, std::allocator<char> > ()
(gdb) bt
#0  0x08056e1f in std::operator+<char, std::char_traits<char>, std::allocator<char> > ()
#1  0x08055545 in std::operator+<char, std::char_traits<char>, std::allocator<char> > ()
#2  0x08055651 in std::operator+<char, std::char_traits<char>, std::allocator<char> > ()
#3  0x08052ee1 in std::operator+<char, std::char_traits<char>, std::allocator<char> > ()
#4  0x08050bd4 in std::operator+<char, std::char_traits<char>, std::allocator<char> > ()
#5  0x0804ab24 in ?? ()
#6  0x401a5f6e in __libc_start_main () from /lib/libc.so.6
#7  0x08049f21 in ?? ()
Comment 4 SpanKY gentoo-dev 2004-08-15 14:12:41 UTC
Created attachment 37496 [details]
strace-out

strace summary, but again not too helpful
`strace -f -s 4096 -o strace-out`
Comment 5 Ferris McCormick (RETIRED) gentoo-dev 2004-08-20 05:57:29 UTC
Also on sparc.  Adding sparc to CC list.
Comment 6 Donnie Berkholz (RETIRED) gentoo-dev 2004-08-21 22:28:48 UTC
Try downgrading ttmkfdir from 3.0.9-r1 to 3.0.9.
Comment 7 Arnaud Boudou 2004-08-22 02:22:15 UTC
I have the same problem (ttmkfdir segfaults) here while emerging xorg-x11-6.7.99.902 with ttmkfdir-3.0.9-r1

I downgraded to ttmkfdir-3.0.9 and the message error is now different :

gzip: stdout: Broken pipe
/usr/portage/x11-base/xorg-x11/xorg-x11-6.7.99.902.ebuild: line 1126: 11467 Erreur de segmentation  LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${ROOT}/usr/X11R6/lib" ${ROOT}/usr/X11R6/bin/ttmkfdir -x 2 -e ${ROOT}/usr/share/fonts/encodings/encodings.dir -o ${x}/fonts.scale -d ${x}

I get this for these paths : /usr/share/fonts/corefonts , /usr/share/fonts/kochi-substitute and /usr/share/fonts/TTF
Comment 8 Donnie Berkholz (RETIRED) gentoo-dev 2004-08-23 14:37:13 UTC
*** Bug 61345 has been marked as a duplicate of this bug. ***
Comment 9 Donnie Berkholz (RETIRED) gentoo-dev 2004-08-24 23:45:58 UTC
Delete /usr/share/fonts/encodings/large/cns* and /usr/share/fonts/encodings/suneu-greek*. Then run:

/ttmkfdir -x 2 -e /usr/share/fonts/encodings/encodings.dir \
-o /usr/share/fonts/TTF/fonts.scale -d /usr/share/fonts/TTF
Comment 10 Donnie Berkholz (RETIRED) gentoo-dev 2004-08-24 23:46:58 UTC
sorry. ttmkfdir, not /ttmkfdir.
Comment 11 Arnaud Boudou 2004-08-25 01:19:42 UTC
That works for me, thanks for your help.
Comment 12 Donnie Berkholz (RETIRED) gentoo-dev 2004-08-25 01:38:00 UTC
All it took was:
1) Run strace, see which encoding it was on when it hit the segfault
2) Remove encoding
3) Repeat until there are no more segfaults
Comment 13 Ferris McCormick (RETIRED) gentoo-dev 2004-08-25 04:46:46 UTC
Worked for me on sparc.
Comment 14 SpanKY gentoo-dev 2004-08-25 07:47:33 UTC
that's a work around but in reality, this sucker shouldnt be segfaulting ... especially when people (like me) know nothing about font caching ... i have no idea what files are safe to delete and what files are generated on the fly ...

also, punting the cache files made my ttmkdir stop segfaulting
Comment 15 Benoit Boissinot 2004-08-25 08:21:12 UTC
This is the UNDEFINE that makes ttmkfdir segfault, maybe the number are wrong or something like this.

See this cvs entry from xorg : http://freedesktop.org/cgi-bin/viewcvs.cgi/xc/fonts/encodings/large/cns11643-1.enc?rev=1.2&root=xorg&view=log

unfortunately i cannot access the bugzilla from freedesktop at the moment...
Comment 16 Benoit Boissinot 2004-08-25 08:33:32 UTC
The bug that made this encoding into xorg :
http://freedesktop.org/bugzilla/show_bug.cgi?id=304

those encoding seem to be used only in solaris...
Comment 17 Donnie Berkholz (RETIRED) gentoo-dev 2004-08-25 13:05:11 UTC
I've committed the workaround. If anyone has a better fix (such as one that allows us to fix the encodings and keep them), please add it to this bug and reopen the bug.
Comment 18 Benoit Boissinot 2004-08-25 14:44:53 UTC
Created attachment 38208 [details, diff]
correct some encoding from xorg

This patch correct the 'UNDEFINE' statement from some encoding, since they
shouldn't be greater than the 'SIZE' of the encoding.
Comment 19 Benoit Boissinot 2004-08-25 17:51:44 UTC
Created attachment 38215 [details, diff]
patch for ttmkfdir, it now checks the bound, and we avoid segfault

I thought it could be good to correct ttmkfdir too, since i don't know if the
incriminated encodings were valid or not.
Comment 20 Seemant Kulleen (RETIRED) gentoo-dev 2004-08-29 11:39:08 UTC
*** Bug 62098 has been marked as a duplicate of this bug. ***
Comment 21 Seemant Kulleen (RETIRED) gentoo-dev 2004-08-29 11:51:00 UTC
um, who closed this bug
Comment 22 Donnie Berkholz (RETIRED) gentoo-dev 2004-08-29 22:14:56 UTC
Can't be an exact dup, probably different encodings causing it to segfault. Someone will need to run the same test I detailed in comment #12 to find the broken ones. Then they can be either fixed or temporarily deleted pending fixes as the first three were.
Comment 23 Priit Laes (IRC: plaes) 2004-08-30 01:02:18 UTC
after doing like #12 said, I the encodings causing the segfault were:
large/cns11643-1.enc.gz
large/cns11643-2.enc.gz
large/cns11643-3.enc.gz
suneu-greek.enc.gz

Hmm.. and they seem to be all in the xorg cvs commit...
Comment 24 Seemant Kulleen (RETIRED) gentoo-dev 2004-09-04 10:20:14 UTC
fixed in 904