Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 96931 - emerge of any package fails with a gcc segfault
Summary: emerge of any package fails with a gcc segfault
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High critical (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-24 02:10 UTC by Sarath Menon
Modified: 2005-12-11 19:45 UTC (History)
0 users

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


Attachments
Preprocessor output during the segfault. (ccEYdDQ7.out,80.79 KB, text/plain)
2005-06-24 02:14 UTC, Sarath Menon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sarath Menon 2005-06-24 02:10:43 UTC
I haven't emerged gcc/glibc in a while, so it struck me recently strange when i   
compiled KDE 3.4 that gcc segfaults every now and then.  I had first thought   
that this must be an issue with KDE and let it pass.  Now, when i emerge any   
app, configure fails complaining this:  
<snip> 
checking for long double... yes 
checking size of long double... configure: error: cannot compute sizeof (long 
double), 77 
See `config.log' for more details. 
</snip> 
  
Note that with some packages it is sizeof (int), others are sizeof (char) but  
every single emerge fails now. 
 
I checked config.log and i see this for the sizeof section: 
<snip> 
configure:7450: i686-pc-linux-gnu-gcc -o conftest -O2 -march=pentium4 -pipe 
-freorder-blocks -finline-limit=2000 -O2   conftest.c  >&5 
conftest.c: In function `main': 
conftest.c:100: internal compiler error: Segmentation fault 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <URL:http://bugs.gentoo.org/> for instructions. 
Preprocessed source stored 
into /var/tmp/portage/glibc-2.3.4.20041102-r1/temp/ccEYdDQ7.out file, please 
attach this to your bugreport. 
configure:7453: $? = 1 
configure: program exited with status 1 
configure: failed program was: 
| /* confdefs.h.  */ 
| 
| #define PACKAGE_NAME "GNU C Library" 
| #define PACKAGE_TARNAME "c-library" 
| #define PACKAGE_VERSION "(see version.h)" 
| #define PACKAGE_STRING "GNU C Library (see version.h)" 
| #define PACKAGE_BUGREPORT "glibc" 
| #define USE_REGPARMS 1 
| #ifdef __cplusplus 
| extern "C" void std::exit (int) throw (); using std::exit; 
| #endif 
| #define ASM_GLOBAL_DIRECTIVE .globl 
| #define HAVE_ASM_SET_DIRECTIVE 1 
| #define ASM_TYPE_DIRECTIVE_PREFIX @ 
| #define DO_VERSIONING 1 
| #define HAVE_ASM_PREVIOUS_DIRECTIVE 1 
| #define HAVE_PROTECTED 1 
| #define HAVE_HIDDEN 1 
| #define HAVE_VISIBILITY_ATTRIBUTE 1 
| #define HAVE_INITFINI_ARRAY 1 
| #define HAVE_Z_RELRO 1 
| #define HAVE_Z_COMBRELOC 1 
| #define NO_UNDERSCORES 1 
| #define HAVE_ASM_WEAK_DIRECTIVE 1 
| #define HAVE_ASM_CFI_DIRECTIVES 1 
| #define HAVE_CPP_ASM_DEBUGINFO 1 
| #define HAVE_SYS_TYPES_H 1 
| #define HAVE_SYS_STAT_H 1 
| #define HAVE_STDLIB_H 1 
| #define HAVE_STRING_H 1 
| #define HAVE_MEMORY_H 1 
| #define HAVE_STRINGS_H 1 
| #define HAVE_INTTYPES_H 1 
| #define HAVE_STDINT_H 1 
| #define HAVE_UNISTD_H 1 
| /* end confdefs.h.  */ 
| #include <stdio.h> 
| #if HAVE_SYS_TYPES_H 
| # include <sys/types.h> 
| #endif 
| #if HAVE_SYS_STAT_H 
| # include <sys/stat.h> 
| #endif 
| #if STDC_HEADERS 
| # include <stdlib.h> 
| # include <stddef.h> 
| #else 
| # if HAVE_STDLIB_H 
| #  include <stdlib.h> 
| # endif 
| #endif 
| #if HAVE_STRING_H 
| # if !STDC_HEADERS && HAVE_MEMORY_H 
| #  include <memory.h> 
| # endif 
| # include <string.h> 
| #endif 
| #if HAVE_STRINGS_H 
| # include <strings.h> 
| #endif 
| #if HAVE_INTTYPES_H 
| # include <inttypes.h> 
| #else 
| # if HAVE_STDINT_H 
| #  include <stdint.h> 
| # endif 
| #endif 
| #if HAVE_UNISTD_H 
| # include <unistd.h> 
| #endif 
| long longval () { return (long) (sizeof (long double)); } 
| unsigned long ulongval () { return (long) (sizeof (long double)); } 
| #include <stdio.h> 
| #include <stdlib.h> 
| int 
| main () 
| { 
| 
|   FILE *f = fopen ("conftest.val", "w"); 
|   if (! f) 
|     exit (1); 
|   if (((long) (sizeof (long double))) < 0) 
|     { 
|       long i = longval ();|       if (i != ((long) (sizeof (long double)))) 
|       exit (1); 
|       fprintf (f, "%ld\n", i); 
|     } 
|   else 
|     { 
|       unsigned long i = ulongval (); 
|       if (i != ((long) (sizeof (long double)))) 
|       exit (1); 
|       fprintf (f, "%lu\n", i); 
|     } 
|   exit (ferror (f) || fclose (f) != 0); 
| 
|   ; 
|   return 0; 
| } 
configure:7468: error: cannot compute sizeof (long double), 77 
See `config.log' for more details. 
</snip> 

Reproducible: Always
Steps to Reproduce:
1.
2.
3.




Portage 2.0.51.19 (default-linux/x86/2005.0, gcc-3.3.5-20050130, 
glibc-2.3.4.20041102-r1, 2.6.11-gentoo-r9 i686) 
================================================================= 
System uname: 2.6.11-gentoo-r9 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz 
Gentoo Base System version 1.6.12 
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, May 10 2005, 13:46:20)] 
dev-lang/python:     2.3.5 
sys-apps/sandbox:    [Not Present] 
sys-devel/autoconf:  2.59-r6, 2.13 
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.5 
sys-devel/binutils:  2.15.92.0.2-r10 
sys-devel/libtool:   1.5.16 
virtual/os-headers:  2.6.8.1-r2 
ACCEPT_KEYWORDS="x86" 
AUTOCLEAN="yes" 
CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe" 
CHOST="i686-pc-linux-gnu" 
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/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/alias /var/qmail/control" 
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" 
CXXFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe" 
DISTDIR="/usr/portage/distfiles" 
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms strict" 
GENTOO_MIRRORS="http://distfiles.gentoo.org 
http://distro.ibiblio.org/pub/Linux/distributions/gentoo" 
MAKEOPTS="-j2" 
PKGDIR="/usr/portage/packages" 
PORTAGE_TMPDIR="/var/tmp" 
PORTDIR="/usr/portage" 
SYNC="rsync://rsync.gentoo.org/gentoo-portage" 
USE="x86 X aalib alsa apache2 apm arts audiofile avi bash-completion berkdb 
bitmap-fonts cdr crypt cscope cups curl directfb dvd emboss encode esd fam flac 
foomaticdb fortran gd gdbm gif gpm gtk gtk2 hal imagemagick imlib ipv6 java 
jpeg junit kde ldap libg++ libwww lm_sensors mad mikmod mmx mng motif mozilla 
mp3 mpeg mysql ncurses nls offensive ogg oggvorbis opengl oss pam pdflib perl 
php pic png pnp posix python qt quicktime rdesktop readline sdl slang sockets 
sox spell sqlite sse ssl svg svga sysvipc tcltk tcpd tetex theora tiff truetype 
truetype-fonts type1-fonts unicode usb vhosts vorbis wmf xine xml2 xmlrpc xmms 
xosd xpm xprint xsl xv xvid zlib userland_GNU kernel_linux elibc_glibc" 
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, 
PORTDIR_OVERLAY
Comment 1 Sarath Menon 2005-06-24 02:14:20 UTC
Created attachment 61830 [details]
Preprocessor output during the segfault.

This is the preprocessor output that I got during the compile of glibc
Comment 2 Sarath Menon 2005-06-24 02:18:38 UTC
Oh, 
 
I must be getting old, i forgot to mention which package i was trying to emerge 
now ;). The whole output that i have posted including the preprocessor output 
is what i got during a "emerge glibc", because after reading past bugs, some 
other problems were solved by it. 
Comment 3 Sarath Menon 2005-06-24 08:24:41 UTC
Folks,   
   
Here is some additional info to debug it further.   
   
I have poked around the files that cause the ICE and found that gcc segfaults   
only when -O2, -O1 or -O3 optimizations are passed.  I tried with a couple of   
files, and found that -0[1-3] flags are also good to go.   
   
I tried compiling glibc and gcc without this flag to see if I could get a  
working configuration and saw that all configure scripts want to pass -O2 as  
standard to the Makefile.   
 
In fact glibc refuses to compile without any optimizations and gcc takes -O2 as 
a CFLAG even if I don't set it.  Is this behaviour due to the ebuild?  I dont 
think the vanilla versions of either one will make this modification. 
Comment 4 Sarath Menon 2005-06-25 05:17:40 UTC
Well, I fixed the issue myself. I build gcc using ./configure, make make  
install - this time keeping very sane CFLAGS.  The build went fine, and this  
one was able to accept all my old CFLAGS.  
  
I have since recompiled glibc (just to be on the safe side) and have tested  
that my gcc is now able to compile stuff like it used to do.  
  
Please close this bug, unless you have an explanation for what happened and  
steps/patches to fix it.  I doubt this being the case, then again, it could be  
because I did not have nptl support in glibc(I have enabled it now).  Iam not 
sure about it, so I leave it to you guys. 
Comment 5 Mark Loeser (RETIRED) gentoo-dev 2005-12-11 19:45:03 UTC
The user resolved the issue already, see the previous comment.