Bug 112741 - -fomit-frame-pointer breaks sci-libs/cln-1.1.10
Bug#: 112741 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: sci@gentoo.org Reported By: calchan@gentoo.org
Component: Library
URL: 
Summary: -fomit-frame-pointer breaks sci-libs/cln-1.1.10
Keywords:  
Status Whiteboard: 
Opened: 2005-11-16 13:41 0000
Description:   Opened: 2005-11-16 13:41 0000
-fomit-frame-pointer breaks sci-libs/cln-1.1.10, and probably 1.1.9 too. I'm
not
sure for 1.1.9 as I get the same segmentation fault as with 1.1.10, but I
haven't tried removing all my flags one by one for 1.1.9 like I have done for
1.1.10 (cln takes one heck of a long time to compile on my machines).

Here are the flags that I have confirmed work for cln-1.1.10.
CFLAGS : -march=athlon-xp and -march=pentium4, -pipe (not a real CFLAG, but it
works), -Os, -fno-ident, -fforce-addr, -ftracer, -fweb, -falign-functions=4 and
-falign-functions=64, -ffast-math
CXXFLAGS : -fvisibility-inlines-hidden, -D_FILE_OFFSET_BITS=64
LDFLAGS : -Wl,-O1 -Wl,--sort-common

Reproducible: Always
Steps to Reproduce:
1. Add -fomit-frame-pointer to your CFLAGS list
2. emerge sci-libs/cln-1.1.10
3. emerge for example qalculate-gtk if necessary, and run it

Actual Results:  
Segmentation fault.

Expected Results:  
-fomit-frame-pointer should be added to the list of filtered flags in
src_compile().

emerge info for one of my 2 machines (the other one is a P4M laptop and differs
only in -march=pentium4 and -falign-functions=4 ; both behave the same
regarding
this error) :

Portage 2.0.53_rc7 (default-linux/x86/2005.1, gcc-3.4.4, glibc-2.3.5-r3,
2.6.14-ck4 i686)
=================================================================
System uname: 2.6.14-ck4 i686 AMD Athlon(tm) XP 1600+
Gentoo Base System version 1.12.0_pre10
dev-lang/python:     2.3.5, 2.4.2
sys-apps/sandbox:    1.2.13
sys-devel/autoconf:  2.13, 2.59-r7
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-r1
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -pipe -Os -fomit-frame-pointer -fno-ident -fforce-addr
-ftracer -fweb -falign-functions=64 -ffast-math"
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="-march=athlon-xp -pipe -Os -fomit-frame-pointer -fno-ident
-fforce-addr -ftracer -fweb -falign-functions=64 -ffast-math
-fvisibility-inlines-hidden -D_FILE_OFFSET_BITS=64"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org
http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS="-Wl,-O1 -Wl,--sort-common"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 3dnow 3dnowext X a52 aac acpi alsa audiofile avi bash-completion
berkdb
bitmap-fonts bzip2 cdparanoia cdr cjk crypt djbfft dv dvd dvdr dvdread edl
emboss encode exif expat fam firefox flac foomaticdb fortran gd gdbm gif
glibc-omitfp glitz glut gmp gnome gtk gtk2 hal howl imlib ipv6 java jpeg lcms
libg++ libwww live logrotate lzo mad matroska mikmod mmx mmxext mng motif
moznocompose moznoirc moznomail mozsvg mp3 mpeg ncurses nls nptl nptlonly
nsplugin nvidia ogg oggvorbis opengl oss pam pdflib perl pic plotutils png
python quicktime readline rle rtc sdl silc spell sse ssl svg tcpd theora tiff
truetype truetype-fonts type1-fonts udev unicode usb userlocales vorbis
win32codecs xanim xml2 xv xvid xvmc zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTDIR_OVERLAY

------- Comment #1 From Sébastien Fabbro 2005-11-27 13:26:09 0000 -------
Although I am testing on amd64, I have a hard time reproducing the bug. Could
you check with a more reasonable set of CFLAGS (-O2 -pipe -march=athlon-xp
-fomit-frame-pointer could be a good start).

