Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 265113 - sys-devel/gcc-4 fails to build on VIA's Nano (x86_64)
Summary: sys-devel/gcc-4 fails to build on VIA's Nano (x86_64)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GCC Porting (show other bugs)
Hardware: AMD64 Linux
: High major with 2 votes (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-06 14:26 UTC by Andreas Tanz
Modified: 2011-07-14 18:50 UTC (History)
6 users (show)

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


Attachments
GCC build failure log (build.log,249.60 KB, text/plain)
2009-05-09 01:21 UTC, Vietor Davis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Tanz 2009-04-06 14:26:34 UTC
Hi!

It's impossible to compile any gcc-4.*.*(up to 4.3.3).

The failure is reproduceable. Everything else compiles fine since i use "-march=native" with gcc-4.3.3 (built on another machine).
The System seems stable - now it's up for 2 weeks - so it seems not to be some memory failure...
I even tried several kernels and several glibc's (2.6.1, 2.8_p20080602-r1, with and without multilib).


# emerge =sys-devel/gcc-4.3.3
...
x86_64-pc-linux-gnu-gcc -c   -O -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros                               -Wno-overlength-strings -fno-common   -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I/opt/portage-compile/portage/sys-devel/gcc-4.3.3/work/gcc-4.3.3/gcc -I/opt/portage-compile/portage/sys-devel/gcc-4.3.3/work/gcc-4.3.3/gcc/build -I/opt/portage-compile/portage/sys-devel/gcc-4.3.3/work/gcc-4.3.3/gcc/../include -I/opt/portage-compile/portage/sys-devel/gcc-4.3.3/work/gcc-4.3.3/gcc/../libcpp/include  -I/opt/portage-compile/portage/sys-devel/gcc-4.3.3/work/gcc-4.3.3/gcc/../libdecnumber -I/opt/portage-compile/portage/sys-devel/gcc-4.3.3/work/gcc-4.3.3/gcc/../libdecnumber/bid -I../libdecnumber    -o build/genrecog.o /opt/portage-compile/portage/sys-devel/gcc-4.3.3/work/gcc-4.3.3/gcc/genrecog.c
x86_64-pc-linux-gnu-gcc   -O -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros                                  -Wno-overlength-strings -fno-common   -DHAVE_CONFIG_H -DGENERATOR_FILE -Wl,-O1 -o build/genrecog \
            build/genrecog.o build/rtl.o build/read-rtl.o build/ggc-none.o build/vec.o build/min-insn-modes.o build/gensupport.o build/print-rtl.o build/errors.o ../build-x86_64-pc-linux-gnu/libiberty/libiberty.a
build/genrecog /opt/portage-compile/portage/sys-devel/gcc-4.3.3/work/gcc-4.3.3/gcc/config/i386/i386.md \
          insn-conditions.md > tmp-recog.c
*** glibc detected *** build/genrecog: double free or corruption (out): 0x00000000009e5b30 ***
======= Backtrace: =========
/lib/libc.so.6[0x2b85472e7d4d]
/lib/libc.so.6(cfree+0x76)[0x2b85472e97a6]
build/genrecog[0x403270]
build/genrecog[0x404218]
build/genrecog[0x40525e]
/lib/libc.so.6(__libc_start_main+0xf4)[0x2b85472944a4]
build/genrecog(calloc+0xc1)[0x4014d9]
======= Memory map: ========
00400000-00418000 r-xp 00000000 03:06 590941                             /opt/portage-compile/portage/sys-devel/gcc-4.3.3/work/build/gcc/build/genrecog
00617000-00618000 r--p 00017000 03:06 590941                             /opt/portage-compile/portage/sys-devel/gcc-4.3.3/work/build/gcc/build/genrecog
00618000-00619000 rw-p 00018000 03:06 590941                             /opt/portage-compile/portage/sys-devel/gcc-4.3.3/work/build/gcc/build/genrecog
00619000-009fb000 rw-p 00619000 00:00 0                                  [heap]
2b854705a000-2b8547075000 r-xp 00000000 03:01 18481                      /lib64/ld-2.8.so
2b8547075000-2b8547078000 rw-p 2b8547075000 00:00 0
2b85470b9000-2b8547139000 rw-p 2b85470b9000 00:00 0
2b8547274000-2b8547275000 r--p 0001a000 03:01 18481                      /lib64/ld-2.8.so
2b8547275000-2b8547276000 rw-p 0001b000 03:01 18481                      /lib64/ld-2.8.so
2b8547276000-2b85473b7000 r-xp 00000000 03:01 18484                      /lib64/libc-2.8.so
2b85473b7000-2b85475b7000 ---p 00141000 03:01 18484                      /lib64/libc-2.8.so
2b85475b7000-2b85475bb000 r--p 00141000 03:01 18484                      /lib64/libc-2.8.so
2b85475bb000-2b85475bc000 rw-p 00145000 03:01 18484                      /lib64/libc-2.8.so
2b85475bc000-2b85475c2000 rw-p 2b85475bc000 00:00 0
2b85475c2000-2b85475d8000 r-xp 00000000 03:01 6188                       /lib64/libgcc_s.so.1
2b85475d8000-2b85477d7000 ---p 00016000 03:01 6188                       /lib64/libgcc_s.so.1
2b85477d7000-2b85477d8000 r--p 00015000 03:01 6188                       /lib64/libgcc_s.so.1
2b85477d8000-2b85477d9000 rw-p 00016000 03:01 6188                       /lib64/libgcc_s.so.1
2b8548000000-2b8548021000 rw-p 2b8548000000 00:00 0
2b8548021000-2b854c000000 ---p 2b8548021000 00:00 0
7fff63a37000-7fff63a50000 rw-p 7ffffffe6000 00:00 0                      [stack]
7fff63be4000-7fff63be5000 r-xp 7fff63be4000 00:00 0                      [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
/bin/sh: line 1: 18884 Aborted                 build/genrecog /opt/portage-compile/portage/sys-devel/gcc-4.3.3/work/gcc-4.3.3/gcc/config/i386/i386.md insn-conditions.md > tmp-recog.c
make[3]: *** [s-recog] Error 134
make[3]: Leaving directory `/opt/portage-compile/portage/sys-devel/gcc-4.3.3/work/build/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/opt/portage-compile/portage/sys-devel/gcc-4.3.3/work/build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/opt/portage-compile/portage/sys-devel/gcc-4.3.3/work/build'
make: *** [bootstrap-lean] Error 2
 *
 * ERROR: sys-devel/gcc-4.3.3 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 4821:  Called toolchain_src_compile
 *             environment, line 5341:  Called gcc_src_compile
 *             environment, line 3085:  Called gcc_do_make
 *             environment, line 2876:  Called die
 * The specific snippet of code:
 *       emake LDFLAGS="${LDFLAGS}" STAGE1_CFLAGS="${STAGE1_CFLAGS}" LIBPATH="${LIBPATH}" BOOT_CFLAGS="${BOOT_CFLAGS}" ${GCC_MAKE_TARGET} || die "emake failed with ${GCC_MAKE_TARGET}";
 *  The die message:
 *   emake failed with bootstrap-lean
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/opt/portage-compile/portage/sys-devel/gcc-4.3.3/temp/build.log'.
 * The ebuild environment file is located at '/opt/portage-compile/portage/sys-devel/gcc-4.3.3/temp/environment'.
 *


-------------------------------------------------------------------------


# emerge --info
Portage 2.1.6.7 (default/linux/amd64/2008.0, gcc-4.3.3, glibc-2.8_p20080602-r1, 2.6.29-git9 x86_64)
=================================================================
System uname: Linux-2.6.29-git9-x86_64-VIA_Nano_processor_L2200@1600MHz-with-glibc2.2.5
Timestamp of tree: Mon, 06 Apr 2009 07:20:02 +0000
distcc 3.0 x86_64-pc-linux-gnu [disabled]
app-shells/bash:     3.2_p39
dev-java/java-config: 2.1.7
dev-lang/python:     2.4.4-r13, 2.5.2-r7
dev-python/pycrypto: 2.0.1-r8
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.3-r1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r1, 2.18-r4
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.28-r1
ABI="amd64"
ACCEPT_KEYWORDS="amd64"
ALSA_....<cutted>
ARCH="amd64"
ASFLAGS_x86="--32"
AUTOCLEAN="yes"
BOOST_INCLUDEDIR="/usr/include/boost-1_37/"
BOOST_ROOT="/usr/lib64/"
CBUILD="x86_64-pc-linux-gnu"
CDEFINE_amd64="__x86_64__"
CDEFINE_x86="__i386__"
CFLAGS="-Os -march=native -mno-tls-direct-seg-refs -fno-reorder-blocks -fno-reorder-functions -pipe"
CFLAGS_x86="-m32"
CHOST="x86_64-pc-linux-gnu"
CHOST_amd64="x86_64-pc-linux-gnu"
CHOST_x86="i686-pc-linux-gnu"
CLEAN_DELAY="5"
COLLISION_IGNORE="/lib/modules"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CVS_RSH="ssh"
CXXFLAGS="-Os -march=native -mno-tls-direct-seg-refs -fno-reorder-blocks -fno-reorder-functions -pipe"
DCCC_PATH="/usr/lib64/distcc/bin"
DEFAULT_ABI="amd64"
DISPLAY="localhost:11.0"
DISTCC_LOG=""
DISTCC_VERBOSE="0"
DISTDIR="/usr/portage/distfiles"
EDITOR="/bin/nano"
ELIBC="glibc"
EMERGE_DEFAULT_OPTS="-vt"
EMERGE_WARNING_DELAY="10"
FEATURES="bindist buildpkg candy distlocks fixpackages metadata-transfer nostrip parallel-fetch protect-owned sfperms suidctl test-fail-continue unmerge-orphans"
FETCHCOMMAND="/usr/bin/wget -Y on  -t 5 -T 60 --passive-ftp ${URI} -P ${DISTDIR}"
GCC_SPECS=""
GDK_USE_XFT="1"
GENTOO_MIRRORS="..."
HOME="/root"
INFOPATH="/usr/share/info:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.18/info:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.3/info"
INPUT_DEVICES="evdev keyboard mouse"
JAVAC="/etc/java-config-2/current-system-vm/bin/javac"
JAVA_HOME="/etc/java-config-2/current-system-vm"
JDK_HOME="/etc/java-config-2/current-system-vm"
KERNEL="linux"
LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text"
LDFLAGS="-Wl,-O1"
LDFLAGS_x86="-m elf_i386"
LESS="-R -M --shift 5"
LESSOPEN="|lesspipe.sh %s"
LIBDIR_amd64="lib64"
LIBDIR_amd64_fbsd="lib64"
LIBDIR_ppc="lib32"
LIBDIR_ppc64="lib64"
LIBDIR_sparc32="lib32"
LIBDIR_sparc64="lib64"
LIBDIR_x86="lib32"
LIBDIR_x86_fbsd="lib32"
LINGUAS="en us de"
LOGNAME="root"
LS_COLORS="no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.svgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.patch=00;32:*.diff=00;32:*.log=00;32:*.tex=00;32:*.doc=00;32:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:"
MAIL="/var/mail/root"
MAKEOPTS="-j1"
MANPATH="/etc/java-config-2/current-system-vm/man:/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.18/man:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.3/man:/etc/java-config/system-vm/man/:/usr/kde/3.5/share/man:/usr/qt/3/doc/man"
MULTILIB_ABIS="amd64 x86"
MULTILIB_STRICT_DENY="64-bit.*shared object"
MULTILIB_STRICT_DIRS="/lib32 /lib /usr/lib32 /usr/lib /usr/kde/*/lib32 /usr/kde/*/lib /usr/qt/*/lib32 /usr/qt/*/lib /usr/X11R6/lib32 /usr/X11R6/lib"
MULTILIB_STRICT_EXEMPT="(perl5|gcc|gcc-lib|binutils|eclipse-3|debug|portage)"
NETBEANS="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml"
OPENGL_PROFILE="xorg-x11"
PAGER="/usr/bin/less"
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.3.3:/usr/kde/3.5/sbin:/usr/kde/3.5/bin:/usr/qt/3/bin:/usr/lib/subversion/bin"
PKGDIR="/opt/portage-packages"
PKG_CONFIG_PATH="/usr/qt/3/lib64/pkgconfig"
PORTAGE_ARCHLIST="ppc s390 amd64 x86 ppc64 x86-fbsd m68k arm sparc sh mips ia64 alpha hppa amd64-fbsd sparc-fbsd"
PORTAGE_BINHOST_CHUNKSIZE="3000"
PORTAGE_BIN_PATH="/usr/lib64/portage/bin"
PORTAGE_COMPRESS_EXCLUDE_SUFFIXES="css gif htm[l]? jp[e]?g js pdf png"
PORTAGE_CONFIGROOT="/"
PORTAGE_COUNTER_HASH="caaebc561d1b251cc9c7a39ebbf44716"
PORTAGE_DEBUG="0"
PORTAGE_DEPCACHEDIR="/var/cache/edb/dep"
PORTAGE_ELOG_CLASSES="log warn error"
PORTAGE_ELOG_MAILFROM="portage@localhost"
PORTAGE_ELOG_MAILSUBJECT="[portage] ebuild log for ${PACKAGE} on ${HOST}"
PORTAGE_ELOG_MAILURI="root"
PORTAGE_ELOG_SYSTEM="save_summary echo"
PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS="5"
PORTAGE_FETCH_RESUME_MIN_SIZE="350K"
PORTAGE_GID="250"
PORTAGE_INST_GID="0"
PORTAGE_INST_UID="0"
PORTAGE_NICENESS="5"
PORTAGE_PYM_PATH="/usr/lib64/portage/pym"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_RSYNC_RETRIES="3"
PORTAGE_TMPDIR="/opt/portage-compile"
PORTAGE_VERBOSE="1"
PORTAGE_WORKDIR_MODE="0700"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/db/overlay"
PROFILE_ONLY_VARIABLES="ARCH ELIBC KERNEL USERLAND"
PWD="/root"
PYTHONDOCS="/usr/share/doc/python-docs-2.5.1/html/lib"
QMAKESPEC="linux-g++"
QTDIR="/usr/qt/3"
RESUMECOMMAND="/usr/bin/wget -Y on -c -t 5 -T 60 --passive-ftp ${URI} -P ${DISTDIR}"
ROOT="/"
ROOTPATH="/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.3.3:/usr/kde/3.5/sbin:/usr/kde/3.5/bin:/usr/qt/3/bin:/usr/lib/subversion/bin"
RPMDIR="/usr/portage/rpm"
SHELL="/bin/bash"
SHLVL="2"
SSH_CLIENT="..."
SSH_CONNECTION="..."
SSH_TTY="/dev/pts/1"
STAGE1_USE="multilib nptl nptlonly unicode"
STY="31625.pts-1.grmpf"
SYMLINK_LIB="yes"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
TERM="screen"
TERMCAP="..."
USE="..." ALSA_PCM_PLUGINS=".." APACHE2_MODULES="..." ELIBC="glibc" INPUT_DEVICES="..." KERNEL="linux" LCD_DEVICES="..." LINGUAS="en us de" USERLAND="GNU" VIDEO_CARDS="via vga vesa"
USER="root"
USERLAND="GNU"
USE_EXPAND="..."
USE_EXPAND_HIDDEN="CROSSCOMPILE_OPTS ELIBC KERNEL USERLAND"
USE_ORDER="env:pkg:conf:defaults:pkginternal:env.d"
VIDEO_CARDS="via vga vesa"
WINDOW="1"
XDG_DATA_DIRS="/usr/share:/usr/kde/3.5/share:/usr/local/share"
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2009-04-06 22:06:40 UTC
This might sound stupid but do you always get the same error message when you try to compile gcc-4*?
Comment 2 Andreas Tanz 2009-04-07 12:43:12 UTC
(In reply to comment #1)
> This might sound stupid but do you always get the same error message when you
> try to compile gcc-4*?
> 

Build fails allways when tmp-recog.c is being created.
I don't know what this is for... I assume something cpu related is being recognized and gcc is not aware of some special behavior of the Nano.
Or has it to do with some old i386 code? Maybe it's possible to deactivate this pice of code on a x86_64 platform as it's not needed?

# emerge =sys-devel/gcc-4.1.2  (4.2.4-r1 and 4.3.2-r3 follows)
...
gcc   -O -DENABLE_CHECKING -DENABLE_ASSERT_CHECKING -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -Wmissing-format-attribute    -DHAVE_CONFIG_H -DGENERATOR_FILE -Wl,-O1 -o build/genrecog \
                build/genrecog.o build/rtl.o build/read-rtl.o build/ggc-none.o build/min-insn-modes.o build/gensupport.o build/insn-conditions.o build/print-rtl.o \
                build/errors.o ../build-x86_64-pc-linux-gnu/libiberty/libiberty.a
build/genrecog /opt/portage-compile/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/gcc/config/i386/i386.md > tmp-recog.c
*** glibc detected *** build/genrecog: double free or corruption (out): 0x00000000009144f0 ***
======= Backtrace: =========
/lib/libc.so.6[0x2b18d6612d4d]
/lib/libc.so.6(cfree+0x76)[0x2b18d66147a6]
build/genrecog[0x403648]
build/genrecog[0x4042e2]
build/genrecog[0x40531e]
/lib/libc.so.6(__libc_start_main+0xf4)[0x2b18d65bf4a4]
build/genrecog(calloc+0xc1)[0x4014d9]
======= Memory map: ========
00400000-00426000 r-xp 00000000 03:06 677583                             /opt/portage-compile/portage/sys-devel/gcc-4.1.2/work/build/gcc/build/genrecog
00625000-00626000 r--p 00025000 03:06 677583                             /opt/portage-compile/portage/sys-devel/gcc-4.1.2/work/build/gcc/build/genrecog
00626000-00627000 rw-p 00026000 03:06 677583                             /opt/portage-compile/portage/sys-devel/gcc-4.1.2/work/build/gcc/build/genrecog
00627000-00932000 rw-p 00627000 00:00 0                                  [heap]
2b18d6385000-2b18d63a0000 r-xp 00000000 03:01 18481                      /lib64/ld-2.8.so
2b18d63a0000-2b18d63e3000 rw-p 2b18d63a0000 00:00 0
2b18d659f000-2b18d65a0000 r--p 0001a000 03:01 18481                      /lib64/ld-2.8.so
2b18d65a0000-2b18d65a1000 rw-p 0001b000 03:01 18481                      /lib64/ld-2.8.so
2b18d65a1000-2b18d66e2000 r-xp 00000000 03:01 18484                      /lib64/libc-2.8.so
2b18d66e2000-2b18d68e2000 ---p 00141000 03:01 18484                      /lib64/libc-2.8.so
2b18d68e2000-2b18d68e6000 r--p 00141000 03:01 18484                      /lib64/libc-2.8.so
2b18d68e6000-2b18d68e7000 rw-p 00145000 03:01 18484                      /lib64/libc-2.8.so
2b18d68e7000-2b18d68ed000 rw-p 2b18d68e7000 00:00 0
2b18d68ed000-2b18d6903000 r-xp 00000000 03:01 6188                       /lib64/libgcc_s.so.1
2b18d6903000-2b18d6b02000 ---p 00016000 03:01 6188                       /lib64/libgcc_s.so.1
2b18d6b02000-2b18d6b03000 r--p 00015000 03:01 6188                       /lib64/libgcc_s.so.1
2b18d6b03000-2b18d6b04000 rw-p 00016000 03:01 6188                       /lib64/libgcc_s.so.1
2b18d8000000-2b18d8021000 rw-p 2b18d8000000 00:00 0
2b18d8021000-2b18dc000000 ---p 2b18d8021000 00:00 0
7fffd470b000-7fffd4724000 rw-p 7ffffffe6000 00:00 0                      [stack]
7fffd47fa000-7fffd47fb000 r-xp 7fffd47fa000 00:00 0                      [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
/bin/sh: line 1: 14859 Aborted                 build/genrecog /opt/portage-compile/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/gcc/config/i386/i386.md > tmp-recog.c
make[2]: *** [s-recog] Error 134
make[2]: Leaving directory `/opt/portage-compile/portage/sys-devel/gcc-4.1.2/work/build/gcc'
make[1]: *** [stage1_build] Error 2
make[1]: Leaving directory `/opt/portage-compile/portage/sys-devel/gcc-4.1.2/work/build/gcc'
make: *** [bootstrap-lean] Error 2

--------------------------------------------------------------------------

# emerge =sys-devel/gcc-4.2.4-r1
...
gcc   -O -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wmissing-format-attribute -fno-common   -DHAVE_CONFIG_H -DGENERATOR_FILE -Wl,-O1 -o build/genrecog \
            build/genrecog.o build/rtl.o build/read-rtl.o build/ggc-none.o build/vec.o build/min-insn-modes.o build/gensupport.o build/print-rtl.o build/errors.o ../build-x86_64-pc-linux-gnu/libiberty/libiberty.a
build/genrecog /opt/portage-compile/portage/sys-devel/gcc-4.2.4-r1/work/gcc-4.2.4/gcc/config/i386/i386.md \
          insn-conditions.md > tmp-recog.c
*** glibc detected *** build/genrecog: double free or corruption (out): 0x0000000000916e70 ***
======= Backtrace: =========
/lib/libc.so.6[0x2b9b62faed4d]
/lib/libc.so.6(cfree+0x76)[0x2b9b62fb07a6]
build/genrecog[0x403240]
build/genrecog[0x4041e8]
build/genrecog[0x40521e]
/lib/libc.so.6(__libc_start_main+0xf4)[0x2b9b62f5b4a4]
build/genrecog(calloc+0xc1)[0x4014d9]
======= Memory map: ========
00400000-00417000 r-xp 00000000 03:06 715285                             /opt/portage-compile/portage/sys-devel/gcc-4.2.4-r1/work/build/gcc/build/genrecog
00616000-00617000 r--p 00016000 03:06 715285                             /opt/portage-compile/portage/sys-devel/gcc-4.2.4-r1/work/build/gcc/build/genrecog
00617000-00618000 rw-p 00017000 03:06 715285                             /opt/portage-compile/portage/sys-devel/gcc-4.2.4-r1/work/build/gcc/build/genrecog
00618000-0091e000 rw-p 00618000 00:00 0                                  [heap]
2b9b62d21000-2b9b62d3c000 r-xp 00000000 03:01 18481                      /lib64/ld-2.8.so
2b9b62d3c000-2b9b62d7f000 rw-p 2b9b62d3c000 00:00 0
2b9b62f3b000-2b9b62f3c000 r--p 0001a000 03:01 18481                      /lib64/ld-2.8.so
2b9b62f3c000-2b9b62f3d000 rw-p 0001b000 03:01 18481                      /lib64/ld-2.8.so
2b9b62f3d000-2b9b6307e000 r-xp 00000000 03:01 18484                      /lib64/libc-2.8.so
2b9b6307e000-2b9b6327e000 ---p 00141000 03:01 18484                      /lib64/libc-2.8.so
2b9b6327e000-2b9b63282000 r--p 00141000 03:01 18484                      /lib64/libc-2.8.so
2b9b63282000-2b9b63283000 rw-p 00145000 03:01 18484                      /lib64/libc-2.8.so
2b9b63283000-2b9b63289000 rw-p 2b9b63283000 00:00 0
2b9b63289000-2b9b6329f000 r-xp 00000000 03:01 6188                       /lib64/libgcc_s.so.1
2b9b6329f000-2b9b6349e000 ---p 00016000 03:01 6188                       /lib64/libgcc_s.so.1
2b9b6349e000-2b9b6349f000 r--p 00015000 03:01 6188                       /lib64/libgcc_s.so.1
2b9b6349f000-2b9b634a0000 rw-p 00016000 03:01 6188                       /lib64/libgcc_s.so.1
2b9b64000000-2b9b64021000 rw-p 2b9b64000000 00:00 0
2b9b64021000-2b9b68000000 ---p 2b9b64021000 00:00 0
7fff47d70000-7fff47d89000 rw-p 7ffffffe6000 00:00 0                      [stack]
7fff47dfb000-7fff47dfc000 r-xp 7fff47dfb000 00:00 0                      [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
/bin/sh: line 1: 13836 Aborted                 build/genrecog /opt/portage-compile/portage/sys-devel/gcc-4.2.4-r1/work/gcc-4.2.4/gcc/config/i386/i386.md insn-conditions.md > tmp-recog.c
make[3]: *** [s-recog] Error 134
make[3]: Leaving directory `/opt/portage-compile/portage/sys-devel/gcc-4.2.4-r1/work/build/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/opt/portage-compile/portage/sys-devel/gcc-4.2.4-r1/work/build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/opt/portage-compile/portage/sys-devel/gcc-4.2.4-r1/work/build'
make: *** [bootstrap-lean] Error 2

-----------------------------------------------------

# emerge =sys-devel/gcc-4.3.2-r3
...
x86_64-pc-linux-gnu-gcc   -O -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros                                 -Wno-overlength-strings -fno-common   -DHAVE_CONFIG_H -DGENERATOR_FILE -Wl,-O1 -o build/genrecog \
            build/genrecog.o build/rtl.o build/read-rtl.o build/ggc-none.o build/vec.o build/min-insn-modes.o build/gensupport.o build/print-rtl.o build/errors.o ../build-x86_64-pc-linux-gnu/libiberty/libiberty.a
build/genrecog /opt/portage-compile/portage/sys-devel/gcc-4.3.2-r3/work/gcc-4.3.2/gcc/config/i386/i386.md \
          insn-conditions.md > tmp-recog.c
*** glibc detected *** build/genrecog: double free or corruption (out): 0x00000000009e55f0 ***
======= Backtrace: =========
/lib/libc.so.6[0x2ad657450d4d]
/lib/libc.so.6(cfree+0x76)[0x2ad6574527a6]
build/genrecog[0x403270]
build/genrecog[0x404218]
build/genrecog[0x40525e]
/lib/libc.so.6(__libc_start_main+0xf4)[0x2ad6573fd4a4]
build/genrecog(calloc+0xc1)[0x4014d9]
======= Memory map: ========
00400000-00418000 r-xp 00000000 03:06 777477                             /opt/portage-compile/portage/sys-devel/gcc-4.3.2-r3/work/build/gcc/build/genrecog
00617000-00618000 r--p 00017000 03:06 777477                             /opt/portage-compile/portage/sys-devel/gcc-4.3.2-r3/work/build/gcc/build/genrecog
00618000-00619000 rw-p 00018000 03:06 777477                             /opt/portage-compile/portage/sys-devel/gcc-4.3.2-r3/work/build/gcc/build/genrecog
00619000-009fe000 rw-p 00619000 00:00 0                                  [heap]
2ad6571c3000-2ad6571de000 r-xp 00000000 03:01 18481                      /lib64/ld-2.8.so
2ad6571de000-2ad6571e1000 rw-p 2ad6571de000 00:00 0
2ad657222000-2ad6572a2000 rw-p 2ad657222000 00:00 0
2ad6573dd000-2ad6573de000 r--p 0001a000 03:01 18481                      /lib64/ld-2.8.so
2ad6573de000-2ad6573df000 rw-p 0001b000 03:01 18481                      /lib64/ld-2.8.so
2ad6573df000-2ad657520000 r-xp 00000000 03:01 18484                      /lib64/libc-2.8.so
2ad657520000-2ad657720000 ---p 00141000 03:01 18484                      /lib64/libc-2.8.so
2ad657720000-2ad657724000 r--p 00141000 03:01 18484                      /lib64/libc-2.8.so
2ad657724000-2ad657725000 rw-p 00145000 03:01 18484                      /lib64/libc-2.8.so
2ad657725000-2ad65772b000 rw-p 2ad657725000 00:00 0
2ad65772b000-2ad657741000 r-xp 00000000 03:01 6188                       /lib64/libgcc_s.so.1
2ad657741000-2ad657940000 ---p 00016000 03:01 6188                       /lib64/libgcc_s.so.1
2ad657940000-2ad657941000 r--p 00015000 03:01 6188                       /lib64/libgcc_s.so.1
2ad657941000-2ad657942000 rw-p 00016000 03:01 6188                       /lib64/libgcc_s.so.1
2ad658000000-2ad658021000 rw-p 2ad658000000 00:00 0
2ad658021000-2ad65c000000 ---p 2ad658021000 00:00 0
7fff538cd000-7fff538e7000 rw-p 7ffffffe5000 00:00 0                      [stack]
7fff539fa000-7fff539fb000 r-xp 7fff539fa000 00:00 0                      [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
/bin/sh: line 1: 14781 Aborted                 build/genrecog /opt/portage-compile/portage/sys-devel/gcc-4.3.2-r3/work/gcc-4.3.2/gcc/config/i386/i386.md insn-conditions.md > tmp-recog.c
make[3]: *** [s-recog] Error 134
make[3]: Leaving directory `/opt/portage-compile/portage/sys-devel/gcc-4.3.2-r3/work/build/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/opt/portage-compile/portage/sys-devel/gcc-4.3.2-r3/work/build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/opt/portage-compile/portage/sys-devel/gcc-4.3.2-r3/work/build'
make: *** [bootstrap-lean] Error 2
Comment 3 Sergey Dryabzhinsky 2009-05-07 18:21:03 UTC
Did you run memtest86+ with several loops done? It's may be broken RAM on your machine...
Comment 4 Vietor Davis 2009-05-08 00:36:32 UTC
(In reply to comment #3)
> Did you run memtest86+ with several loops done? It's may be broken RAM on your
> machine...
> 

I get the same error on a Nano based system as well. It's not a local hardware fault with the original reporters machine. 

Additionally, several days worth of memtest86+ reported no faults on my hardware and the system has otherwise performed fine.

Error is reproducible running genrecog in isolation, as follows:

/var/tmp//portage/sys-devel/gcc-4.3.3-r2/work/build/gcc/build/genrecog /var/tmp/portage/sys-devel/gcc-4.3.3-r2/work/gcc-4.3.3/gcc/config/i386/i386.md

(snip)

*** glibc detected *** /var/tmp//portage/sys-devel/gcc-4.3.3-r2/work/build/gcc/build/genrecog: double free or corruption (out): 0x0000000001559ef0 ***
======= Backtrace: =========
/lib/libc.so.6[0x7f8208e1419d]
/lib/libc.so.6(cfree+0x76)[0x7f8208e15be6]
/var/tmp//portage/sys-devel/gcc-4.3.3-r2/work/build/gcc/build/genrecog[0x403868]
/var/tmp//portage/sys-devel/gcc-4.3.3-r2/work/build/gcc/build/genrecog[0x403e18]
/var/tmp//portage/sys-devel/gcc-4.3.3-r2/work/build/gcc/build/genrecog[0x40505e]
/lib/libc.so.6(__libc_start_main+0xf4)[0x7f8208dc14a4]
/var/tmp//portage/sys-devel/gcc-4.3.3-r2/work/build/gcc/build/genrecog(calloc+0xc1)[0x401499]
======= Memory map: ========
00400000-00417000 r-xp 00000000 00:0d 44624996                           /var/tmp/portage/sys-devel/gcc-4.3.3-r2/work/build/gcc/build/genrecog
00617000-00618000 r--p 00017000 00:0d 44624996                           /var/tmp/portage/sys-devel/gcc-4.3.3-r2/work/build/gcc/build/genrecog
00618000-00619000 rw-p 00018000 00:0d 44624996                           /var/tmp/portage/sys-devel/gcc-4.3.3-r2/work/build/gcc/build/genrecog
011a8000-01569000 rw-p 011a8000 00:00 0                                  [heap]
7f8204000000-7f8204021000 rw-p 7f8204000000 00:00 0 
7f8204021000-7f8208000000 ---p 7f8204021000 00:00 0 
7f8208b8c000-7f8208ba2000 r-xp 00000000 00:0d 16351558                   /lib64/libgcc_s.so.1
7f8208ba2000-7f8208da1000 ---p 00016000 00:0d 16351558                   /lib64/libgcc_s.so.1
7f8208da1000-7f8208da2000 r--p 00015000 00:0d 16351558                   /lib64/libgcc_s.so.1
7f8208da2000-7f8208da3000 rw-p 00016000 00:0d 16351558                   /lib64/libgcc_s.so.1
7f8208da3000-7f8208ee2000 r-xp 00000000 00:0d 22147628                   /lib64/libc-2.8.so
7f8208ee2000-7f82090e1000 ---p 0013f000 00:0d 22147628                   /lib64/libc-2.8.so
7f82090e1000-7f82090e5000 r--p 0013e000 00:0d 22147628                   /lib64/libc-2.8.so
7f82090e5000-7f82090e6000 rw-p 00142000 00:0d 22147628                   /lib64/libc-2.8.so
7f82090e6000-7f82090eb000 rw-p 7f82090e6000 00:00 0 
7f82090eb000-7f8209106000 r-xp 00000000 00:0d 22143601                   /lib64/ld-2.8.so
7f820923c000-7f82092bc000 rw-p 7f820923c000 00:00 0 
7f82092fc000-7f82092fe000 rw-p 7f82092fc000 00:00 0 
7f8209302000-7f8209305000 rw-p 7f8209302000 00:00 0 
7f8209305000-7f8209306000 r--p 0001a000 00:0d 22143601                   /lib64/ld-2.8.so
7f8209306000-7f8209307000 rw-p 0001b000 00:0d 22143601                   /lib64/ld-2.8.so
7fff112f2000-7fff11307000 rw-p 7ffffffea000 00:00 0                      [stack]
7fff11387000-7fff11388000 r-xp 7fff11387000 00:00 0                      [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Aborted



Running genrecog in valgrind completes successfully.
Comment 5 Mark Loeser (RETIRED) gentoo-dev 2009-05-08 01:15:55 UTC
Vietor:  What was the actual command you ran?  What is your `emerge --info'?
Comment 6 Mark Loeser (RETIRED) gentoo-dev 2009-05-08 01:16:27 UTC
Bah, nevermind about the command, I'm blind.  Can you attach the actual build.log though?
Comment 7 Vietor Davis 2009-05-09 01:21:58 UTC
Created attachment 190720 [details]
GCC build failure log

emerge --info
Portage 2.1.6.11 (default/linux/amd64/2008.0, gcc-4.3.2, glibc-2.8_p20080602-r1, 2.6.29-rc8 x86_64)
=================================================================
System uname: Linux-2.6.29-rc8-x86_64-VIA_Nano_processor_L2200@1600MHz-with-glibc2.2.5
Timestamp of tree: Thu, 07 May 2009 10:00:01 +0000
app-shells/bash:     3.2_p39
dev-lang/python:     2.4.4-r13, 2.5.2-r7
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.63
sys-devel/automake:  1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://192.168.1.2/gentoo-portage"
USE="acl amd64 apache2 bcmath berkdb bzip2 cli cracklib crypt ctype cups curl dri fortran gdbm gpm hash iconv isdnlog lm_sensors memlimit mhash midi mmx mudflap multilib ncurses nls nptl nptlonly ntpl ntplonly openmp pam pcre perl php posix pppd python readline reflection session simplexml soap sockets spl sqlite sse sse2 ssl sysfs tcpd threads tokenizer unicode utf8 xml xmlrpc zlib" ALSA_CARDS="..." ALSA_PCM_PLUGINS="..." APACHE2_MODULES="..." ELIBC="glibc" INPUT_DEVICES="..." KERNEL="linux" LCD_DEVICES="..." USERLAND="GNU" VIDEO_CARDS="..."
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 8 morgan wahl 2009-06-04 19:31:14 UTC
(In reply to comment #3)
> Did you run memtest86+ with several loops done? It's may be broken RAM on your
> machine...
> 

same problem here on a Nano L2200 with no-multilib profile. Is there a workaround (besides installing gentoo on another amd64 machine just to make a binpkg)? Is there anything I can do to help fix this?
Comment 9 Alexey Parshin 2009-07-12 08:42:03 UTC
Same problem on Samsung NC20 (VIA Nano) on freshly installed system.
Comment 10 Farid 2009-08-19 21:39:40 UTC
Same problem with my VIA VB8001.
Does anyone know when there will be a fix?
Is this reported upstream, since this is probably not a gentoo specific bug, or?
Are there any workarounds?
Comment 11 Mattias 2010-06-25 11:01:39 UTC
Still the same problem on a samsung NC20, up to gcc-4.4.3-r2 on 2.6.32-gentoo-r7. I can't be of much help here, but I can at least run commands on my machine and post the output, should anyone wish it. Feels a bit weird that the bug is marked as NEW after well over a year...
Comment 12 Erik Olofsson 2010-07-05 19:50:13 UTC
It seems the problem stems from compiling stage1 with -O flag. Compiling with the default flags works.

You do this by replacing 
STAGE1_CFLAGS=${STAGE1_CFLAGS-"-O"}
with
STAGE1_CFLAGS=${STAGE1_CFLAGS-""}
in /usr/portage/eclass/toolchain.eclass

Stage1 failing points to the bootstrap compiler being broken, but after completing emerge and trying again with the newly built compiler stage1 still fails with -O. Not sure if this is a bug in the Nano CPU that is causing this.

It would be useful to have a use flag to disable optimization of stage1 gcc. Stage1 never ends up anywhere, so it shouldn't really matter which optimization level it has.

You could try -O2 as well. I don't have time to try that now, but #79852 was fixed that way.
Comment 13 Fredrik Asperud 2010-07-27 06:25:07 UTC
(In reply to comment #12)
> You do this by replacing 
> STAGE1_CFLAGS=${STAGE1_CFLAGS-"-O"}
> with
> STAGE1_CFLAGS=${STAGE1_CFLAGS-""}
> in /usr/portage/eclass/toolchain.eclass
I couldn't get it to work with this.
But as also suggested i tried with STAGE1_CFLAGS=${STAGE1_CFLAGS-"-O2"} which work for me.

 

Comment 14 Ryan Hill (RETIRED) gentoo-dev 2010-07-28 05:09:08 UTC
Can you try the patch in bug #283041?
Comment 15 Ryan Hill (RETIRED) gentoo-dev 2010-08-01 03:06:11 UTC
Hopefully fixed.

http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/toolchain.eclass?r1=1.436&r2=1.437

Reopen if it's still broken.
Comment 16 Farid 2010-08-19 19:55:34 UTC
(In reply to comment #15)
> Hopefully fixed.
> 
> http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/toolchain.eclass?r1=1.436&r2=1.437
> 
> Reopen if it's still broken.
> 

I still can not compile gcc-4.4.4-r1. In which version should the fix be in?
Is it in the portage tree, or did I miss something?

The link says "gentoo-x86" that you posted with the diff. I run amd64.

(Sorry if I have missed something fundamental here).
Comment 17 Ryan Hill (RETIRED) gentoo-dev 2010-08-20 05:03:36 UTC
It's in all of them, so I guess it's not fixed after all.  Can you attach your full build log?
Comment 18 Farid 2010-08-20 14:59:18 UTC
(In reply to comment #17)
Sorry, my bad.
I noticed that I had some problems with heat. The build failed because the CPU got too hot.
I fixed the cooling, and gcc builds as supposed to.

Thank you for the work!


PS.
Now I am only waiting for the "-march=native" to do right for this CPU.
http://archives.free.net.ph/message/20091027.131749.81eb1bc0.ca.html
Comment 19 the_mgt 2010-10-22 12:48:07 UTC
Ok, the good thing is, it seems to work with gcc-4.4.5!
The bad thing is, that I now get "checking whether the C compiler works... no" errors...

I hope this is only a gcc-4.4.5 bug (I didnt merge that version intentionally, I unkeyworded gcc, because I want a hardened version with ssp), I will try 4.4.4-r2 when I am back home
Comment 20 Jason Miller 2011-07-14 18:50:26 UTC
I just moved a via nano system (vx800 based) to amd64 from x86.  I was regularly experiencing *many* crashes in lots of applications with similar messages about heap corruption.  I couldn't get very far on emerge since the emerge of dbus-glibc was failing.

My CFLAGS included "-O"  After I found this bug, I changed it to -O2 and re-merged everything "emerge -1 $(eix -I --only-names)" and all crashes have gone away.  Is there an upstream bug for this?  I'd like to check to see my problem is related.