Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 115309 - xpdf-3.0.1-r3 compiled with -Os crashes when opening some pdf files
Summary: xpdf-3.0.1-r3 compiled with -Os crashes when opening some pdf files
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High critical (vote)
Assignee: Printing Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-12 07:35 UTC by Andreas Claesson
Modified: 2005-12-26 01:10 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Claesson 2005-12-12 07:35:50 UTC
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
Comment 1 Marcelo Goes (RETIRED) gentoo-dev 2005-12-12 09:36:52 UTC
I can't reproduce. I tried opening fakta.pdf and it worked just fine.
Comment 2 Andreas Claesson 2005-12-12 10:15:26 UTC
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...
Comment 3 Daniel Gryniewicz (RETIRED) gentoo-dev 2005-12-12 13:02:48 UTC
Because there's traditionally been bugs in code compiled -Os.  It's the least
commonly used optimization flag, afterall.
Comment 4 Ingo Bormuth 2005-12-16 05:37:21 UTC
How about adding 

   replace-flags "-Os" "-O2"

to xpdf (and kpdf) ebuilds as long as the problm persists ?
Comment 5 Stefan Schweizer (RETIRED) gentoo-dev 2005-12-26 01:10:49 UTC
thanks, fixed