Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 235948 - g++ 4.1.2 crash when building custom code: "internal compiler error: Segmentation fault"
Summary: g++ 4.1.2 crash when building custom code: "internal compiler error: Segmenta...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-27 18:52 UTC by stenyak
Modified: 2008-09-03 20:58 UTC (History)
0 users

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


Attachments
Compressed "/tmp/ccKC3cRo.out" file. (out.zip,258.38 KB, application/octet-stream)
2008-08-27 18:54 UTC, stenyak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description stenyak 2008-08-27 18:52:12 UTC
I'm developing a software package, and while building, under uncertain circumstances, g++ crashes, showing this on screen:
--------------------
g++ -o usr/share/motorsport/Threadable.os -c -g -O0 -ggdb3 -Wall -Wno-deprecated -ansi -pedantic --coverage -fprofile-arcs -ftest-coverage -isystem usr/include/boost-1_35 -isystem usr/include/boost-1_35 -fPIC -Iusr/include -Iusr/include/boost-1_35 -Iusr/include/boost-1_35 -Iusr/include/bullet usr/share/motorsport/Threadable.cpp
usr/share/motorsport/Threadable.cpp: In function '(static initializers for usr/share/motorsport/Threadable.cpp)':
usr/share/motorsport/Threadable.cpp:129: 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 /tmp/ccKC3cRo.out file, please attach this to your bugreport.
scons: *** [usr/share/motorsport/Threadable.os] Error 1
scons: building terminated because of errors.
--------------------
Attached is the aforementioned cKC3cRo.out file. The crash happens always, provided i don't change the piece of source code i'm trying to compile.
If needed, i can provide the whole source code and libs i'm using, but it totals 1.2GiB, since it includes builds/source code of third party libs (using specific svn revisions, of libs like boost, bullet, ogre, ogrecollada, fcollada, scons, unittest-cpp).

Reproducible: Always

Steps to Reproduce:
1.Run the g++ command shown above


Expected Results:  
The file should compile, or at least complain about syntax errors, link errors, or whatever.

$ uname -a
Linux 1ksurvivor 2.6.25-gentoo-r7 #1 SMP Thu Aug 21 15:15:49 CEST 2008 i686 Intel(R) Core(TM)2 CPU 4300 @ 1.80GHz GenuineIntel GNU/Linux
$ g++ --version
g++ (GCC) 4.1.2 (Gentoo 4.1.2 p1.1)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Comment 1 stenyak 2008-08-27 18:54:42 UTC
Created attachment 163933 [details]
Compressed "/tmp/ccKC3cRo.out" file.
Comment 2 Wormo (RETIRED) gentoo-dev 2008-08-27 20:00:06 UTC
What do you have for 'emerge -pv =sys-devel/gcc-4.1.2'?

I have a system with this gcc:
[ebuild   R   ] sys-devel/gcc-4.1.2  USE="doc fortran mudflap nls (-altivec) -bootstrap -build -d -gcj -gtk (-hardened) -ip28 -ip32r10k -libffi% (-multilib) -multislot (-n32) (-n64) -nocxx -objc -objc++ -objc-gc -test -vanilla" 50 kB

and I can't get your test case to fail. This is what I did, maybe you could try it too to make sure it is equivalent to your original compile:

cp ccKC3cRo.out test.cc
g++ -c -g -O0 -ggdb3 -Wall -Wno-deprecated -ansi -pedantic --coverage -fprofile-arcs -ftest-coverage test.cc
Comment 3 Wormo (RETIRED) gentoo-dev 2008-08-27 20:02:22 UTC
Also post your emerge --info, which includes some things you didn't mention (such as whether you're running 32-bit or 64-bit, version of glibc, etc) 
Comment 4 stenyak 2008-08-27 20:16:10 UTC
For the record, right now i'm getting this:
$ g++ -c -g -O0 -ggdb3 -Wall -Wno-deprecated -ansi -pedantic --coverage -fprofile-arcs -ftest-coverage test.cc
test.cc:2:3: warning: style of line directive is a GCC extension
usr/share/motorsport/Threadable.cpp:1:3: warning: style of line directive is a GCC extension
/home/stenyak/dev/motorsport//:1:3: warning: style of line directive is a GCC extension
<built-in>:1:3: warning: style of line directive is a GCC extension
<command line>:1:3: warning: style of line directive is a GCC extension
usr/share/motorsport/Threadable.cpp:2:3: warning: style of line directive is a GCC extension
In file included from usr/share/motorsport/Threadable.cpp:3:
usr/share/motorsport/Threadable.h:5:3: warning: style of line directive is a GCC extension
usr/share/motorsport/Threadable.h:7:3: warning: style of line directive is a GCC extension
usr/share/motorsport/Threadable.h:9:3: warning: style of line directive is a GCC extension
usr/share/motorsport/Threadable.h:11:3: warning: style of line directive is a GCC extension
usr/share/motorsport/Threadable.h:13:3: warning: style of line directive is a GCC extension
usr/share/motorsport/Threadable.h:15:3: warning: style of line directive is a GCC extension
usr/share/motorsport/Threadable.h:79:3: warning: style of line directive is a GCC extension
usr/share/motorsport/Threadable.cpp:3:3: warning: style of line directive is a GCC extension
In file included from usr/share/motorsport/Threadable.cpp:4:
usr/share/motorsport/Exception.h:31:3: warning: style of line directive is a GCC extension

Which does not look like a crash of g++ to me...
I haven't installed or modified any thing on my system, appart from the source code of my project (which is not mentioned in that g++ cmd line).
Do bash environment variables have anything to do?

Regarding the additional data, here you go:
# emerge -pv =sys-devel/gcc-4.1.2
[...]
[ebuild   R   ] sys-devel/gcc-4.1.2  USE="fortran mudflap nls (-altivec) -bootstrap -build -d -doc -gcj -gtk (-hardened) -ip28 -ip32r10k -libffi (-multilib) -multislot (-n32) (-n64) -nocxx -objc -objc++ -objc-gc -test -vanilla" 0 kB

# emerge --info
Portage 2.1.4.4 (default-linux/x86/2007.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.25-gentoo-r7 i686)
=================================================================
System uname: 2.6.25-gentoo-r7 i686 Intel(R) Core(TM)2 CPU 4300 @ 1.80GHz
Timestamp of tree: Sun, 24 Aug 2008 17:04:01 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.6
dev-lang/python:     2.4.4-r13, 2.5.2-r6
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r2
sys-devel/automake:  1.4_p6, 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
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.23-r3
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -mtune=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -mtune=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache collision-protect distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="es_ES.ISO-8859-1"
LINGUAS="en es_ES es"
MAKEOPTS="-j4"
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/portage/local/layman/sunrise /usr/portage/local/layman/lefous_portage_overlay /usr/portage/local/layman/roslin /usr/portage.3pp"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac acl acpi aften alsa bash-completion berkdb cairo cli cracklib crypt cups dbus dri dts dvd encode fam flac fortran gdbm gif gpm hal iconv ipv6 isdnlog javascript jpeg kde lame libsamplerate lm_sensors midi mikmod mmx mmxext mng mp3 mp4 mudflap musepack ncurses nls nptl nptlonly ntfs ogg opengl openmp pam pcre perl png pppd pulseaudio python qt4 readline reflection samba sensord session shout smp spl sse sse2 ssl ssse3 svg tcpd threads tiff truetype unicode usb vorbis win32codecs wmf x86 xcomposite xiph xorg xpm xprint xvid xvmc zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul 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 mouse joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en es_ES es" USERLAND="GNU" VIDEO_CARDS="nvidia vesa"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 5 Wormo (RETIRED) gentoo-dev 2008-08-28 00:03:37 UTC
Does the failure happen exactly as reported every time when you try compiling from your full build tree? Or does it crash at different points?

If it is totally repeatable from the full build, what happens when you run the command by itself using original source instead of preprocessed, still repeatable?

g++ -o usr/share/motorsport/Threadable.os -c -g -O0 -ggdb3 -Wall
-Wno-deprecated -ansi -pedantic --coverage -fprofile-arcs -ftest-coverage
-isystem usr/include/boost-1_35 -isystem usr/include/boost-1_35 -fPIC
-Iusr/include -Iusr/include/boost-1_35 -Iusr/include/boost-1_35
-Iusr/include/bullet usr/share/motorsport/Threadable.cpp