Grepping back through the logs, it appears this same segfault has been happening since November 29, but didn't occur yet on November 22, see below. During the post-install of xorg-x11 the following occurs: * Generating encodings.dir...... [ ok ] 11:15:27.625333000 * Creating fonts.scale files...... /usr/local/portage/x11-base/xorg-x11/xorg-x11-6.8.1.904.ebuild: line 1800: 10355 Segmentation fault LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${ROOT}/usr/$(get_libdir)" ${ROOT}/usr/bin/ttmkfdir -x 2 -e ${ROOT}/usr/share/fonts/encodings/encodings.dir -o ${x}/fonts.scale -d ${x} [ ok ] 11:15:33.530538000 * Generating fonts.dir files...... [ ok ] 11:15:44.378154000 (This is a local overlay which just inserts the latest unichrome files in ${S}/programs/Xserver/hw/xfree86/drivers/via, nothing else.) The essential difference between the mentioned logs seems to be this: --- 2445-xorg-x11-6.8.0-r3.log 2004-11-22 16:37:22.000000000 +0100 +++ 2616-xorg-x11-6.8.0-r3.log 2004-11-29 15:29:51.000000000 +0100 @@ -50763,11 +50763,6 @@ make[4]: Entering directory `/var/tmp/portage/xorg-x11-6.8.0-r3/work/xc/lib/font/stubs' make[4]: Nothing to be done for `all'. make[4]: Leaving directory `/var/tmp/portage/xorg-x11-6.8.0-r3/work/xc/lib/font/stubs' -rm -f libXfont.a -ar clq libXfont.a bitmap/unshared/?*.o fontfile/unshared/?*.o fc/unshared/?*.o Type1/unshared/?*.o FreeType/unshared/?*.o util/unshared/?*.o -ranlib libXfont.a -rm -f ../../exports/lib/libXfont.a -cd ../../exports/lib && ln -s ../../lib/font/libXfont.a . install -c -m 0644 libXfont.a /var/tmp/portage/xorg-x11-6.8.0-r3/image//usr/X11R6/lib ranlib /var/tmp/portage/xorg-x11-6.8.0-r3/image//usr/X11R6/lib/libXfont.a install -c -m 0755 libXfont.so.1.5 /var/tmp/portage/xorg-x11-6.8.0-r3/image//usr/X11R6/lib @@ -51418,8 +51413,6 @@ making all in programs/xedit/lisp/re... make[5]: Entering directory `/var/tmp/portage/xorg-x11-6.8.0-r3/work/xc/programs/xedit/lisp/re' make[5]: Leaving directory `/var/tmp/portage/xorg-x11-6.8.0-r3/work/xc/programs/xedit/lisp/re' -rm -f lsp -gcc -o lsp -march=athlon-xp -pipe -fomit-frame-pointer -O2 -mno-sse2 -fno-strict-aliasing -ansi -pedantic -Wno-return-type -w -L../../../exports/lib lsp.o -L. -llisp -Lmp -lmp -Lre -lre -lm -Wl,-rpath-link,../../../exports/lib make[4]: Leaving directory `/var/tmp/portage/xorg-x11-6.8.0-r3/work/xc/programs/xedit/lisp' rm -f xedit gcc -o xedit -march=athlon-xp -pipe -fomit-frame-pointer -O2 -mno-sse2 -fno-strict-aliasing -ansi -pedantic -Wno-return-type -w -L../../exports/lib xedit.o commands.o util.o realpath.o ispell.o options.o hook.o printdialog.o print.o lisp.o -Llisp -llisp -Llisp/mp -lmp -Llisp/re -lre -lXprintUtil -lXp -lXaw -lXmu -lXt -lSM -lICE -lXpm -lXp -lXext -lX11 -lm -Wl,-rpath-link,../../exports/lib @@ -51493,8 +51486,6 @@ make[4]: Entering directory `/var/tmp/portage/xorg-x11-6.8.0-r3/work/xc/programs/xfs/difs' make[4]: Nothing to be done for `all'. make[4]: Leaving directory `/var/tmp/portage/xorg-x11-6.8.0-r3/work/xc/programs/xfs/difs' -+ mv -f xfs xfs.bak -gcc -o xfs -march=athlon-xp -pipe -fomit-frame-pointer -O2 -mno-sse2 -fno-strict-aliasing -ansi -pedantic -Wno-return-type -w -L../../exports/lib difs/libdifs.a os/libos.a -L../../exports/lib -lXfont -L/usr/lib -lfreetype -lm -lz -Wl,-rpath-link,../../exports/lib install -c xfs /var/tmp/portage/xorg-x11-6.8.0-r3/image//usr/X11R6/bin/xfs + mkdir -p /var/tmp/portage/xorg-x11-6.8.0-r3/image//etc/X11/fs + install -c -m 0444 config /var/tmp/portage/xorg-x11-6.8.0-r3/image//usr/X11R6/lib/X11/fs/config @@ -53884,10 +53875,6 @@ make[4]: Entering directory `/var/tmp/portage/xorg-x11-6.8.0-r3/work/xc/fonts/encodings/large' make[4]: Nothing to be done for `all'. make[4]: Leaving directory `/var/tmp/portage/xorg-x11-6.8.0-r3/work/xc/fonts/encodings/large' -rm -f encodings.dir fonts.dir -+ LD_LIBRARY_PATH=../../exports/lib -+ XLOCALEDIR=../../exports/lib/locale -+ ../../exports/bin/mkfontscale -b -s -l -n -r -p /usr/share/fonts/encodings/ -e . -e large . install -c -m 0444 encodings.dir /var/tmp/portage/xorg-x11-6.8.0-r3/image//usr/share/fonts/encodings/encodings.dir installing in fonts/encodings/large... make[4]: Entering directory `/var/tmp/portage/xorg-x11-6.8.0-r3/work/xc/fonts/encodings/large' Reproducible: Always Steps to Reproduce: 1.emerge xorg-x11 2. 3. Gentoo Base System version 1.6.9 Portage 2.0.51-r15 (default-linux/x86/2004.3, gcc-3.3.5, glibc-2.3.4.20040808-r1, 2.6.10 i686) ================================================================= System uname: 2.6.10 i686 AMD Athlon(tm) XP 2800+ Python: dev-lang/python-2.3.4 [2.3.4 (#1, Jan 31 2005, 15:38:21)] dev-lang/python: 2.3.4 sys-devel/autoconf: 2.59-r6, 2.13 sys-devel/automake: 1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.4 sys-devel/binutils: 2.15.92.0.2-r1 sys-devel/libtool: 1.5.10-r4 virtual/os-headers: 2.4.21-r1 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-march=athlon-xp -Os -pipe -fomit-frame-pointer -fstack-protector" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-march=athlon-xp -Os -pipe -fomit-frame-pointer -fstack-protector" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig distlocks notitles sandbox sfperms userpriv usersandbox" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="x86 3dnow X aim alsa apm arts avi berkdb bitmap-fonts cdr crypt encode esd fam fbcon flac font-server ftp gdbm gif gpm hardened imagemagick imlib jabber jpeg kde libg++ libwww mad mbox mikmod mime mmx mpeg mysql ncurses nls oggvorbis opengl pam pdflib png python qt quicktime readline sasl sdl slang speex spell sse ssl svga tcltk tiff truetype truetype-fonts type1-fonts unicode xine xml xml2 xmms xsl xv zlib video_cards_via linguas_en linguas_eo linguas_es linguas_nl" Unset: ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS
Created attachment 50520 [details] the relevant encodings.dir file
ttmkfdir dies on some broken encodings. The build log is generally unrelated. If you strace ttmkfdir when running it for directories with truetype or opentype fonts in them, you can generally track down which encoding(s) is/are broken. There's nothing in the ChangeLog around that time (29 November 2004 to 1 November 2004) that suggests a relevant change in xorg-x11 -- did you upgrade ttmkfdir? Try emerging splat or another log analyzer, and `splat ttmkfdir`.
> ttmkfdir dies on some broken encodings. The build log is generally unrelated. Ah, okay, the differences were probably caused by slightly different USE flags then, although I have no idea which ones it could be. > If you strace ttmkfdir when running it for directories with truetype or > opentype fonts in them, you can generally track down which encoding(s) is/are > broken. Hmm, I can't figure it out, it seems to do all encodings just fine, and then segfaults. It does this only in the /usr/share/fonts/TTF dir... [partial strace deleted, solution is further down] > There's nothing in the ChangeLog around that time (29 November 2004 to 1 > November 2004) that suggests a relevant change in xorg-x11 -- did you upgrade > ttmkfdir? Try emerging splat or another log analyzer, and `splat ttmkfdir`. * x11-misc/ttmkfdir-3.0.9-r1 Emerged at: Sat Sep 25 17:02:08 2004 Build time: 29 seconds * x11-misc/ttmkfdir-3.0.9-r2 Emerged at: Sun Oct 24 16:13:02 2004 Build time: 52 seconds Emerged at: Mon Nov 29 14:27:56 2004 Build time: 31 seconds So no, no update of ttmkfdir around that time, just a rebuild of world with a hardened gcc... That must be it then... Reemerged ttmkfdir with a vanilla 3.3.5 gcc and... No. Then removed -fstack-protector from the USE flags, and... Yes! Success! Picky ttmkfdir doesn't like '-fstack-protector'.
Cool. Started filtering -fstack-protector in 3.0.9-r2.
> Started filtering -fstack-protector in 3.0.9-r2. You did check that ttmkfdir segfaults for you too when using -fstack-protector among the CFLAGS? That it isn't my specific configuration that triggers this? (And if it segfaults, isn't this a bug in either ttmkfdir or gcc?)
Yes, it also fixed local segfaults. If you're interested in pursuing this further, please do feel free to figure out whether it's a problem with ttmkfdir or gcc and file an upstream bug at the appropriate location. For ttmkfdir, we use a version from Red Hat, so RH is probably considered upstream. If or when that happens, please post the URL here.
It can hardly be a bug in ttmkfdir, as this works fine when compiled without stack-protector. It looks like some kind of optimization error in the stdc++ library, probably making a hard assumption on the offsets of parameters, which get shifted by the protector. Running 'gdb ttmkfdir' in /usr/share/fonts/TTF: Program received signal SIGSEGV, Segmentation fault. 0x4015c8eb in std::string::compare () from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/libstdc++.so.5 The backtrace: #0 0x4015c8eb in std::string::compare () from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/libstdc++.so.5 #1 0x08059f80 in operator==<char, std::char_traits<char>, std::allocator<char> > ( __lhs=@0x804c580, __rhs=@0x804c584) at basic_string.h:910 #2 0x08058dfb in std::adjacent_find<__gnu_cxx::__normal_iterator<std::string*, std::vector<std::string, std::allocator<std::string> > > > (__first= {<std::iterator<std::random_access_iterator_tag, std::string, int, std::string*, std::string&>> = {<No data fields>}, _M_current = 0x804c580}, __last= {<std::iterator<std::random_access_iterator_tag, std::string, int, std::string*, std::string&>> = {<No data fields>}, _M_current = 0x84ccce8}) at stl_algo.h:341 #3 0x080575b1 in std::unique<__gnu_cxx::__normal_iterator<std::string*, std::vector<std::string, std::allocator<std::string> > > > (__first= {<std::iterator<std::random_access_iterator_tag, std::string, int, std::string*, std::string&>> = {<No data fields>}, _M_current = 0x40151f4e}, __last= {<std::iterator<std::random_access_iterator_tag, std::string, int, std::string*, std::string&>> = {<No data fields>}, _M_current = 0x84ccce8}) at stl_algo.h:1274 #4 0x08054c6a in Face (this=0xbffff6d0, filename=@0xbffff690) at ttf.cpp:180 #5 0x0804ae91 in main (argc=1, argv=0xbffff874) at ttmkfdir.cpp:69 During compilation there is this strange warning: /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/include/g++-v3/bits/stl_map.h: At top level: parser.cpp:1310: warning: `void yyunput(int, char*)' defined but not used