Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 55383 - x11-misc/ttmkfdir needs to filter out CFLAG -fstack-protector or else emerging fonts break
Summary: x11-misc/ttmkfdir needs to filter out CFLAG -fstack-protector or else emergin...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Gentoo Fonts Team
URL:
Whiteboard:
Keywords:
: 54356 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-06-27 21:37 UTC by Scott Duckworth
Modified: 2006-06-04 08:55 UTC (History)
3 users (show)

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


Attachments
gdb stack trace identifying where the fault occurs (gdb.log,6.10 KB, text/plain)
2004-09-18 05:00 UTC, Kevin F. Quinn (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Duckworth 2004-06-27 21:37:46 UTC
I've been trying the -fstack-protector CFLAG and have run into a few problems with ebuilds not working; this is one of them.  ttmkfdir gets a segmentation fault if it is compiled with this flag.

Reproducible: Always
Steps to Reproduce:
1. set CFLAGS and CXXFLAGS to "-O3 -march=pentium4 -mcpu=pentium4 -mmmx -msse -msse2 -mfpmath=sse -maccumulate-outgoing-args -funroll-loops -fomit-frame-pointer -fstack-protector -pipe"
2. emerge ttmkfdir - this works fine
3. emerge kochi-substitute
Actual Results:  
The following error occurs on step 3: 
 
 * Refreshing fonts.scale and fonts.dir... 
/usr/sbin/ebuild.sh: line 1433: 10382 Segmentation fault      ttmkfdir 
>fonts.scale 
 
!!! ERROR: kochi-substitute-20030809/kochi-substitute-20030809 failed. 
!!! Function rebuild_fontfiles, Line 46, Exitcode 139 
!!! Unable to create fonts.scale! Please emerge ttmkfdir and try again. 
 
!!! FAILED postrm: 1 
 

Expected Results:  
x11-misc/ttmkfdir should have filtered out the -fstack-protector flag and 
replaced it with -fno-stack-protector.  I have done this and emerging 
kochi-substitute now works fine. 

Specific packages of interest are as follows: 
x11-base/xfree-4.3.0-r5 
x11-misc/ttmkfdir-3.0.9-r1 
media-fonts/kochi-substitute-20030809 
 
# emerge info 
Portage 2.0.50-r8 (default-x86-2004.0, gcc-3.3.3, glibc-2.3.3.20040420-r0, 
2.6.7-gentoo-r5) 
================================================================= 
System uname: 2.6.7-gentoo-r5 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz 
Gentoo Base System version 1.4.16 
distcc 2.13 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) 
[disabled] 
ccache version 2.3 [enabled] 
Autoconf: sys-devel/autoconf-2.59-r3 
Automake: sys-devel/automake-1.8.3 
ACCEPT_KEYWORDS="x86" 
ACCEPT_LICENSE="" 
ARCH="x86" 
AUTOCLEAN="yes" 
BASH_ENV="/etc/portage/bashrc" 
CC="gcc" 
CCACHE_SIZE="3G" 
CFLAGS="-O3 -march=pentium4 -mcpu=pentium4 -mmmx -msse -msse2 -mfpmath=sse 
-maccumulate-outgoing-args -funroll-loops -fomit-frame-pointer 
-fstack-protector -pipe" 
CHOST="i686-pc-linux-gnu" 
CLASSPATH="." 
CLEAN_DELAY="5" 
COMPILER="gcc3" 
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" 
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" 
CVS_RSH="ssh" 
CXX="g++" 
CXXFLAGS="-O3 -march=pentium4 -mcpu=pentium4 -mmmx -msse -msse2 -mfpmath=sse 
-maccumulate-outgoing-args -funroll-loops -fomit-frame-pointer 
-fstack-protector -pipe" 
DCCC_PATH="/usr/lib/distcc/bin" 
DISPLAY=":0.0" 
DISTCC_LOG="" 
DISTCC_VERBOSE="0" 
DISTDIR="/usr/portage/distfiles" 
EDITOR="/usr/bin/vim" 
FEATURES="autoaddcvs buildpkg ccache sandbox userpriv usersandbox" 
FETCHCOMMAND="/usr/bin/wget -t 5 --passive-ftp -P ${DISTDIR} ${URI}" 
GDK_USE_XFT="1" 
GENTOO_MIRRORS="ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ 
http://mirror.datapipe.net/gentoo http://mirrors.tds.net/gentoo 
http://128.213.5.34/gentoo/ 
ftp://mirrors.sec.informatik.tu-darmstadt.de/gentoo/" 
GLIBC_SSP_CHECKED="1" 
GRP_STAGE23_USE="ipv6 pam tcpd readline nls ssl gpm perl python berkdb acl 
ncurses" 
GUILE_LOAD_PATH="/usr/share/guile/1.6" 
G_BROKEN_FILENAMES="1" 
HISTIGNORE="&:[bf]g:pushd:popd:clear:exit" 
HOME="/root" 
HOSTNAME="silent" 
IA32ROOT="/opt/intel/compiler80" 
INFODIR="/usr/share/info:/usr/X11R6/info" 
INFOPATH="/usr/share/info:/usr/share/gcc-data/i686-pc-linux-gnu/3.3/info" 
INPUTRC="/etc/inputrc" 
INTEL_FLEXLM_LICENSE="/opt/intel/compiler80/licenses" 
JAVAC="/opt/blackdown-jdk-1.4.1/bin/javac" 
JAVA_HOME="/opt/blackdown-jdk-1.4.1" 
JDK_HOME="/opt/blackdown-jdk-1.4.1" 
KDEDIR="/usr/kde/3.2" 
KDEDIRS="/usr" 
LESS="-R" 
LESSOPEN="|lesspipe.sh %s" 
LOGNAME="root" 
LS_COLORS="no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mng=01;35:*.xcf=01;35:*.pcx=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.avi=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.mov=01;35:*.qt=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:" 
MAKEOPTS="-j3" 
MANPATH="/usr/share/man:/usr/local/share/man:/usr/share/gcc-data/i686-pc-linux-gnu/3.3/man:/opt/intel/compiler80/man:/usr/X11R6/man::/opt/blackdown-jdk-1.4.1/man:/usr/qt/3/doc/man" 
MOZILLA_FIVE_HOME="/usr/lib/mozilla" 
NOCOLOR="false" 
OLDPWD="/root" 
PAGER="/usr/bin/less" 
PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/3.3:/opt/intel/compiler80/bin:/usr/X11R6/bin:/opt/blackdown-jdk-1.4.1/bin:/opt/blackdown-jdk-1.4.1/jre/bin:/usr/qt/3/bin:/usr/kde/3.2/bin:/opt/firebird/bin:/usr/games/bin" 
PKGDIR="/usr/portage/packages" 
PORTAGE_BINHOST_CHUNKSIZE="3000" 
PORTAGE_CACHEDIR="/var/cache/edb/dep/" 
PORTAGE_CALLER="emerge" 
PORTAGE_GID="250" 
PORTAGE_MASTER_PID="12205" 
PORTAGE_NICENESS="3" 
PORTAGE_TMPDIR="/var/tmp" 
PORTDIR="/usr/portage" 
PORTDIR_OVERLAY="/usr/local/portage" 
PRELINK_PATH="" 
PRELINK_PATH_MASK="" 
PS1="\[\033[01;31m\]\h:\[\033[01;33m\]\w\$ \[\033[00m\]" 
PWD="/usr/portage/x11-base/xfree" 
PYTHONDOCS="/usr/share/doc/python-docs-2.3.3/html" 
QMAKESPEC="linux-g++" 
QTDIR="/usr/qt/3" 
RESUMECOMMAND="/usr/bin/wget -c -t 5 --passive-ftp -P ${DISTDIR} ${URI}" 
RPMDIR="/usr/portage/rpm" 
RSYNC_RETRIES="3" 
RSYNC_TIMEOUT="180" 
SANE_CONFIG_DIR="/etc/sane.d" 
SHELL="/bin/bash" 
SHLVL="1" 
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage" 
TERM="xterm" 
USE="3dnow 3ds S3TC X accessibility acl acpi acpi4linux aim alsa amd apache2 
apm arts artswrappersuid async atm audiofile autofs avi berkdb cap caps cddb 
cdr chroot cjk clamav crypt cscope cups curl dga distcache divx4linux dnd 
dnsdb doc dv dvb dvd dvdr emacs emacs-w3 encode erandom escreen esd ethereal 
etwin evms2 evo exiscan-acl expat f77 faad fam fastcgi fax fbcon firebird flac 
flash fmod foomaticdb freetds gb gcj gd gdbm gif gimp gimpprint glade glgd 
glut gmp gnome gnomedb gnuplot gphoto2 gpm gps gs gsl gstreamer gtk gtk2 
gtkhtml guile hardenedphp hbci icc icc-pgo idea ieee1394 image imagemagick 
imap imlib imlib2 informix innodb ipv6 ipv6arpa irda jack jack-caps java 
javacomm javamail javascript jbig jikes joystick jp2 jpeg junit justify kde 
kerberos krb4 ladcca lcd lcms ldap leim libcaca libdsk libg++ libgda libwww 
lirc live lmtp lua lzw-tiff mad maildir mailwrapper make-busybox-symlinks 
makecheck mbox mcal md5sum mdb memlimit mikmod mmap mmx mng mono motif mozdomi 
mozilla moznoirc mozp3p mozsvg mozxmlterm mpeg mpeg4 mpi mplayer msn mssql 
multilib mysql nas native ncurses nls nowin nsl ntlm nvidia oav objc ocaml 
oci8 odbc offensive oggvorbis ooo-kde openal opengl oracle orathreads oscar 
oss pam parse-clocks pcap pcre pda pdflib pear-db perl pg-hier pg-intdatetime 
pg-vacuumdelay php physfs pic plotutils png pnp postgres ppds prelude 
propolice pthreads python qt quicktime readline regexp ruby ruby18 samba sasl 
scanner sdl serial skey slang slp snmp speedo speex spell sqlite sse ssl 
stencil-buffer stroke svga tcltk tcpd tetex theora tiff transcode 
transparent-proxy truetype type1 unicode usagi usb v4l v4l2 vhosts videos 
vim-with-x virus-scan wifi wildlsearch wmf wmx wxwin wxwindows x86 xchattext 
xemacs xforms xfs xine xinerama xml xml2 xmms xrandr xv xvid yahoo zlib" 
USER="root" 
USERLAND="GNU" 
USE_EXPAND="VIDEO_CARDS INPUT_DEVICES LINGUAS" 
XARGS="xargs -r" 
XINITRC="/etc/X11/xinit/xinitrc" 
_="/bin/nice"
Comment 1 Mike Nerone 2004-07-02 10:38:49 UTC
I second that. Just discovered the same thing:

With -fstack-protector in CFLAGS, the following command (for example) segfaults:
  # /usr/X11R6/bin/ttmkfdir -x 2 -e /usr/share/fonts/encodings/encodings.dir

Removing -fstack-protector fixes it.

===========================================================================
# emerge info
Portage 2.0.50-r8 (default-x86-2004.0, gcc-3.3.3, glibc-2.3.3.20040420-r0, 2.6.7-gentoo-r7)
=================================================================
System uname: 2.6.7-gentoo-r7 i686 Pentium III (Coppermine)
Gentoo Base System version 1.4.16
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=pentium3 -pipe -fomit-frame-pointer -fstack-protector"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=pentium3 -pipe -fomit-frame-pointer -fstack-protector"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="http://gentoo.chem.wisc.edu/gentoo/ http://128.213.5.34/gentoo/ http://gentoo.netnitco.net http://mirror.cpsc.ucalgary.ca/mirror/gentoo.org http://cudlug.cudenver.edu/gentoo/ http://gentoo.ccccom.com http://gentoo.binarycompass.org"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X aalib alsa apache2 apm arts avi crypt cups encode flash foomaticdb gd gif gnome gtk gtk2 imagemagick imap imlib jpeg kde lcms libg++ libwww mad mcal memlimit mikmod mmx motif mpeg mysql ncurses nls oggvorbis opengl oss pam pdflib perl png ppds python qt quicktime readline samba sasl sdl slang slp spell sse ssl svga tcpd tiff truetype usb vhosts x86 xml xml2 xmms xv zlib"
===========================================================================
Comment 2 Rumen Yotov 2004-07-12 22:51:05 UTC
Hi all,
i also have this problem /ttmkfdir-3.0.9-r1/, in my case it's segmentation fault in Speedo, Type1 and custom ttf dirs under /usr/share/fonts, using xorg-x11-6.7.0 /no luck with 6.7.0-r1/ while making fonts.scale.
After checking with chpax /as i'm using hardened profile for a long time/ there are 4 of 6 PaX protecting features in binary file: ttmkfdir /PeMRxS/.
Disabled all of PaX flags, but no positive result. Segmentation fault again.
Went back to ttmkfdir-3.0.9.ebuild and the problem got fixed.
So it must come from something included in 3.0.9-r1.
HTH
Rumen
Comment 3 Carsten Lohrke (RETIRED) gentoo-dev 2004-08-12 01:43:19 UTC
Same problem when switching from xfree to xorg-x11. emerge =ttmkfdir-3.0.9 fixed the problem.

 * Creating fonts.scale files......
