This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Big fortran arrays: is this behavior expected?

There is still a problem with big fortran arrays even after resetting
heap_chunk_in_mb 1024. The subsequent test program exits with no output and
no error message. When run in gdb, a segmentation fault is reported.
Following a suggestion from comp.lang.fortran, I increased the stack size
using compiler flag -Wl,--stack,0x400000. With this change I can now access
a bit over 770 Mb, above which the program fails with an erroneous message
saying that I have multiple copies of cygwin1.dll. However, this smells like
a bug, for the following reasons:

1) Crashing with no message. I've used cygwin for more than a year on
smaller systems and have not encountered any flaky behavior.

2) After increasing stack size, the test program fails at a different point,
this time with a message, but an incorrect one (it thinks I have multiple

3) Should one need a big stack just to declare one matrix and assign
values to a couple of elements?

Converting the program to C by means of f2c also leads to failure, and
increasing the stack size is not a successful fix in that case. I don't know
enough C to interpret this, beyond noting that f2c creates one large static
one-dimensional array, and fiddling with some simple test routines suggests
to me that cygwin/gcc doesn't like such large static arrays.

Although I can now successfully port all my fortran code from unix to
cygwin, the stacksize fixup seems flaky and I fear it might collapse with
the next change in either cygwin or Windows.

Apropos of recent remarks about how the simple setup routine has degraded
the user base, I confess to being one of the degraded users. For years I ran
fortran from my desktop using telnet in a DOS box, connecting to a unix
workstation. Cygwin provides a virtually identical environment. Cygwin
eliminated the workstation and Cygwin setup eliminates the system
administrator that kept the workstation running. It is heavenly to gain a
solid fortran platform without having to learn anything about either unix
administration or Windows. Thanks to all the Cygwin folks, even the mean

      implicit double precision (a-h,o-z)
c ny=300 works (240 Mb), 400 doesnt
      dimension a(nx,ny)
c dimension a1(nx,ny)
      write(6,*) 'megabytes= ',nx*ny*8/1d6
      write(6,*) 'extremes initialized'

Unsubscribe info:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]