Bug 106542 - fortran programs cannot use arrays > 2 GB
Summary: fortran programs cannot use arrays > 2 GB
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gcc
Version: 3.0
Hardware: ia64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-10-08 07:07 UTC by Winfrid Tschiedel
Modified: 2007-11-30 22:06 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-01-16 17:25:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2003:354 0 normal SHIPPED_LIVE Updated gcc packages fix multiple bugs 2003-11-17 05:00:00 UTC

Description Winfrid Tschiedel 2003-10-08 07:07:56 UTC
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 13:17:30 UTC
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 17:25:02 UTC
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.