/usr/sbin/ebuild.sh: line 1430: 18651 Segmentation fault      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}
/usr/sbin/ebuild.sh: line 1430:  5573 Segmentation fault      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}
/usr/sbin/ebuild.sh: line 1430:  4321 Segmentation fault      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}                           [ ok ]
 * Generating fonts.dir files......                                                                                             [ ok ]
 * Generating Xft cache......
Comment 4 Seemant Kulleen (RETIRED) gentoo-dev 2004-08-12 09:37:51 UTC
*** Bug 54356 has been marked as a duplicate of this bug. ***
Comment 5 Kevin F. Quinn (RETIRED) gentoo-dev 2004-08-25 23:12:31 UTC
Building xorg-x11-6.7.0.99.902, this error also occurred for me:

/usr/sbin/ebuild.sh: line 1436: 26197 Segmentation fault      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}

Investigation showed that ${x} was /usr/share/fonts/TTF.

Tried adding -fno-stack-protector to the CFLAGS in the Makefile, and also -fno-pie but it still segfaults on the TTF directory.

Tried version 3.0.9 as well as 3.0.9-r1 but got the same result every time - segv.

emerge info:
Portage 2.0.50-r10 (default-x86-2004.0, gcc-3.3.3, glibc-2.3.3.20040420-r1, 2.6.7-hardened-r7)
=================================================================
System uname: 2.6.7-hardened-r7 i686 AMD Athlon(tm) XP 3200+
Gentoo Base System version 1.4.16
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.5-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-xp -pipe -fomit-frame-pointer -O2"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -pipe -fomit-frame-pointer -O2"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox sfperms strict"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://ftp.linux.ee/pub/gentoo/distfiles/ http://ftp.easynet.nl/mirror/gentoo/ http://ftp.heanet.ie/pub/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X aalib acpi alsa apm arts avi berkdb bidi cdr crypt cups directfb dvd dvdr encode esd faad foomaticdb gcj gdbm gif gnome gpm gtk gtk2 hardened imlib java javamail jikes jpeg junit kde libg++ libwww linguas_de linguas_en_GB linguas_es linguas_fr linguas_it mad mikmod mmx motif mozilla mpeg mpeg4 ncurses nls oggvorbis opengl oss pam pdflib perl pic pie png python qt quicktime readline sdl slang spell ssl svga tcltk tcpd truetype usb wxwindows x86 xinerama xml2 xmms xv zlib"
Comment 6 Donnie Berkholz (RETIRED) gentoo-dev 2004-08-26 00:47:03 UTC
Bug #60470.
Comment 7 Kevin F. Quinn (RETIRED) gentoo-dev 2004-09-17 15:04:49 UTC
This bug should be marked fixed; x11-misc/ttmkfdir-3.0.9-r2 works fine on my two hardened installs.  Scott, perhaps you could confirm for yourself and change the bug status?
Comment 8 Scott Duckworth 2004-09-17 15:48:44 UTC
Kevin, what did you do to make it work?  Mine still will not work with the -fstack-protector flag but it always works without it.

