This is the mail archive of the
cygwin
mailing list for the Cygwin project.
RE: g77 executable with largish array fails (solved?)
- From: "Dave Korn" <dk at artimi dot com>
- To: <cygwin at cygwin dot com>
- Date: Tue, 26 Oct 2004 14:14:42 +0100
- Subject: RE: g77 executable with largish array fails (solved?)
> -----Original Message-----
> From: cygwin-owner On Behalf Of Gerrit P. Haase
> Sent: 26 October 2004 08:37
> Billinghurst, David (CALCRTS) wrote:
>
> >>From: David Billinghurst
> >>
> >>The following test case is distilled from the LAPACK timing
> test cases.
> >>These used to work on some previous versions of cygwin/g77,
> but now fail.
> >
> >
> > I translated the problem into C using f2c. It becomes:
> >
> > $ cat labugc.c
> > int main() {
> > static float a[39*1024*1024];
> > }
> >
> > $ gcc -O0 -o labugc.exe labugc.c
> > $ ./labugc
> > C:\cygwin\usr\people\billingd\labugc.exe (3372): ***
> MapViewOfFileEx(0x728, in_h 0x728) failed, Win32 error 6
> >
> >
> > Aha, I says. Looks like stack overflow. Google pointed me
> to an work around
> > gcc -Wl,--stack,200000000 -O0 -o labugc.exe labugc.c
> >
> > David
>
> Interesting, it works without special flags when using gcc-3.4.1.
>
> Gerrit
I can explain that: here's why a static variable might cause a MapViewOfFileEx,
and also why changing the stack size might fix it:
http://www.cygwin.com/ml/cygwin/2004-07/msg00646.html
and so I reckon the difference between 3.3.3 and 3.4.1 in this regard will be
cause by the change in placement of statically zero initialised data. Gerrit,
does adding -fzero-initialized-in-bss or -fno-zero-initialized-in-bss to the
compile flags cause the problem to return for 3.4.1, and then adding the
-Wl,--stack option fix it again?
cheers,
DaveK
--
Can't think of a witty .sigline today....
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/