xpdf-3.0.1-r3 compiled with gcc 3.4.4 with -Os gives "Segmentation fault" when opening most pdf files. Compiling with -O2 solves the problem. xpdf-3.0.0-r10 is not affected. I have not tested with any other gcc versions. Not all pdf files cause the program to crash, but many do. For example the data sheets on http://www.elfa.se/ The closed bug #114822 seem to be about a similar problem. Maybe they are connected. Reproducible: Always Steps to Reproduce: 1.Change CFLAGS to -Os 2.emerge =xpdf-3.0.1-r3 3.open a pdf from (for example) http://www.elfa.se Actual Results: The program crashed with Segmentation Fault. Expected Results: Viewed the pdf document. # emerge --info Portage 2.0.51.22-r3 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r2, 2.6.14-gentoo-r4 i686) ================================================================= System uname: 2.6.14-gentoo-r4 i686 AMD Athlon(tm) XP 1800+ Gentoo Base System version 1.6.13 dev-lang/python: 2.4.2 sys-apps/sandbox: 1.2.12 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.20 virtual/os-headers: 2.6.8.1-r1, 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-Os -march=athlon-xp -fomit-frame-pointer -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /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="-Os -march=athlon-xp -fomit-frame-pointer -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://ftp.du.se/pub/os/gentoo http://ds.thn.htu.se/linux/gentoohttp://trumpetti.atm.tut.fi/gentoo/ http://www.ibiblio.org/pub/Linux/distributions/gentoo" LINGUAS="en se sv" MAKEOPTS="-j2 -s" 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 alsa apm audiofile avi berkdb bitmap-fonts bzip2 cdr crypt eds emboss encode ethereal exif expat flac foomaticdb fortran gd gdbm gif glut gpm gstreamer gtk2 imlib jack java jpeg libg++ libwww mad matroska mikmod mmx mng motif mp3 mpeg mysql ncurses nls nptl nptlonly nsplugin ogg oggvorbis opengl oss pam pcre pdflib perl png python quicktime readline sse ssl svga tcpd theora truetype truetype-fonts type1-fonts udev unicode userlocales vorbis xml2 xmms xv xvid zlib video_cards_matrox linguas_en linguas_se linguas_sv userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS
I can't reproduce. I tried opening fakta.pdf and it worked just fine.
Strange. For me it happens every time. I recompiled 3.0.1 with -Os and tried fakta.pdf again just now, and xpdf just died as before. Recompiled with -O2, and the problem is gone. There must be something strange with my toolchain then. My toolchain is stable x86, compiled with gcc-3.4.4. I did an emerge -e world yesterday, so everything should be ok there. But if it is the toolchain, why does it only affect the -Os optimized compile? I can work around the problem, so it is not a real problem for me, but this should not happen in the first place...
Because there's traditionally been bugs in code compiled -Os. It's the least commonly used optimization flag, afterall.
How about adding replace-flags "-Os" "-O2" to xpdf (and kpdf) ebuilds as long as the problm persists ?
thanks, fixed