<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>84640</bug_id>
          
          <creation_ts>2005-03-09 08:59 0000</creation_ts>
          <short_desc>emerge weirdness</short_desc>
          <delta_ts>2005-03-21 07:54:43 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Applications</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>blocker</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>patrick@gentoo.org</reporter>
          <assigned_to>toolchain@gentoo.org</assigned_to>
          <cc>marek.wiecek@gmail.com</cc>
    
    <cc>plate@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>patrick@gentoo.org</who>
            <bug_when>2005-03-09 08:59:44 0000</bug_when>
            <thetext>During an emerge -e world, my system starts misbehaving at some point. After a few restarts, I&apos;m quite confident that it is during the merge phase of gcc that things  go wrong.
Symptoms are:
- windowmanager (blackbox) crashes
- kde apps (konqueror) segfault
- xorg terminates
Also, I&apos;ve seen portage abort the gcc merge with &quot;Segmentation fault&quot; 
The system runs stable for &gt;2 days (too noisy -&gt; shut down at night).
This problem has appeared about 3 weeks ago and has since then been pretty consistent.

Reproducible: Always
Steps to Reproduce:
1.emerge -e world
2.
3.



Expected Results:  
The emerge should have proceeded

Portage 2.0.51.19 (default-linux/x86/2004.3, gcc-3.4.3-20050110,
glibc-2.3.4.20050125-r0, 2.6.10 i686)
=================================================================
System uname: 2.6.10 i686 AMD Athlon(tm) XP 2600+
Gentoo Base System version 1.6.9
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, Mar  9 2005, 16:44:00)]
ccache version 2.3 [enabled]
dev-lang/python:     2.3.5
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-r5
sys-devel/libtool:   1.5.10-r5
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS=&quot;x86 ~x86&quot;
AUTOCLEAN=&quot;yes&quot;
CFLAGS=&quot;-O2 -march=athlon-xp -fomit-frame-pointer&quot;
CHOST=&quot;i686-pc-linux-gnu&quot;
CONFIG_PROTECT=&quot;/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/share/config
/usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /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&quot;
CONFIG_PROTECT_MASK=&quot;/etc/gconf /etc/terminfo /etc/env.d&quot;
CXXFLAGS=&quot;-O2 -march=athlon-xp -fomit-frame-pointer&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
FEATURES=&quot;autoaddcvs autoconfig buildpkg ccache distlocks sandbox sfperms&quot;
GENTOO_MIRRORS=&quot;http://pandemonium.tiscali.de/pub/gentoo/&quot;
LDFLAGS=&quot;-Wl,-O1&quot;
MAKEOPTS=&quot;-j2&quot;
PKGDIR=&quot;/usr/portage/packages&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage&quot;
SYNC=&quot;rsync://rsync.gentoo.org/gentoo-portage&quot;
USE=&quot;x86 3dnow 3dnowex X a52 aac aalib acpi alsa apache2 apm arts avi
bash-completion berkdb bidi bigger-fonts bitmap-fonts bootsplash ccache cdda
cddb cdparanoia cdr chroot codecs crypt cups curl dga dv dvd dvdr dvdread ecc
emboss encode esd faad fam fbcon ffmpeg fftw font-server foomaticdb fortran gd
gd-external gdbm gif glep gmp gpm imagemagick imlib ipv6 jabber jack jikes jit
jpeg jpeg2k kde kdeenablefinal ladcca libg++ libwww lm_sensors lzo lzw-tiff mad
matroska mhash mikmod mime mjpeg mmx mmx2 mng monkey motif mozilla mozsvg mp3
mpeg mpeg4 ncurses nls nptl nvidia ogg oggvorbis openal opengl oss pam
parse-clocks pdf pdflib perl physfs png python qt quicktime readline real recode
ruby samba sdl spell sse sse2 ssl svga tcpd threads tiff transcode truetype
truetype-fonts type1-fonts utf8 xml2 xv zlib&quot;
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, PORTDIR_OVERLAY</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>robbat2@gentoo.org</who>
            <bug_when>2005-03-09 13:55:06 0000</bug_when>
            <thetext>you need to provide more information, like the crash messages from GCC, tracebacks from kde/xorg/blackbox.

But I&apos;d venture your hardware isn&apos;t up to scratch.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>patrick@gentoo.org</who>
            <bug_when>2005-03-09 14:08:16 0000</bug_when>
            <thetext>It&apos;s not the hardware. I&apos;ve been compiling for ~8h now without any problems.
