Bug 68634 - gcc generates an internal error on preprocessing a large file
Summary: gcc generates an internal error on preprocessing a large file
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-07-11 21:21 UTC by Stuart MacDonald
Modified: 2007-04-18 16:44 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-10-02 22:23:56 UTC
Embargoed:


Attachments (Terms of Use)

Description Stuart MacDonald 2002-07-11 21:21:26 UTC
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 22:23:56 UTC
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-07 00:32:43 UTC
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.