From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,1c446b263fd4137b,start X-Google-Attributes: gid1164f8,public From: toon@moene.indiv.nluug.nl (Toon Moene) Subject: Stack allocation hosed in Digital Unix 3.2C ? Date: 1996/02/02 Message-ID: <1057@moene.indiv.nluug.nl>#1/1 X-Deja-AN: 137791191 sender: toon@moene.indiv.nluug.nl organization: Moene Computational Physics, Maartensdijk, The Netherlands newsgroups: comp.sys.dec Hi All, I hope that someone recognises the symptoms I'll describe in a moment and is able to point me to a solution. I _was_ the happy user of an Alphaserver (don't know the exact model number - it has 2 190 Mhz Alpha 21064's, 192 Mb of memory and several gig's of disk space) and was running Digital Unix 3.2. Then, on a black Tuesday, system management decided to upgrade to 3.2C and - lo and behold - several of my program binaries, which had been running unattented for weeks (one to three hours at a stretch), stopped working with a Segmentation fault. The problem was easily reproduced by the following simple program: program bug real a(4000000) do i = 1, 4000000 a(i) = 0.0 enddo print*,(a(i), i=1,4000000,100000) end when compiled with f77 -automatic, or the equivalent C program: main() { int i; float a[4000000]; for (i=0; i<4000000; i++) a[i] = 0.0; printf("%f\n", a[1000000]); } (The print statements are only there to prevent all code to be optimised away - they're never reached). The Fortran program can be made running by omitting the '-automatic' switch, the C program by adding 'static' to the declaration of the array. And yes, the 'limit' command shows I am allowed to use up to 40 Mb of stack space. Any takers ? TIA. [ Local DEC support couldn't come up with an answer too, yet ] -- Toon Moene (toon@moene.indiv.nluug.nl) Saturnushof 14, 3738 XG Maartensdijk, The Netherlands Phone: +31 346 214290; Fax: +31 346 214286 URL: http://www.knmi.nl/hirlam