Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 162969 - Internal error in gfortran when including many files
Summary: Internal error in gfortran when including many files
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc4
Version: rawhide
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
: 163019 163021 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-07-11 21:51 UTC by Alexander Täschner
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version: 4.0.1-3
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-07-15 11:50:16 UTC


Attachments (Terms of Use)

Description Alexander Täschner 2005-07-11 21:51:52 UTC
When compiling a file which includes a "chain" of include files
an internal error occurs, if the length of the file names
of all included files excess a certain limit.
This error didn't occure in version 4.0.0-13, but in 4.0.1-2.

The following artificial testcase shows the error:

--- start of file "test.F" ---
#include "A234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890"
      END
--- EOF ---

--- start of 
file "A2345678901234567890123456789012345678901234567890123456789012345678901234
56789012345678901234567890123456789012345678901234567890123456789012345678901234
56789012345678901234567890123456789012345678901234567890123456789012345678901234
5678901234567890" ---
#include "B234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890"
--- EOF ---

--- start of 
file "B2345678901234567890123456789012345678901234567890123456789012345678901234
56789012345678901234567890123456789012345678901234567890123456789012345678901234
56789012345678901234567890123456789012345678901234567890123456789012345678901234
5678901234567890" ---
#include "C234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890"
--- EOF ---

--- start of 
file "C2345678901234567890123456789012345678901234567890123456789012345678901234
56789012345678901234567890123456789012345678901234567890123456789012345678901234
56789012345678901234567890123456789012345678901234567890123456789012345678901234
5678901234567890" ---
#include "D234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890"
--- EOF ---

--- start of 
file "D2345678901234567890123456789012345678901234567890123456789012345678901234
56789012345678901234567890123456789012345678901234567890123456789012345678901234
56789012345678901234567890123456789012345678901234567890123456789012345678901234
5678901234567890" ---
      PARAMETER (I=1)
--- EOF ---

Compiling this with
--- start of 
file "C2345678901234567890123456789012345678901234567890123456789012345678901234
56789012345678901234567890123456789012345678901234567890123456789012345678901234
56789012345678901234567890123456789012345678901234567890123456789012345678901234
5678901234567890" ---
#include "D234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890"
--- EOF ---

Compiling this with "gfortran -c test.F" leads to the following error:
Warning: 
D2345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890:2: file 
C2345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890 left but not entered
Warning: 
D2345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890:2: file 
B2345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890 left but not entered
Warning: 
D2345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890:3: file 
A2345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890 left but not entered
Warning: 
D2345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890:3: file test.F left but not entered
 In file 
D2345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890:1

     Included at 
C2345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890:2

     Included at 
B2345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890:2

     Included at 
A2345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
1234567890:2

     Included at test.F:2

      PARAMETER (I=1)
                 1
 Internal Error at (1):
 error_char(): Error buffer overflow

Comment 1 Jakub Jelinek 2005-07-12 09:39:46 UTC
I see the error_char(): Error buffer overflow bug with all gfortran versions
I have tried.  The bogus file.*left but not entered warning is PR fortran/22417.
Fix for that is http://gcc.gnu.org/ml/gcc-patches/2005-07/msg00820.html
and for the buffer overflow
http://gcc.gnu.org/ml/gcc-patches/2005-07/msg00821.html

Comment 2 Jakub Jelinek 2005-07-12 10:42:30 UTC
*** Bug 163019 has been marked as a duplicate of this bug. ***

Comment 3 Jakub Jelinek 2005-07-12 10:48:01 UTC
*** Bug 163021 has been marked as a duplicate of this bug. ***

Comment 4 Jakub Jelinek 2005-07-15 11:50:16 UTC
This should be fixed in gcc 4.0.1-3 in rawhide.


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