Can anybody else confirm or deny that this issue is resolved?
Comment 9 Martin Mokrejš 2004-09-17 16:07:57 UTC
Hmm, I use xfree from xfree cvs, so I don't want to reinstall my X again, but today morning I had reemerged xfree on Gentoo, which is 4.0.3 and the problem was still there. If someone marks as stable some more recent version, then this bug can be closed.

To be true, I'm perfectly happy with cvs version from xfree86 and dri stuff from xfreedesktop.org cvs.I only use Gentoos xfree package to isntall the nice config and then I overwrite almost everything with my own binarioes from both cvs trees.

So, it is still in 4.0.3-r6 at least.
Comment 10 Martin Mokrejš 2004-09-17 16:09:08 UTC
My setup is:

Portage 2.0.50-r11 (default-x86-1.4, gcc-3.3.4, glibc-2.3.3.20040420-r1, 2.6.9-rc2)
=================================================================
System uname: 2.6.9-rc2 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz
Gentoo Base System version 1.4.16
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.5-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-msse3 -O3 -fomit-frame-pointer -march=pentium4 -funroll-loops -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3.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/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/bind /var/qmail/alias /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/afs/C /etc/afs/afsws /etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-msse3 -O3 -fomit-frame-pointer -march=pentium4 -funroll-loops -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="http://gentoo.osuosl.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="FFmpeg X Xaw3d aalib acpi afs alsa apache2 apm arts ati avi berkdb bidi bitmap-fonts bonobo caca cdparanoia cdr crypt cscope cups curl dga directfb divx divx4 divx4linux divx5 divx5linux doc dvb dvd dvdr dvdread emacs emacs-w3 encode esd ethereal evo f77 faad faad2 fam fame fbcon ffmpeg flash foomaticdb fortran fvwm fvwm2 gb gd gdbm ggi gif gnome gphoto2 gpm gtk gtk2 gtkhtml guile i8x0 icc imagemagick imlib imlib2 innodb java jpeg kde kde3 lcms ldap leim libg++ libwww linguas_cs linguas_cz linguas_en live lzo mad mcal mesa mikmod mmx mmx2 motif mozilla mpeg mule mysql ncurses network nls oggvorbis opengl oss pam pda pdflib perl php php4 plotutils png ppds pthread pthreads python qt qtx quicktime readline rtc ruby samba sasl scanner sdl slang slp spell sse sse2 sse3 ssl svga tcltk tcpd tetex theora thread threads tiff truetype unicode usb v4l v4l2 video_cards_radeon win32 winvidix wmf x86 xml xml2 xmms xosd xprint xv xvid xvmc zeo zlib"
Comment 11 Donnie Berkholz (RETIRED) gentoo-dev 2004-09-17 16:23:41 UTC
Ah, Martin, this isn't an xfree problem. ttmkfdir is a separate package.
Comment 12 Martin Mokrejš 2004-09-17 17:14:55 UTC
Ahh, sorry. OK, I tried emerging ttmkfdir-3.0.9-r1 and I cannot make it to coredump. Nor 3.0.9. :( -- Of course, both I had to patch to include proper freetype2 headers (ttmkfdir-3.0.9-freetype-compat.patch).

It's weird that it doesn't coredump, I really saw it today. Maybe it's becuase I have freetype-2.1.9 installed for few hours now.

... No, it's not, I just downgraded freetype to 2.1.5-r1 and tested on ttmkfdir-3.0.9, no problems. I don't understand. Time to sleep allready.
Comment 13 Kevin F. Quinn (RETIRED) gentoo-dev 2004-09-18 03:58:17 UTC
Sorry, my bad - I thought that since the fonts with xorg don't trigger the bug, ttmkfdir had been fixed.  Seems that the fonts with xorg were adjusted to avoid the bug in ttmkfdir.  Just tried to emerge kochi-substitute and I get the same segmentation fault.
Comment 14 Kevin F. Quinn (RETIRED) gentoo-dev 2004-09-18 05:00:11 UTC
Created attachment 39843 [details]
gdb stack trace identifying where the fault occurs

Ok; perhaps on a more useful note, I've managed to get a stack backtrace out of
gdb.  Unfortunately, I'm not familiar enough with C++ to be able to make a lot
of sense out of it, but perhaps someone else can.  I'll post how I got the
trace in a separate comment (since attachment comments get wrapped by bugzilla,
unlike normal comments).
Comment 15 Kevin F. Quinn (RETIRED) gentoo-dev 2004-09-18 05:02:23 UTC
I obtained the trace by unpacking with USE="debug", then modifying the makefile to remove the "libtool -mode=XXX" parts from the rules, by adding "-fno-pie" to the makefile CXXFLAGS flags and "-static" to LDFLAGS - relevant bits are:


OPTFLAGS=
DEBUG=-ggdb
CXX=g++
CXXFLAGS=-Wall -pedantic -fno-pie $(FREETYPE_INCL) $(DEBUG) $(OPTFLAGS)
LDFLAGS=$(FREETYPE_LIB) $(DEBUG) -lz -static


and:


.cpp.o:
        $(CXX) $(CXXFLAGS) -o $@ -c $^
#       libtool --mode=compile $(CXX) $(CXXFLAGS) -o $@ -c $^

ttmkfdir: ttmkfdir.o directory.o commandline.o ttf.o encoding.o parser.o builtin.o
        $(CXX) -o $@ $^ $(LDFLAGS)
#       libtool --mode=link $(CXX) -o $@ $^ $(LDFLAGS)


Then the sequence to get the trace was:

# make
# chpax -zpemsrx ttmkfdir
# paxctl -zpemsrx ttmkfdir
# ulimit -c unlimited
# cd /usr/X11R6/lib/X11/fonts/truetype /var/tmp/portage/ttmkfdir-3.0.9-r2/work/ttmkfdir-3.0.9/ttmkfdir
{segmentation fault, core dumped}
# gdb /var/tmp/portage/ttmkfdir-3.0.9-r2/work/ttmkfdir-3.0.9/ttmkfdir core 2>&1 > gdb.log
(gdb) bt full
(gdb) quit
Comment 16 Benoit Boissinot 2004-12-27 14:01:33 UTC
Maybe the people that still have the problem could retry since ttmkfdir-3.0.9-r2 is now stable. If it works this bug was perhaps a dup from #60470.

it works for me with:
media-fonts/kochi-substitute-20030809-r3
x11-misc/ttmkfdir-3.0.9-r2
and CFLAGS="-O3 -march=athlon-xp -mmmx -msse -mfpmath=sse -maccumulate-outgoing-args -funroll-loops -fomit-frame-pointer -fstack-protector -pipe"
Comment 17 Jakub Moc (RETIRED) gentoo-dev 2006-06-04 08:55:58 UTC
Fixed quite some time ago.

 07 Feb 2005; Donnie Berkholz <spyderous@gentoo.org>;
  ttmkfdir-3.0.9-r2.ebuild:
  (#80967) Filter -fstack-protector.