Red Hat Bugzilla – Bug 29556
gcc got killed during C++ compilation
Last modified: 2007-04-18 12:31:46 EDT
This bug could (is probably) related to BUG ID:29346
If you try to compile avifile (a DivX video player, http://divx.euro.ru/),
gcc will take a LONG LONG time to compile some files and will crash if you
don't have enough memory. FYI, I check (with top) the amount of memory gcc
was using during the compilation and it reached 450M!!! At the same time I
used strace on the process and gcc was doing multiple brk.
Finally the file is compiled correctly but it takes too long compared to
other c++ compiler. It could be a bug in the software (divx I mean) but I
do not think that gcc has to take 450M of memory to compile 1 file.
I've fixed in gcc-c++-2.96-76 a problem with inlining on trees where it could
eat excessive amounts of memory (found in mozilla), maybe this is the same.
Can you please pick one source file which eats a lot of memory to compile
and post here the exact command line, add -save-temps -v to it and attach here
the resulting .ii file?
I could not reproduce the bug at work. I will have to find out why it is so long
on my machine at home. It is probably an issue with the upgrade process.
I will send my findings ASAP.
Created attachment 11180 [details]
ii file from gcc
Ok, I was able to reproduce the bug at work too.
Here is my command line:
c++ -DHAVE_CONFIG_H -I. -I. -I../../include -g -O2 -march=i586
-I/usr/X11R6/include -I/usr/include/SDL -D_REENTRANT -w -I- -I. -I../../include
-Iloader -Iloader/wine -Ivideocodec -Iaudiodec -IDirectShow -save-temps -v -c
libwin32.cpp -fPIC -DPIC -o libwin32.lo
FYI, the program uses libtool. Notice the -O2.
Then, cpp preprocesses the file and after that cc1plus is launched automatically
like that with the .ii file:
/usr/lib/gcc-lib/i386-redhat-linux/2.96/cc1plus libwin32.ii -quiet -dumpbase
libwin32.cpp -march=i586 -g -O2 -w -version -fPIC -o libwin32.s
This process takes forever and eats a lot of memory... If you remove the -O2 in
the command line, it runs smoothly!
Hope this help. If you want more informations, please let me know.
PS: I attached the output of gcc
Created attachment 11181 [details]
I just installed gcc 2.96-76, same thing, doesn't work...
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-76)
I installed gcc 2.96 77.1 last week and now it works.
I am seeing this exact same problem (hanging when compiling libwin32.cpp) with
2.96-78 - if it worked in 77.1 something must have changed in 78. 78 does fix
the problem reported as bug 28385/31937 (hang compiling Mozilla), but avifile
still doesn't compile.
Actually, since 2.96-81 gcc throttles inlining.
Red Hat Linux and Red Hat Powertools are currently no longer supported by Red
Hat, Inc. In an effort to clean up bugzilla, we are closing all bugs in MODIFIED
state for these products.
However, we do want to make sure that nothing important slips through the
cracks. If, in fact, these issues are not resolved in a current Fedora Core
Release (such as Fedora Core 5), please open a new issues stating so. Thanks.