If I understand it correctly the weirdness happens during the gcc merge phase. Providing any tracebacks etc. is quite difficult since most running programs terminate ...
I&apos;ve seen blackbox quit with &quot;signal 11&quot;, not much info on the other apps.
It&apos;s one of those strangebugs that are hard to track down, but it is really annoying and might other users in the future.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>robbat2@gentoo.org</who>
            <bug_when>2005-03-09 14:40:25 0000</bug_when>
            <thetext>compile your glibc and crashing apps with 
FEATURES=&quot;nostrip&quot; CFLAGS=&quot;-ggdb3 -O2 -march=athlon-xp&quot;, 
then enable core dumps (ulimit -c ......)

Once you get a core dump file, use &apos;gdb binary corefile&apos;
and use the &apos;bt&apos; command in gdb to generate the trackback.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>plate@gentoo.org</who>
            <bug_when>2005-03-10 06:14:04 0000</bug_when>
            <thetext>Quick me,too here, so that Patrick doesn&apos;t feel alone. :) I&apos;m doing the same emerge -e, but I have no X running on this host. Symptoms are: 61 packages emerged without problems, then comes gcc-config-1.3.10-r1, big badaboom. Segmentation fault. Same result with gcc-3.4.3-20050110, everything (!) else compiles without any problems whatsoever.

Tell me what you need in terms of info from me. Here&apos;s an emerge info for starters:

