Bug 518731

Summary: gcc Internal error Killed cc1 - while compiling sage 4.1.1
Product: [Fedora] Fedora Reporter: Nivag <gavinflower>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: low    
Version: 11CC: gavinflower, jakub, neumann
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-22 08:41:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
screen shot of top showing memory usage, CPU load, and elapsed time
none
sage-4.1.1/spkg/build/pari-2.3.3.p1/src/src/language/init.c
none
Assembly of "my" view to this problem (maybe another bug) none

Description Nivag 2009-08-21 22:29:57 UTC
Created attachment 358288 [details]
screen shot of top showing memory usage, CPU load, and elapsed time

Description of problem:
I downloaded the source for sage 4.4.1 from
http://www.sagemath.org
expanded the source and ran make after setting export MAKE="make -j4"

Version-Release number of selected component (if applicable):
4.4.1

How reproducible:
1st attempt: failed as documented below
2nd attempt: it worked! (simply reissuing the make command)
3rd attempt: abandoned after resident set size got to 6.5G (complete resrart)
4th attempt: abandoned after resident set size got to 3.5G (reissued make)
5th attempt: abandoned after resident set size got to 4.1G (reissued make)
6th attempt: abandoned after resident set size got to 3.4G (reissued make)

Steps to Reproduce:
1. tar -xvf sage-4.1.1.tar
2. cd sage-4.1.1
2. export MAKE="make -j4"
3. make
  
Actual results:
gcc  -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer    -I. -I../src/headers -fPIC -o init.o ../src/language/init.c
gcc: Internal error: Killed (program cc1)


Expected results:
Should have successfully compiled

Additional info:

cpuspeed stopped to enable cores to run at 2.5GHz

up to date Fedora 11 install
AMD 810 quad core 64 bit
8 GB DDR3 RAM
5 * 500GB in software RAID-6 configuration
ASUS M4A78T-E motherboard  

Linux saturn 2.6.29.6-217.2.8.fc11.x86_64 #1 SMP Sat Aug 15 01:06:26 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

Comment 1 Nivag 2009-08-21 22:32:26 UTC
Note that both gcc _AND_ sage have the version number of '4.4.1'!

Comment 2 Nivag 2009-08-21 22:43:30 UTC
Created attachment 358290 [details]
sage-4.1.1/spkg/build/pari-2.3.3.p1/src/src/language/init.c

$ wc /home/gavin/AAA/updates/sage/sage-4.1.1/spkg/build/pari-2.3.3.p1/src/src/language/init.c
 2078  6920 52634 /home/gavin/AAA/updates/sage/sage-4.1.1/spkg/build/pari-2.3.3.p1/src/src/language/init.c
$ 


This is the file that cc! chokes on.

Comment 3 Jakub Jelinek 2009-09-02 11:13:45 UTC
You need to provide preprocessed source for it, otherwise it can't be reproduced without all the included headers.

Comment 4 Nivag 2009-09-02 13:32:24 UTC
How do I provide preprocessed source?


All the included headers are part of the source tar I downloaded.

Comment 5 Jakub Jelinek 2009-09-02 13:47:55 UTC
See http://gcc.gnu.org/bugs.html for details, or just use -E instead of -c on the command line, or add -save-temps to the command line.

Comment 6 Nivag 2009-09-03 00:04:16 UTC
I can't simply add a flag to the command line, as there are some very complicated scripts which generate makefiles on the fly.

I've spent over 2 hours trying to figure out a way to get the file you need without success.

Comment 7 Thomas Spura 2009-09-03 01:20:17 UTC
Created attachment 359611 [details]
Assembly of "my" view to this problem (maybe another bug)

If the build aborts, you could go to the directory spkg/build/pari-2.3.3.p1/src/Olinux-x86_64 and run your command from above:
gcc  -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer    -I.
-I../src/headers -fPIC -o init.o ../src/language/init.c


I just wanted to try so, but this file builds fine here.
gcc  -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer    -I. -I../src/headers -fPIC -o base3.o ../src/basemath/base3.c

results in an infinite loop. With -E instead of -c nothing happens.

Even there is a infinite loop, the base3.o is created.

The only thing I can supply is the .s file...

Comment 8 Nivag 2009-09-03 01:42:37 UTC
From man gcc...

 -E  Stop after the preprocessing stage; do not run the compiler proper.  The output is in the form of preprocessed source code, which is sent to the standard output.

I'll have another go tomorrow based on the suggestion of Comment #7, but using -save-temps on the command line as per Comment #5.

Comment 9 Jakub Jelinek 2009-09-03 06:20:59 UTC
You just copy the command line and paste it into shell and add -save-temps in the right directory, no need to use the makefiles.