Here is my emerge info:

Portage 2.0.51.22-r3 (default-linux/amd64/2005.1, gcc-3.4.4, glibc-2.3.5-r2, 2.6
                  .13-gentoo-r5 x86_64)
=================================================================
System uname: 2.6.13-gentoo-r5 x86_64 AMD Athlon(tm) 64 Processor 3500+
Gentoo Base System version 1.6.13
ccache version 2.3 [enabled]
dev-lang/python:     2.3.5-r2, 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.15.92.0.2-r10
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=k8"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X1
                  1/xkb /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/splash /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -pipe -march=athlon64"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distcc distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://darkstar.ist.utl.pt/gentoo  ftp://mir.zyrianes.net/gentoo
                  / ftp://mirrors1.netvisao.pt/gentoo/"
LC_ALL="en_US.utf8"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /home/seb/gentoo/sci"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="amd64 X a52 aac aalib alsa audiofile avi bash-completion berkdb bitmap-font
                  s bzip2 cdparanoia cdr crypt cups curl directfb divx4linux doc
dts dv dvd dvdr e                   macs emboss encode exif expat fbcon ffmpeg
flac foomaticdb fortran gcj gd gdbm g                   eoip ggi gif glut gmp
gphoto2 gpm gstreamer gtk gtk2 hal ieee1394 imagemagick im                   lib
jack java javascript jpeg kde kdeenablefinal lcms libwww lirc lzw lzw-tiff m   
               ad matroska mikmod mng motif mozilla mp3 mpeg nas ncurses nls
nptl nsplugin objc                    offensive ogg oggvorbis opengl pam pdflib
perl pic plotutils png python qt quic                   ktime readline scanner
sdl sndfile speex spell ssl svg symlink tcpd tetex theora                   
tiff truetype truetype-fonts type1-fonts udev unicode usb userlocales v4l vcd v
                  orbis wmf wxwindows xanim xine xml2 xmms xpm xprint xv xvid
zlib userland_GNU ke                   rnel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LDFLAGS, LINGUAS



------- Comment #2 From Marcus D. Hanwell 2005-11-27 13:34:21 0000 -------
I don't believe this is a critical bug. I cannot reproduce your issue here, but 
I have much more modest CFLAGS and am testing on amd64. Can anyone on x86 
please test this with -fomit-frame-pointer and more modest CFLAGS please test. 

------- Comment #3 From Markus Dittrich 2005-11-28 07:10:59 0000 -------
I just compiled cln on my P4 using gcc-3.4.4-r1 and  
CFLAGS="-O2 -march=pentium4 -pipe -fomit-frame-pointer -fno-ident".  
  
qalculate-gtk works just fine with it and I haven't been able to reproduce   
any segfaulting.  

------- Comment #4 From Denis Dupeyron 2005-11-28 08:09:40 0000 -------
Sorry guys, I may not have been specific enough last time, plus I did make a
error in my tests.

I wasn't clear in telling you that I tested with minimal CFLAGS, as well as with
the whole list of those you see in my emerge info. And I got segfaults in both
cases when -fomit-frame-pointer was present. So I checked this again today, and
it appears I used -Os by mistake in some (at least) of my minimal CFLAGS tests.

I have thus redone my tests (only on the P4-M right now, I will try and do it on
the Athlon XP as soon as possible). The result is that -fomit-frame-pointer does
brake cln, but only when combined with -Os. So :
-Os -fomit-frame-pointer -> segfault
-0s -> OK
-O2 -fomit-frame-pointer -> OK

I'm not sure if the eutils allow easy filtering of a combination of CFLAGS, so I
suppose that if it's too complicated (or not portage compliant) replacing -Os
with -O2 will be better than stripping -fomit-frame-pointer.

Can anybody else confirm this ?

------- Comment #5 From Marcus D. Hanwell 2005-12-14 15:30:33 0000 -------
This package seems to be very sensitive to CFLAGS, it is now replacing -Os with 
-O2 as I think that is probably the safest thing to do.