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

Bug 58969

Summary: g++: Internal error: Terminated (program cc1plus)
Product: Gentoo Linux Reporter: Justin Brown <justin>
Component: [OLD] GCC PortingAssignee: Please assign to toolchain <gcc-porting>
Status: RESOLVED DUPLICATE    
Severity: major    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Full output of emerge gnome, till the error
fluxbox compile output
gcc compile output
my world favorites file

Description Justin Brown 2004-07-30 20:53:14 UTC
When I try to emerge either gnome ot KDE I get the following error:
g++: Internal error: Terminated (program cc1plus)
Please submit a full bug report.
See <URL:http://bugs.gentoo.org/> for instructions.
make[3]: *** [ArcEngine.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
mv -f .libs/Attribute.lo Attribute.lo
make[3]: Leaving directory `/var/tmp/portage/opensp-1.5-r1/work/OpenSP-1.5/lib'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/var/tmp/portage/opensp-1.5-r1/work/OpenSP-1.5/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/opensp-1.5-r1/work/OpenSP-1.5'
make: *** [all] Error 2

!!! ERROR: app-text/opensp-1.5-r1 failed.
!!! Function src_compile, Line 44, Exitcode 2
!!! parallel make failed

It has happened on many different packages, to start with, if i restart the emerge then it compiles that package successfully and then moves on to the next, and a few packages later it happens again.

Using gKrellm, I have noticed that before the error comes the CPU usage drops down to zero, and  HDD usage increases to about 5MB/s.  Also other processes have issues, as whilst playing MP3's on another computer, using files shored of the linux box through Samba, also stopped playing for a while, and the e-mail client also stopped accepting connections, until gcc errored with the above error.  Now it is doing it for the same package and i can't get past it with it erroring

Reproducible: Always
Steps to Reproduce:
1. type: emerge gnome or emerge kde
2. error it about 4 mins after start of compiling
3.

Actual Results:  
error message:
g++: Internal error: Terminated (program cc1plus)
Please submit a full bug report.
See <URL:http://bugs.gentoo.org/> for instructions.
make[3]: *** [ArcEngine.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
mv -f .libs/Attribute.lo Attribute.lo
make[3]: Leaving directory `/var/tmp/portage/opensp-1.5-r1/work/OpenSP-1.5/lib'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/var/tmp/portage/opensp-1.5-r1/work/OpenSP-1.5/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/opensp-1.5-r1/work/OpenSP-1.5'
make: *** [all] Error 2

!!! ERROR: app-text/opensp-1.5-r1 failed.
!!! Function src_compile, Line 44, Exitcode 2
!!! parallel make failed


Expected Results:  
Compiling completed

System:
Athlon XP 1800+
512MB Ram
Nforce 2 Chipset

Kernel 2.6.6-rc3-mm1
Gcc 3.3.3-r6  (also does this if i upgrade to 2.2.4-r1)
Comment 1 Justin Brown 2004-07-30 21:24:20 UTC
Created attachment 36501 [details]
Full output of emerge gnome, till the error
Comment 2 Chris Eller 2004-09-16 08:31:59 UTC
Same problem, different system specs:

P4- 2.4 GHz
kernel = 2.6.5-gentoo-r1
gcc = 3.3.4-r1
1GB RAM
Comment 3 Jens Björnhager 2004-10-25 20:06:44 UTC
Same problem. Trying to emerge:

fluxbox
blackbox
w3m

Thought this was a memory shortage problem first, as I am pretty low on the stuff.

P166 MMX
32 MB RAM
g++ 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)
Comment 4 Jens Björnhager 2004-10-25 23:10:05 UTC
After letting go of the -pipe and -fomit-frame-pointer CFLAGS, I got w3m to compile cleanly.

Any of these that you really shoudn't use at all?
Known reasons for them not to work with g++?
Comment 5 Jens Björnhager 2004-10-26 00:43:42 UTC
using CFLAGS="-O2 -mcpu=i586 -march=i586", it still fails to compile fluxbox(.cc).
Seems like it's not a CFLAGS issue?
Comment 6 Jens Björnhager 2004-11-16 20:24:03 UTC
Created attachment 44131 [details]
fluxbox compile output
Comment 7 Jens Björnhager 2004-11-16 20:24:35 UTC
Created attachment 44132 [details]
gcc compile output
Comment 8 Jens Björnhager 2004-11-16 20:27:39 UTC
Created attachment 44134 [details]
my world favorites file

