Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 218910

Summary: gcc-4.1.2 fails to compile in insn-attrtab.o
Product: Gentoo Linux Reporter: Tom Lloyd <napalmllama>
Component: [OLD] GCC PortingAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED DUPLICATE    
Severity: normal CC: truedfx
Priority: High    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Tom Lloyd 2008-04-22 16:55:45 UTC
gcc-4.1.2 fails to compile on amd64.  USE="fortran mudflap (multilib) nls (-altivec) -bootstrap -build -d -doc -gcj -gtk (-hardened) -ip28 -ip32r10k -libffi%* -multislot (-n32) (-n64) -nocxx -objc -objc++ -objc-gc -test -vanilla"

Reproducible: Always

Steps to Reproduce:
1.emerge gcc
2.
3.

Actual Results:  
Happily compiling, and then:

Automaton `k6_branch_unit'
        2 NDFA states,              5 NDFA arcs
        2 DFA states,               5 DFA arcs
        2 minimal DFA states,       5 minimal DFA arcs
      273 all insns          3 insn equivalence classes
    6 transition comb vector els,     6 trans table els: use simple vect
    6 state alts comb vector els,     6 state alts table els: use simple vect
    6 min delay table els, compression factor 8

Automaton `athlon'
      518 NDFA states,           1668 NDFA arcs
      518 DFA states,            1668 DFA arcs
       76 minimal DFA states,     328 minimal DFA arcs
      273 all insns         10 insn equivalence classes
  359 transition comb vector els,   760 trans table els: use simple vect
  359 state alts comb vector els,   760 state alts table els: use simple vect
  760 min delay table els, compression factor 2

Automaton `athlon_load'
      162 NDFA states,            855 NDFA arcs
      162 DFA states,             855 DFA arcs
      162 minimal DFA states,     855 minimal DFA arcs
      273 all insns         10 insn equivalence classes
 1047 transition comb vector els,  1620 trans table els: use simple vect
 1047 state alts comb vector els,  1620 state alts table els: use simple vect
 1620 min delay table els, compression factor 2

Automaton `athlon_mult'
       16 NDFA states,             48 NDFA arcs
       16 DFA states,              48 DFA arcs
       16 minimal DFA states,      48 minimal DFA arcs
      273 all insns          4 insn equivalence classes
   50 transition comb vector els,    64 trans table els: use simple vect
   50 state alts comb vector els,    64 state alts table els: use simple vect
   64 min delay table els, compression factor 2

Automaton `athlon_fp'
    15522 NDFA states,          99908 NDFA arcs
    15522 DFA states,           99908 DFA arcs
      463 minimal DFA states,    3038 minimal DFA arcs
      273 all insns         21 insn equivalence classes
 3057 transition comb vector els,  9723 trans table els: use comb vect
 3057 state alts comb vector els,  9723 state alts table els: use comb vect
 9723 min delay table els, compression factor 1

17533 all allocated states,     102661 all allocated arcs
32710 all allocated alternative states
 6256 all transition comb vector els, 16780 all trans table els
 6256 all state alts comb vector els, 16780 all state alts table els
16780 all min delay table els
    0 locked states num

  transformation: 0.008998, building DFA: 6.405025
  DFA minimization: 0.423936, making insn equivalence: 0.000000
 all automaton generation: 6.961942, output: 0.056992
/bin/sh /var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/gcc/../move-if-change tmp-attrtab.c insn-attrtab.c
insn-attrtab.c is unchanged
echo timestamp > s-attrtab
stage1/xgcc -Bstage1/ -B/usr/x86_64-pc-linux-gnu/bin/   -march=athlon64 -O2 -pipe -fprofile-generate -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 -I. -I. -I/var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/gcc -I/var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/gcc/. -I/var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/gcc/../include -I/var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/gcc/../libcpp/include     -c insn-attrtab.c \
          -o insn-attrtab.o

Message from syslogd@splig at Tue Apr 22 16:37:00 2008 ...
splig kernel: Bad pagetable: 000f [1] PREEMPT
{standard input}: Assembler messages:
{standard input}:114555: Warning: end of file not at end of a line; newline inserted
{standard input}:115939: Error: no such instruction: `i'
xgcc: Internal error: Killed (program cc1)
Please submit a full bug report.
See <URL:http://bugs.gentoo.org/> for instructions.
make[2]: *** [insn-attrtab.o] Error 1
make[2]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.1.2/work/build/gcc'
make[1]: *** [stageprofile_build] Error 2
make[1]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.1.2/work/build/gcc'
make: *** [profiledbootstrap] Error 2
 *
 * ERROR: sys-devel/gcc-4.1.2 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 4592:  Called toolchain_src_compile
 *             environment, line 5063:  Called gcc_src_compile
 *             environment, line 2918:  Called gcc_do_make
 *             environment, line 2748:  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 profiledbootstrap
 *




