Bug 106542 - fortran programs cannot use arrays > 2 GB
fortran programs cannot use arrays > 2 GB
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gcc (Show other bugs)
3.0
ia64 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-10-08 03:07 EDT by Winfrid Tschiedel
Modified: 2007-11-30 17:06 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-01-16 12:25:02 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)

  None (edit)
Description Winfrid Tschiedel 2003-10-08 03:07:56 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.8 [en] (Windows NT 5.0; U)

Description of problem:
The following program allocates an array larger 2 GB :

      program test
      parameter ( n3=257)
      common /abc/ a,b
      real*8 a(1024,1024,n3),b(1024,1024,255)
      b(1,100,3)=1.0d0
      a(1,100,3)=1.0d0
      a(1024,1024,n3)=2.d0
      b(1024,1024,255)=3.0
      print *,a(1,100,3),b(1,100,3)
      print *,a(1024,1024,n3),b(1024,1024,255)
      end

[root@CD-IA64-rhel root]# g77 -O3 /tmp/big-mem.f
[root@CD-IA64-rhel root]# time ./a.out
Segmentation fault

real    0m0.002s
user    0m0.001s
sys     0m0.001s

If you use Intel fortran this error does not occur.



Version-Release number of selected component (if applicable):
gcc-g77-3.2.3-16

How reproducible:
Always

Steps to Reproduce:
1. Copy the source to file
2. compile : g77 bigmem.f
3. execute : ./a.out 
    
    

Actual Results:  [root@CD-IA64-rhel root]# g77 -O3 /tmp/big-mem.f
[root@CD-IA64-rhel root]# time ./a.out
Segmentation fault

real    0m0.002s
user    0m0.001s
sys     0m0.001s

Expected Results:  Result with efc from Intel :

[root@CD-IA64-rhel ~]# efc  -O3 /tmp/big-mem.f
   program TEST

      real*8 a(1024,1024,n3),b(1024,1024,255)
           ^
Warning 2 at (4:/tmp/big-mem.f) : Type size specifiers are an extension to stand
ard Fortran 95

11 Lines Compiled
/opt/intel/compiler70/ia64/lib/libIEPCF90.a(f90fioerr.o)(.text+0x9c0): In functi
on `f_f77ioerr':
: undefined reference to `__ctype_b'
[root@CD-IA64-rhel ~]# efc  -O3 /tmp/big-mem.f -i_dynamic
   program TEST

      real*8 a(1024,1024,n3),b(1024,1024,255)
           ^
Warning 2 at (4:/tmp/big-mem.f) : Type size specifiers are an extension to stand
ard Fortran 95

11 Lines Compiled
[root@CD-IA64-rhel ~]# ./a.out
   1.00000000000000        1.00000000000000
   2.00000000000000        3.00000000000000

Additional info:

This error occurs also with previous versions of 
g77 ( e.g. 2.96 ) or most recent versions from gcc.org ( e.g. 3.4 )

And this error occurs also on x86_64.
Comment 1 Jakub Jelinek 2003-10-30 08:17:30 EST
Try ftp://people.redhat.com/jakub/gcc/3.2.3-23/
It should fix this bug and a bunch of others (mostly related to handling
stack frames within one function bigger than 2GB on various 64-bit arches).
Comment 2 David Lawrence 2004-01-16 12:25:02 EST
An errata has been issued which should help the problem described in this bug report. 
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen 
this bug report if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2003-354.html

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