Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 24668 - gcc 3.2.3-r1 Segfault compiling gsf-outfile-zip.c in gnome-extra/libgsf-1.6.0 if -O2 (or -O1 or -O3)
Summary: gcc 3.2.3-r1 Segfault compiling gsf-outfile-zip.c in gnome-extra/libgsf-1.6.0...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: Sparc Linux
: High major (vote)
Assignee: Sparc Porters
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-17 07:35 UTC by Ferris McCormick (RETIRED)
Modified: 2006-02-04 06:05 UTC (History)
2 users (show)

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 Ferris McCormick (RETIRED) gentoo-dev 2003-07-17 07:35:30 UTC
On both sun4u (Ultra2-SMP 2x400) and sun4m (SS20-SMP 2x70), gcc-3.2.3-r1 segfaults
compiling [color=green]gsf/gsf-outfile-zip.c[/color] in
[color=green]gnome-extra/libgsf-1.6.0[/color] with any optimization above "-O0";
using "-O0" gives a clean compile.  Although the "Actual Results" section has
the verbatim results (from the SS20 attempt) with -fPIC, compiling the static
version (w/o -fPIC) gives the same failure.

Points of failure are the same on both systems.

I have tentatively tagged this as a Major bug, because I suspect it might
be fairly widespread and not just sparc (but I have no way of checking that).
For example, look at #23954.  For this specific case (libgsf) I personally
don't care at all; I don't use gnome for anything.  But at first glance,
the particular code causing the failure doesn't look very unusual to me.



Reproducible: Always
Steps to Reproduce:
1.make sure you have gcc-3.2.3-r1, binutils-2.14.90.0.2
2.make sure that in make.conf, your CFLAGS include -O1 (or greater)
3.emerge =gnome-extra/libgsf-1.6.0
Actual Results:  
[code]
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -I/usr/include/libxml2 -mtune=v8 -O2 -pipe -Wall
-Wunused -Wmissing-prototypes -Wmissing-declarations -DG_DISABLE_DEPRECATED
-Wno-system-headers -W -Wfloat-equal -Wpointer-arith -Wbad-function-cast
-Wwrite-strings -Wsign-compare -Waggregate-return -Wstrict-prototypes
-Wmissing-prototypes -Wmissing-declarations -Wmissing-format-attribute
-Wnested-externs -Wunreachable-code -Winline -D_POSIX_SOURCE -D__EXTENSIONS__
-D_BSD_SOURCE -c gsf-outfile-zip.c  -fPIC -DPIC -o .libs/gsf-outfile-zip.lo
gsf-outfile-zip.c: In function `zip_flush':
gsf-outfile-zip.c:421: internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.gentoo.org/> for instructions.
make: *** [gsf-outfile-zip.lo] Error 1
[/code]

Expected Results:  
It should have compiled cleanly, of course.

[list=1]
[*] I suspect this is bug #23954 on a different architecture in a different context;
[*] here is 'emerge info' from the SS20, which has fewer USEes and is less
aggressively optimized than the U2:
[code]
dragonfly gsf # emerge info
Portage 2.0.48-r1 (default-sparc-1.4, gcc-3.2.3, glibc-2.3.1-r4)
=================================================================
System uname: 2.4.21-sparc-r1 sparc sun4m
GENTOO_MIRRORS="http://gentoo.oregonstate.edu
http://www.ibiblio.org/pub/Linux/distributions/gentoo"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config
/usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR_OVERLAY=""
USE="sparc crypt cups fbcon foomaticdb imlib jpeg mikmod motif mad mpeg ncurses
nls png qt spell truetype xv zlib gdbm berkdb slang readline tetex java X tcpd
pam libwww ssl perl python gtk opengl gif tiff -arts -kde -gnome mysql ruby
tcltk Xaw3d -oggvorbis -alsa"
COMPILER="gcc3"
CHOST="sparc-unknown-linux-gnu"
CFLAGS="-mtune=v8 -O2 -pipe"
CXXFLAGS="-mtune=v8 -O2 -pipe -Wno-deprecated -fpermissive"
ACCEPT_KEYWORDS="sparc"
MAKEOPTS="-j3"
AUTOCLEAN="yes"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
FEATURES="ccache"
[/code]

[*] Here is 'gcc -v' from the same system:
[code]
dragonfly gsf # gcc -v
Reading specs from /usr/lib/gcc-lib/sparc-unknown-linux-gnu/3.2.3/specs
Configured with: /var/tmp/portage/gcc-3.2.3-r1/work/gcc-3.2.3/configure
--prefix=/usr --bindir=/usr/sparc-unknown-linux-gnu/gcc-bin/3.2
--includedir=/usr/lib/gcc-lib/sparc-unknown-linux-gnu/3.2.3/include
--datadir=/usr/share/gcc-data/sparc-unknown-linux-gnu/3.2
--mandir=/usr/share/gcc-data/sparc-unknown-linux-gnu/3.2/man
--infodir=/usr/share/gcc-data/sparc-unknown-linux-gnu/3.2/info --enable-shared
--host=sparc-unknown-linux-gnu --target=sparc-unknown-linux-gnu
--with-system-zlib --enable-languages=c,c++,ada,f77,objc,java
--enable-threads=posix --enable-long-long --disable-checking
--enable-cstdio=stdio --enable-clocale=generic --enable-__cxa_atexit
--enable-version-specific-runtime-libs
--with-gxx-include-dir=/usr/lib/gcc-lib/sparc-unknown-linux-gnu/3.2.3/include/g++-v3
--with-local-prefix=/usr/local --enable-shared --enable-nls
--without-included-gettext
Thread model: posix
gcc version 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r1, propolice)
[/code]
[/list]
Comment 1 Steven Faulconer 2003-08-20 11:58:49 UTC
Just to add my tidbits to this. I'm getting the same error on an Ultra60. My CFLAGS are pretty basic: "-mcpu=ultrasparc -O3 -pipe", and am installing off a fresh Gentoo installation. My 'gcc -v' and 'emerge info' look very similar to Ferris', plus or minus a few USE flags. I will try lowering the optimization level and recompiling to see if it works for me.
Comment 2 John Yeary 2003-09-02 12:02:37 UTC
The issue seems to be resolved by using gnome-extra/libgsf-1.8.1
Comment 3 Martin Holzer (RETIRED) gentoo-dev 2003-09-16 11:33:48 UTC
closing
Comment 4 Jason Wever (RETIRED) gentoo-dev 2003-09-16 12:25:49 UTC
Ferris,

Does gnome-extra/libgsf-1.8.1 suit your needs?

Et al,

Shouldn't it be worth checking into this gcc compiler failure?
Comment 5 Ferris McCormick (RETIRED) gentoo-dev 2003-09-16 13:11:40 UTC
1.  Actually, my solution was to use "USE=-gnome" since I don't need the
    library for anything.
2.  Unless the compiler is fixed in later releases or unless this is just
    an obvious problem with the source file, I would think we would want to know
    why the compiler fails, at least.  The corresponding source files between
    the two versions for gsf-outfile-zip.c are pretty different.
3.  I am always a bit leery when the compiler fix is to change the source it
    failed on, since the compiler problem has not gone away.  (That is, this
    was intended to be an error report against gcc, with gsf-outfile-zip.c as
    as specific example that triggered the error.  So, as an error against
    the libgsf, it is fixed.  As an error against gcc, it is sort of painted
    over.)

Regards,
Ferris