Bug 68634 - gcc generates an internal error on preprocessing a large file
gcc generates an internal error on preprocessing a large file
Status: CLOSED UPSTREAM
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-07-11 17:21 EDT by Stuart MacDonald
Modified: 2007-04-18 12:44 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-02 18:23:56 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Stuart MacDonald 2002-07-11 17:21:26 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; T312461)

Description of problem:
gcc: Internal error: Terminated (program cpp0)
Please submit a full bug report.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.

I'm generating a really large file that contains nothing but #ifdef
#endif blocks, and piping that to gcc -E -  Eventually gcc dies.

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


How reproducible:
Always

Steps to Reproduce:
1. Create a file with the pattern:
#ifdef macro
char foo[] = "macro"        = macro;
#endif
2. Where macro is a random macro.
3. Make sure the file is at least 260 000 000 bytes big.
4. cat file | gcc -E - > results
5. gcc shuts down

Actual Results:  The error text is the first 3 lines of the Description.

Expected Results:  gcc should preprocess the whole file without shutting down, 
since the
file isn't #defining any new macros, just lots of queries about the
current state of the macro table.

Additional info:

Uh, well, the system this happens on is actually an SuSE Pro 7.2,
but the gcc error text says to report it here.

# uname -a
Linux moll 2.4.7-10 #1 Thu Sep 6 17:27:27 EDT 2001 i686 unknown
# gcc -v
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-98)
Comment 1 Richard Henderson 2004-10-02 18:23:56 EDT
If I've interpreted your problem description properly, this is the
preprocessor consuming all memory and then dying.  This still happens
with current gcc, and in fact has gotten worse after gcc 3.2.

Pushed upstream to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17798
Comment 2 Stuart MacDonald 2004-10-06 20:32:43 EDT
Yes, it looked like a memory leak in the preprocessor.

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