Bug 162969 - Internal error in gfortran when including many files
Internal error in gfortran when including many files
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: gcc4 (Show other bugs)
rawhide
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
: 163019 163021 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-07-11 17:51 EDT by Alexander Täschner
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version: 4.0.1-3
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-07-15 07:50:16 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 Alexander Täschner 2005-07-11 17:51:52 EDT
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 05:39:46 EDT
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 06:42:30 EDT
*** Bug 163019 has been marked as a duplicate of this bug. ***
Comment 3 Jakub Jelinek 2005-07-12 06:48:01 EDT
*** Bug 163021 has been marked as a duplicate of this bug. ***
Comment 4 Jakub Jelinek 2005-07-15 07:50:16 EDT
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.