Comment 10 Nivag 2009-09-03 10:46:42 UTC
cd ../src/desc && /usr/bin/perl gen_proto basic pari.desc > init-linux-x86_64-6448.tmp
gcc  -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer    -I. -I../src/headers -I../src/graph -o gp_init.o ../src/gp/gp_init.c
gcc  -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer    -I. -I../src/headers -DDL_DFLT_NAME=NULL -o highlvl.o ../src/gp/highlvl.c
mv ../src/desc/init-linux-x86_64-6448.tmp ../src/language/init.h
gcc  -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer    -I. -I../src/headers -fPIC -o anal.o ../src/language/anal.c
gcc  -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer    -I. -I../src/headers -fPIC -o init.o ../src/language/init.c
^Cmake: *** [all] Error 130

$ gcc  -E -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer    -I. -I../src/headers -fPIC -o init.o ../src/language/init.c
gcc: ../src/language/init.c: No such file or directory
gcc: no input files
$ pwd
/home/gavin/AAA/updates/sage/sage-4.1.1

[...
    some mucking about trying to ascertain the correct directory to run gcc in
...]

$ ll ../src/language/init.c
-rw-r--r-- 1 gavin gavin 52634 2007-12-27 18:36 ../src/language/init.c
$ pwd
/home/gavin/AAA/updates/sage/sage-4.1.1/spkg/build/pari-2.3.3.p1/src/src
$ gcc  -E -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer    -I. -I../src/headers -fPIC -o init.o ../src/language/init.c
In file included from ../src/language/init.c:22:
../src/headers/pari.h:18:21: error: paricfg.h: No such file or directory
../src/headers/pari.h:76:21: error: pariinl.h: No such file or directory
$

Comment 11 Jakub Jelinek 2009-09-09 13:36:31 UTC
That means you are in a wrong directory.  Try the one which contains paricfg.h and pariinl.h, assuming ../src/language/init.c still exist.
Or, do:
mkdir ~/wrapper
echo '#!/bin/sh' > ~/wrapper/gcc
echo 'exec /usr/bin/gcc -save-temps "$@"' >> ~/wrapper/gcc
chmod 755 ~/wrapper/gcc
and build sage with
PATH=~/wrapper/gcc:$PATH make
and then just look for init.i in the sage tree.

Comment 12 Nivag 2009-09-09 21:33:26 UTC
I have applied all the updates offerred, including:

Linux saturn 2.6.30.5-43.fc11.x86_64 #1 SMP Thu Aug 27 21:39:52 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

glibc.x86_64 0:2.10.1-5 etc.

I then deleted the sage 4.1.1 directory and restarted.  The sage compile failed in the same place wity the same symptoms.

I ran the wrapper code as per the above comment.

N.B. I ran an updatedb in another terminal, after I had aborted the compile, but before I used locate init.i.  However, I did not find the init.i for sage.

I will leave the /home/gavin/AAA/updates/sage/sage-4.1.1 directory structure as is, and await further instructions...


[...]
make[1]: *** [installed/pari-2.3.3.p1] Error 1
make[1]: Leaving directory `/home/gavin/AAA/updates/sage/sage-4.1.1/spkg'

real	9m53.807s
user	11m2.338s
sys	2m8.698s
Error building Sage.

real	9m54.318s
user	11m2.581s
sys	2m9.439s
$ mkdir ~/wrapper
$ echo '#!/bin/sh' > ~/wrapper/gcc
$ echo 'exec /usr/bin/gcc -save-temps "$@"' >> ~/wrapper/gc
$ chmod 755 ~/wrapper/gcc
$ ll ~/wrapper/gc
-rw-rw-r-- 1 gavin gavin 35 2009-09-10 09:13 /home/gavin/wrapper/gc
$ PATH=~/wrapper/gcc:$PATH make
cd spkg && ./install all 2>&1 | tee -a ../install.log
make[1]: Entering directory `/home/gavin/AAA/updates/sage/sage-4.1.1/spkg'
sage-spkg pari-2.3.3.p1 2>&1
You must set the SAGE_ROOT environment variable or
run this script from the SAGE_ROOT or 
SAGE_ROOT/local/bin/ directory.
pari-2.3.3.p1
Machine:
Linux saturn 2.6.30.5-43.fc11.x86_64 #1 SMP Thu Aug 27 21:39:52 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
Deleting directories from past builds of previous/current versions of pari-2.3.3.p1
Extracting package /home/gavin/AAA/updates/sage/sage-4.1.1/spkg/standard/pari-2.3.3.p1.spkg ...
-rw-r--r-- 1 gavin gavin 1868037 2009-08-01 09:45 /home/gavin/AAA/updates/sage/sage-4.1.1/spkg/standard/pari-2.3.3.p1.spkg
pari-2.3.3.p1/
[...]
cd ../src/desc && /usr/bin/perl gen_proto basic pari.desc > init-linux-x86_64-1891.tmp
mv ../src/desc/members-linux-x86_64-1891.tmp ../src/language/members.h
mv ../src/desc/init-linux-x86_64-1891.tmp ../src/language/init.h
gcc  -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer    -I. -I../src/headers -I../src/graph -o gp_init.o ../src/gp/gp_init.c
gcc  -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer    -I. -I../src/headers -DDL_DFLT_NAME=NULL -o highlvl.o ../src/gp/highlvl.c
gcc  -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer    -I. -I../src/headers -fPIC -o anal.o ../src/language/anal.c
gcc  -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer    -I. -I../src/headers -fPIC -o init.o ../src/language/init.c
gcc: Internal error: Terminated (program cc1)
Please submit a full bug report.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
make[3]: *** [base3.o] Error 1
make[3]: Leaving directory `/home/gavin/AAA/updates/sage/sage-4.1.1/spkg/build/pari-2.3.3.p1/src/Olinux-x86_64'
make[2]: *** [gp] Error 2
make[2]: Leaving directory `/home/gavin/AAA/updates/sage/sage-4.1.1/spkg/build/pari-2.3.3.p1/src'
Error building GP