This is my world favorites file, to show ebuilds that has compiled cleanly on
the same system.
Comment 9 Adam Marthaler 2004-12-20 11:56:48 UTC
Same Problem

Emerging dev-db/mysql-4.0.22
2.6.9-gentoo-r9 #6 SMP Tue Dec 14 12:26:12 EST 2004 i586 Pentium MMX GenuineIntel GNU/Linux

48Mb Ram, 1Gb Swap
Pure Terminal, no X installed

[/code]
g++: Internal error: Terminated (program cc1plus)
Please submit a full bug report.
See <URL:http://bugs.gentoo.org/> for instructions.
make[4]: *** [sql_yacc.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory `/var/tmp/portage/mysql-4.0.22/work/mysql-4.0.22/sql'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/var/tmp/portage/mysql-4.0.22/work/mysql-4.0.22/sql'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/var/tmp/portage/mysql-4.0.22/work/mysql-4.0.22/sql'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/mysql-4.0.22/work/mysql-4.0.22'
make: *** [all] Error 2 
[/code]
Comment 10 Adam Marthaler 2004-12-21 13:42:44 UTC
Well, I fixed it.

I added an extra 64Mb of ram and it compiled.
Comment 11 Rob Snelders 2005-02-11 09:58:46 UTC
Ik het is mij gelukt door MAKEOPTS te veranderen in "-j1". Hierdoor heb ik wel fluxbox kunnen compileren
Comment 12 Martin Väth 2005-05-30 02:37:35 UTC
Maybe this problem is actually a kernel bug? In fact, I suspect a relation  
with #91615. I will explain why I think so.  
  
It is true that MAKEOPTS="-j1" or using no optimization (-O0) increases the 
chance of successful compilation, but it does not always help and is only a 
solution for some symptoms but not of the problem. Moreover, with 512 MB and 
sufficiently swap it should be possible to compile kde even with strong 
optimization, shouldn't it? More precisely, if some minimal memory for the 
kernel are satisfied, I would expect that further memory issues are only a 
question of  the available swap space (and perhaps of time). However, the 
problem seems to be independent of the available swap space (I experimented 
with adding (normal or huge) swapfiles and without swap etc).  
  
Moreover, I guess that all reporters of this bug will observe that after  
compiling sufficiently many projects containing c++ (even if successfull) the  
system will swap much more than usual and perhaps some random processes are  
killed - a typical effect when the system is short of memory; after rebooting  
the phenomenon is gone.  
Setting restrictive ulimit's does not prevent the system from killing tasks  
also of other users. So I guess the kernel is the only program which might  
have the rights to do this (however, I do not know how glibc or libstdc++ are  
embedded into the system - maybe their "memory management" also runs with root  
permissions in the background and manages the memory of several tasks? In this  
case it could be that they are the cause of the problem instead of the  
kernel).  
It is strange that the problem occurs not during the compilation of c projects  
(e.g. compiling kernel/emacs/... works perfectly) but with c++ projects (kde,  
mozilla, firefox, ...).  
  
For those of you who have some ideas and want to try: One of the most  
reproducible cases is when you compile kmail-3.4.0 - with MAKEOPTS="-j2" and  
sufficiently high optimization flags like 
  CFLAGS="-O4 -fomit-frame-pointer -funswitch-loops -funroll-all-loops 
-fpeel-loops -ftracer -pipe" 
this will almost certainly die during compilation of 
libkmailprivate_la.all_cpp.cpp (tested with gcc-3.4.3.20050110-r2 on amd64 and 
x86). 
 
Comment 13 Martin Väth 2005-05-30 03:10:07 UTC
I forgot to mention: When you want to test, be sure to rename /usr/bin/ccache 
first - if the compiler cache has already stored your files, this would 
prevent of course the problem to occur.  
Comment 14 SpanKY gentoo-dev 2005-05-30 18:21:07 UTC

*** This bug has been marked as a duplicate of 20600 ***