Bug 31937 - c++ hangs (and finally crashes) compiling Mozilla with optimization
c++ hangs (and finally crashes) compiling Mozilla with optimization
Status: CLOSED DUPLICATE of bug 28385
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.0
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-03-15 21:17 EST by Need Real Name
Modified: 2007-04-18 12:32 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-03-15 21:24:06 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Preprocessed source file that hangs the compiler. (416.85 KB, text/plain)
2001-03-15 21:19 EST, Need Real Name
no flags Details
Script to compile nsStyleContext.ii and cause the hang. (227 bytes, text/plain)
2001-03-15 21:20 EST, Need Real Name
no flags Details

  None (edit)
Description Need Real Name 2001-03-15 21:17:18 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.4.2-ac11 i686)


Trying to compile Mozilla CVS with gcc-2.96-69, when it reaches
nsStyleContext.cpp in mozilla/content/base/src, c++ hangs for many minutes
and finally crashes trying to allocate a huge amount of memory.

Running "top" we can see cc1plus using a lot of CPU and slowly growing in
memory usage. The output from the make is the following:

c++ -o nsStyleContext.o -c -DOSTYPE=\"Linux2.4\" -DOJI -D_IMPL_NS_LAYOUT  
-I../../../dist/include -I../../../dist/include      -I./../../events/src
-I./../../html/base/src -I./../../html/style/src -I./../../xul/base/src
-I./../../xul/content/src  -I/usr/X11R6/include   -fPIC 
-I/usr/X11R6/include -fno-rtti -fno-exceptions -Wall -Wconversion
-Wpointer-arith -Wbad-function-cast -Wcast-align -Woverloaded-virtual
-Wsynth -pedantic -Wno-long-long -pipe -pthread -O2  -DNDEBUG -DTRIMMED
-I/usr/X11R6/include -DMOZILLA_CLIENT -include ../../../config-defs.h
-Wp,-MD,.deps/nsStyleContext.pp nsStyleContext.cpp
nsStyleContext.cpp: In method `nsresult StyleContextImpl::RemapStyle
(nsIPresContext *, int)':
nsStyleContext.cpp:3487: warning: unused variable `nsresult rv'
nsStyleContext.cpp:3573: warning: unused variable `nsresult rv'
nsStyleContext.cpp:3617: warning: unused variable `nsresult result'

Cannot allocate 1911936300 bytes after allocating 15497788 bytes
make[3]: *** [nsStyleContext.o] Error 1

If I remove the "-O2" from the build line and compile unoptimized, the file
builds correctly. This is one of two files in the Mozilla source that has
this problem (the other is
mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp) although I have
seen a similar problem in the past building avifile.


Reproducible: Always
Steps to Reproduce:
Take the included nsStyleContext.ii file and compile it with the command
line in the "compile" file.

Actual Results:  c++ will hang and eventually crash for lack of memory.	

Expected Results:  The file should compile and produce a usable
nsStyleContext.o file.
Comment 1 Need Real Name 2001-03-15 21:19:07 EST
Created attachment 12782 [details]
Preprocessed source file that hangs the compiler.
Comment 2 Need Real Name 2001-03-15 21:20:19 EST
Created attachment 12783 [details]
Script to compile nsStyleContext.ii and cause the hang.
Comment 3 Need Real Name 2001-03-15 21:24:02 EST
I forgot to note - I attached to cc1plus with gdb and got a stack trace of where
it was - the stack trace was

#0  0x80af8ca in error ()
#1  0x80685d5 in error ()
... (144 more occurrences of error() with different addresses)
#146 0x804c116 in error ()
#147 0x804fd85 in error ()
#148 0x4003ef31 in __libc_start_main (main=0x804f730 <error+19008>, argc=21, 
    ubp_av=0xbffff61c, init=0x80491d8, fini=0x82b1f3c <textdomain+10524>, 
    rtld_fini=0x4000e274 <_dl_fini>, stack_end=0xbffff614)
    at ../sysdeps/generic/libc-start.c:129
Comment 4 Jakub Jelinek 2001-03-16 05:36:34 EST

*** This bug has been marked as a duplicate of 28385 ***
Comment 5 Need Real Name 2001-03-16 21:28:14 EST
I have confirmed that this is fixed in the 2.96-78 from rawhide.

Note You need to log in before you can comment on or make changes to this bug.