real	6m20.110s
user	7m29.360s
sys	0m5.283s
sage: An error occurred while installing pari-2.3.3.p1
Please email sage-devel http://groups.google.com/group/sage-devel
explaining the problem and send the relevant part of
of /home/gavin/AAA/updates/sage/sage-4.1.1/install.log.  Describe your computer, operating system, etc.
If you want to try to fix the problem, yourself *don't* just cd to
/home/gavin/AAA/updates/sage/sage-4.1.1/spkg/build/pari-2.3.3.p1 and type 'make'.
Instead type "/home/gavin/AAA/updates/sage/sage-4.1.1/sage -sh"
in order to set all environment variables correctly, then cd to
/home/gavin/AAA/updates/sage/sage-4.1.1/spkg/build/pari-2.3.3.p1
(When you are done debugging, you can type "exit" to leave the
subshell.)
make[1]: *** [installed/pari-2.3.3.p1] Error 1
make[1]: Leaving directory `/home/gavin/AAA/updates/sage/sage-4.1.1/spkg'

real	6m20.908s
user	7m30.077s
sys	0m5.400s
Error building Sage.
$ locate init.i
/etc/sysconfig/network-scripts/init.ipv6-global
/usr/include/wine/windows/dbinit.idl
/usr/share/selinux/devel/include/system/init.if
/usr/share/xemacs-21.5-b29/etc/gdbinit.in
$

Comment 13 Jakub Jelinek 2009-09-09 21:52:45 UTC
You've used ~/wrapper/gc instead of ~/wrapper/gcc, note the missing c at the end.
Also, the PATH should be
PATH=~/wrapper/:$PATH make
(not ~/wrapper/gcc, that's my pasto, but it ought to be rather obvious).

Comment 14 Nivag 2009-09-09 23:52:12 UTC
I ran an updatedb in another terminal, after I had aborted the compile,
but before I used locate init.i.  However, I did not find the init.i for sage.


$ pwd
/home/gavin/wrapper
$ ll
total 4
-rwxr-xr-x 1 gavin gavin 46 2009-09-10 11:16 gcc*
$ cat gcc
#!/bin/sh
exec /usr/bin/gcc -save-temps "$@"

$ cd /home/gavin/AAA/updates/sage/sage-4.1.1/spkg/build/pari-2.3.3.p1/src/Olinux-x86_64
$ PATH=~/wrapper/:$PATH make
File ../src/funclist not changed.
gcc  -c -O3 -Wall -fno-strict-aliasing -fomit-frame-pointer    -I. -I../src/headers -fPIC -o base3.o ../src/basemath/base3.c
gcc: Internal error: Terminated (program cc1)
Please submit a full bug report.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
make: *** [base3.o] Error 1
$ locate init.i
/etc/sysconfig/network-scripts/init.ipv6-global
/usr/include/wine/windows/dbinit.idl
/usr/share/selinux/devel/include/system/init.if
/usr/share/xemacs-21.5-b29/etc/gdbinit.in
$

Comment 15 Nivag 2009-09-10 00:02:34 UTC
Just in case there was something funny with the configuration of updatedb, I tried find...

$ cd /home/gavin/AAA/updates/sage/sage-4.1.1
$ find . -name 'init.i'
$ find . -name 'init.c'
./spkg/build/pari-2.3.3.p1/src/src/language/init.c
$

Comment 16 Nivag 2009-09-10 00:37:59 UTC
Correcting silly typo in heading: had sage 4.4.1 instead of 4.1.1.

Comment 17 Walter Neumann 2009-09-13 12:55:49 UTC
Same bug was reported in Debian and is fixed in Debian gcc 4.4.1-4
See http://bugs.debian.org/541816

Comment 18 Jakub Jelinek 2009-09-22 08:41:02 UTC
PR41101 is now fixed in gcc-4.4.1-15.