Portage 2.0.51.19 (default-linux/x86/2004.0, gcc-3.4.3-20050110, glibc-2.3.4.20050125-r0, 2.6.11-gentoo-r1 i686)
=================================================================
System uname: 2.6.11-gentoo-r1 i686 AMD Athlon(tm) Processor
Gentoo Base System version 1.6.9
Python:              dev-lang/python-2.2.3-r5,dev-lang/python-2.3.5 [2.3.5 (#1, Mar 10 2005, 02:06:20)]
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
dev-lang/python:     2.2.3-r5, 2.3.5
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-r5
sys-devel/libtool:   1.5.10-r5
virtual/os-headers:  2.4.19-r1, 2.4.22-r1
ACCEPT_KEYWORDS=&quot;x86 ~x86&quot;
AUTOCLEAN=&quot;yes&quot;
CFLAGS=&quot;-march=athlon -O3 -pipe&quot;
CHOST=&quot;i686-pc-linux-gnu&quot;
CONFIG_PROTECT=&quot;/etc /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control&quot;
CONFIG_PROTECT_MASK=&quot;/etc/gconf /etc/terminfo /etc/env.d&quot;
CXXFLAGS=&quot;-march=athlon -O3 -pipe&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
FEATURES=&quot;autoaddcvs autoconfig ccache distcc sandbox sfperms userpriv&quot;
GENTOO_MIRRORS=&quot;http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo&quot;
MAKEOPTS=&quot;-j7&quot;
PKGDIR=&quot;/usr/portage/packages&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage&quot;
SYNC=&quot;rsync://rsync.de.gentoo.org/gentoo-portage&quot;
USE=&quot;x86 X apm arts avi berkdb bitmap-fonts canna cdr crypt cups curl dvd emboss encode esd fam fbcon flac font-server foomaticdb fortran freewnn gdbm gif gpm gtk gtk2 imlib immqt-bc ipv6 java jpeg kde libg++ libwww mad mikmod motif mozaccess-builtin mozctl mozilla mp3 mpeg ncurses nls nocardbus oggvorbis opengl oss pam pdflib perl png python qt quicktime readline scanner sdl slang spell ssl svga tcltk tcpd tiff truetype truetype-fonts type1-fonts userlocales xml2 xmms xv zlib&quot;
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, PORTDIR_OVERLAY</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>patrick@gentoo.org</who>
            <bug_when>2005-03-10 12:25:10 0000</bug_when>
            <thetext>Building in a chroot doesn&apos;t trigger it. Really interesting ...</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ferringb@gmail.com</who>
            <bug_when>2005-03-10 19:00:56 0000</bug_when>
            <thetext>quick request, but flip off the sandbox during these tests please (eradicator has reported some crazyness with sandbox and some gcc-config stuff he&apos;s hacking on).</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>plate@gentoo.org</who>
            <bug_when>2005-03-10 21:38:31 0000</bug_when>
            <thetext>FEATURES=&quot;-sandbox&quot; doesn&apos;t help, I still get the segfault right after &quot;&gt;&gt;&gt; Regenerating /etc/ld.so.cache&quot;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>robbat2@gentoo.org</who>
            <bug_when>2005-03-11 02:47:23 0000</bug_when>
            <thetext>when you get the segfault, there should be a core file somewhere as I noted.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>stkn@gentoo.org</who>
            <bug_when>2005-03-12 03:28:13 0000</bug_when>
            <thetext>it won&apos;t create a core file unless you set a new core file size limit (default is    0 = no core file) with ulimit -c (unit is 1024Bytes, better choose a large value, e.g. 32MB = 32768)

the error message will change to &quot;Segmentation fault (core dumped)&quot;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>plate@gentoo.org</who>
            <bug_when>2005-03-12 11:37:41 0000</bug_when>
            <thetext>Besides the fact that I&apos;ve been out of town since my last comment, had to emerge gdb to begin with, and am currently watching glibc compile with the flags Robin suggested, I&apos;m having a bit of a chicken-and-egg problem here: I get the segfaults exclusively from `emerge gcc` and `emerge gcc-config`, so what&apos;s the &quot;crashing application&quot; I should debug in those cases? If what Patrick said is true, that&apos;s probably gcc, but since the segmentation fault occurs everytime I emerge just that, I&apos;ll have difficulties building it with nostrip and -ggdb3... You need those to make sense of the core file, right?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>robbat2@gentoo.org</who>
            <bug_when>2005-03-13 01:17:29 0000</bug_when>
            <thetext>Build gcc and glibc with the required use flags on another machine that works, or get somebody else to (I&apos;ve got cpu power if you need it).</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>solar@gentoo.org</who>
            <bug_when>2005-03-19 06:56:24 0000</bug_when>
            <thetext>just noticed this bug.

Hey same thing here. host system is amd64 non multilib.

+ gcc-config x86_64-pc-linux-gnu-3.4.3
 * Switching to x86_64-pc-linux-gnu-3.4.3 compiler...                                                                                                 [ ok ]+ rm -f //usr/sbin/gcc-config
+ set +x
&gt;&gt;&gt; Regenerating /etc/ld.so.cache...
&gt;&gt;&gt; sys-devel/gcc-config-1.3.10-r1 merged.
Segmentation fault (core dumped)


python compiled with all the good stuff, but still yeilds no human readable backtrace.

The core does show the segfault is caused by 
&apos;/usr/bin/python2.3 -O /usr/bin/emerge gcc-config&apos; 
and it only happens in the qmerge phase. running from command line is fine.
(python@ || portage@) bug is my guess and not toolchain@

I&apos;ll continue to debug today to see what I can learn about this as it&apos;s a blocker for hardned doing any amd64 stages</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>solar@gentoo.org</who>
            <bug_when>2005-03-19 12:28:38 0000</bug_when>
            <thetext>It&apos;s a toolchain bug.
This fixes it.

--- gcc-config-1.3.10.orig      2005-03-19 20:27:01.223207288 +0000
+++ gcc-config-1.3.10   2005-03-19 20:27:32.493453488 +0000
@@ -229,7 +229,7 @@
        # On many systems (x86/amd64/etc...), this will probably never matter, 
        # but on other systems (arm/mips/etc...), this is quite critical.
        # http://bugs.gentoo.org/show_bug.cgi?id=60190
-       if ! is_cross_compiler ; then
+       if ! is_cross_compiler &amp;&amp; [[ $PORTAGE_CALLER != &quot;emerge&quot; ]] ; then
                for multilib in $(${ROOT}/${GCC_BIN_PATH}/gcc -print-multi-lib); do
                        multiarg=${multilib#*;}
                        multiarg=${multiarg/@/-}
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>plate@gentoo.org</who>
            <bug_when>2005-03-20 03:10:49 0000</bug_when>
            <thetext>Confirmed, changing that line in /usr/portage/sys-devel/gcc-config/files/gcc-config-1.3.10 makes the segfault go away. Thanks a lot, solar!</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2005-03-20 11:43:48 0000</bug_when>
            <thetext>patrick: can you confirm ?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>patrick@gentoo.org</who>
            <bug_when>2005-03-21 02:47:06 0000</bug_when>
            <thetext>gcc-config seems to work
emerge gcc 3.4.3-20050110-r1 fails

will apply patch and test.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>patrick@gentoo.org</who>
            <bug_when>2005-03-21 06:42:00 0000</bug_when>
            <thetext>patch works.

Awaiting new gcc-config release ;-)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2005-03-21 07:54:43 0000</bug_when>
            <thetext>already been fixed in portage</thetext>
          </long_desc>
      
    </bug>

</bugzilla>