g++ segfaults when compiling a specific file. The segfault goes away when the dependency-generation flags of gcc are turned off. For the specific preprocessed code, see the attachment. Apologies for the length, but if I remove more headers, the crash goes away. The crash seems to be very sensitive to context. If I change much, it goes away. Reproducible: Always Steps to Reproduce: 1. g++ -I. -DQT_THREAD_SUPPORT -I/usr/qt/3/include -O0 -g -Wall -MT foobar.o -MD -MP -MF -c -o foobar.o foobar.cc Actual Results: time_widget.cc: In constructor `Session::TimeWidget::TimeWidget(QWidget*, const char*)': time_widget.cc:96: 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/cciKFSjF.out file, please attach this to your bugreport. Expected Results: Compiled the file.
Created attachment 66471 [details] Preprocessed source file which causes the crash.
Output of gcc -v: g++ -v -I. -DQT_THREAD_SUPPORT -I/usr/qt/3/include -O0 -g -Wall -MT foobar.o -MD -MP -MF -c -o foobar.o foobar.cc Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/specs Configured with: /var/tmp/portage/gcc-3.3.5.20050130-r1/work/gcc-3.3.5/configure --enable-version-specific-runtime-libs --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.3.5-20050130 --includedir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.5-20050130 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.5-20050130/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.5-20050130/info --with-gxx-include-dir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/include/g++-v3 --host=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --disable-multilib --disable-libgcj --enable-languages=c,c++,f77 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu Thread model: posix gcc version 3.3.5-20050130 (Gentoo 3.3.5.20050130-r1, ssp-3.3.5.20050130-1, pie-8.7.7.1) /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/cc1plus -quiet -v -I. -I/usr/qt/3/include -MD foobar.d -MF -c -MP -MT foobar.o -MQ foobar.o -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=5 -D_GNU_SOURCE -DQT_THREAD_SUPPORT foobar.cc -D__GNUG__=3 -quiet -dumpbase foobar.cc -auxbase foobar -g -O0 -Wall -version -o /tmp/ccmsW1EW.s GNU C++ version 3.3.5-20050130 (Gentoo 3.3.5.20050130-r1, ssp-3.3.5.20050130-1, pie-8.7.7.1) (i686-pc-linux-gnu) compiled by GNU C version 3.3.5-20050130 (Gentoo 3.3.5.20050130-r1, ssp-3.3.5.20050130-1, pie-8.7.7.1). GGC heuristics: --param ggc-min-expand=63 --param ggc-min-heapsize=63325 ignoring nonexistent directory "/usr/i686-pc-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: . /usr/qt/3/include /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/include/g++-v3 /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/include/g++-v3/i686-pc-linux-gnu /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/include/g++-v3/backward /usr/local/include /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/include /usr/include End of search list. time_widget.cc: In constructor `Session::TimeWidget::TimeWidget(QWidget*, const char*)': time_widget.cc:96: 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/ccocLAOt.out file, please attach this to your bugreport.
This seems to indicate you have a local problem with your machine. Perhaps you're running out of RAM or the CPU is overheating.
>This seems to indicate you have a local problem with your machine. Perhaps >you're running out of RAM or >the CPU is overheating. I doubt the cause is hardware for a number of reasons. It's reproducable on 2 different machines. There are stock Dell P4 workstations. One has 512MB of RAM, the other has 1GB. They aren't overclocked, and show no general stability problems. getrusage() polling shows minimal (<100MB) memory usage throughout the run. I've not been able to check on a non-P4 machine. It could be a meta-gcc bug, as make.conf for these boxen uses -march=pentium4; perhaps gcc itself has been miscompiled. Note that the bug is absolutely dependent on all the compiler switches given.
Very strange indeed!
This should be fine with gcc-3.4.4.