splig ~ # emerge --info
Portage 2.1.4.4 (default/linux/amd64/2008.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.25-splig-X0.1-vesafb x86_64)
=================================================================
System uname: 2.6.25-splig-X0.1-vesafb x86_64 AMD Athlon(tm) 64 Processor 3700+
Timestamp of tree: Fri, 18 Apr 2008 11:15:02 +0000
app-shells/bash:     3.2_p17-r1
dev-lang/python:     2.4.4-r6
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.61-r1
sys-devel/automake:  1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=athlon64 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages metadata-transfer parallel-fetch sandbox sfperms unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.mirrorservice.org/sites/www.ibiblio.org/gentoo/ http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo/ ftp://gentoo.virginmedia.com/sites/gentoo ftp://ftp.heanet.ie/pub/gentoo/ http://ftp.heanet.ie/pub/gentoo/"
LINGUAS="en_GB"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
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"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac aalib accessibility alsa amd64 asf avi bash-completion berkdb bluetooth branding browserplugin bzip2 cdr cjk cli cracklib crypt cups dbus dga divx divx4linux dri dv dvd dvdr encode ffmpeg firefox flac fortran gdbm gpm gtk2 hal howl iconv ieee1394 ipod ipv6 irmc isdnlog java kde kqemu lm_sensors logitech-mouse midi mime mjpeg mmx mmxext mono mozbranding mp3 mp4 mplayer msn mudflap multilib musicbrainz ncurses nls nptl nptlonly nsplugin nvidia offensive ogg opengl openmp pam pcre perl posix pppd python qt quicktime readline reflection samba sdl session spell spl spreadsheet sse sse2 ssl svg tcpd tiff truetype unicode usb v4l vcd videos visualization vorbis xcb xcomposite xine xinerama xorg xpm xscreensaver xv xvid xvmc zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_GB" USERLAND="GNU" VIDEO_CARDS="nv nvidia vesa fbdev"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Harald van Dijk (RETIRED) gentoo-dev 2008-04-22 17:08:10 UTC
This is almost certainly because you don't have enough memory; GCC needs a lot at this point. You should have more success with MAKEOPTS=-j1, or with more swap space added. If you still hit errors afterwards that look similar to this, please reopen this bug.

*** This bug has been marked as a duplicate of bug 151023 ***
Comment 2 Tom Lloyd 2008-04-22 19:56:01 UTC
It must be some phenomenal memory-muncher then - I have gig of RAM and another gig of swap!
Comment 3 Tom Lloyd 2008-04-23 12:29:33 UTC
OK, I'm fairly certain that it isn't an out-of-memory issue.  I just upped the swap to 2Gb, and set MAKEOPTS="-j1", as you suggested, and the build still fails in the same place.  I got slightly different output this time because the kernel didn't trip up as before:

stage1/xgcc -Bstage1/ -B/usr/x86_64-pc-linux-gnu/bin/   -march=athlon64 -O2 -pipe -fprofile-generate -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 -I. -I. -I/var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/gcc -I/var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/gcc/. -I/var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/gcc/../include -I/var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/gcc/../libcpp/include     -c insn-attrtab.c \
          -o insn-attrtab.o
/var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/gcc/config/i386/i386.md: In function 'internal_dfa_insn_code':
/var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/gcc/config/i386/i386.md:200: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.gentoo.org/> for instructions.
The bug is not reproducible, so it is likely a hardware or OS problem.
make[2]: *** [insn-attrtab.o] Error 1
make[2]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.1.2/work/build/gcc'
make[1]: *** [stageprofile_build] Error 2
make[1]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.1.2/work/build/gcc'
make: *** [profiledbootstrap] Error 2


...and the reason I'm /sure/ it wasn't an out-of-memory error?  I ran the following while I was compiling:
$ while [ ! -z `pgrep emerge` ]
> do date
> free
> echo
> sleep 5
> done

The last dozen or so entries (I didn't have any scrollback) all show almost zero swap usage and about 500Mb free -/+ buffers/cache.

If it's any help, this is a fresh install using a 2008.0_beta1 stage3 tarball.  I cross-compiled the kernel from my 32bit install, (so I didn't have to download and boot the ISO), but that's the only oddity about the whole setup.
Comment 4 Harald van Dijk (RETIRED) gentoo-dev 2008-04-23 19:53:32 UTC
Re-opening...
Comment 5 Harald van Dijk (RETIRED) gentoo-dev 2008-04-23 19:54:27 UTC
...so that the toolchain folks can take a look at this new error message. :)
Comment 6 SpanKY gentoo-dev 2008-04-24 03:53:37 UTC
this line is pretty significant:
The bug is not reproducible, so it is likely a hardware or OS problem.

that means the gcc code re-ran the code that segfaulted and it didnt segfault the second time ...

*** This bug has been marked as a duplicate of bug 20600 ***
Comment 7 Tom Lloyd 2008-04-24 09:23:15 UTC
Well then maybe this is a bug for the releng team?  I'm sorry to keep bothering you, but like I said this is a fresh install of 2008.0_beta1.  If the standard release being put out by Gentoo is failing on a pretty standard AMD64 rig, there's got to be a problem somewhere.  My hardware is solid; I've never had any problems with it in 3 years.
Comment 8 SpanKY gentoo-dev 2008-04-24 22:16:00 UTC
it's a resource issue.  gcc-4.1.2 is known to consume memory when building.  in fact, the error message you posted originally indicated this:
...splig kernel: Bad pagetable: 000f [1] PREEMPT...
that means you ran out of resources and the kernel killed it

you can remove -pipe from CFLAGS while building gcc and that may also help