Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Fri, 16 Jul 2004 10:36:23 +0200
From: "Gerrit P. Haase" <gerrit@familiehaase.de>
Reply-To: "Gerrit P. Haase" <gerrit@familiehaase.de>
Organization: Esse keine toten Tiere
Message-ID: <96255937158.20040716103623@familiehaase.de>
To: Pietro Brandani <pbrandani@ucdavis.edu>
CC: cygwin@cygwin.com
Subject: Re: gcc 3.3.1-3 runtime error: static data storage size
In-Reply-To: <Pine.GSO.4.58.0407151639540.29941@vici.ucdavis.edu>
References: <6.0.1.1.2.20040715140233.01af80b0@yellow.ucdavis.edu> <198222099492.20040716011226@familiehaase.de> <Pine.GSO.4.58.0407151639540.29941@vici.ucdavis.edu>
MIME-Version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7bit
X-IsSubscribed: yes

Pietro schrieb:

> Gerrit,

> I think you just did:

> the program should print "ok" upon executing and it didn't. if you debug,
> say, with insight, aa.exe will bail before reaching the printf statement,
> generating a segmentation violation signal.

> let me know. thanks for looking into it.

> Pietro

> On Fri, 16 Jul 2004, Gerrit P. Haase wrote:

>> Pietro wrote:
>>
>> > I have the following example to propose:
>> > /** aa.c **/
>> > #define NXY 5000
>> > #define NXY 7000
>> > int xy[NXY][NXY];
>> > main(){
>> > printf("ok\n");
>> > }
>>
>> > This will work when NXY=5000, but will generate a SIGSEV exception before
>> > reaching the first statement when NXY=7000.
>>
>> > The array in the faulty case is 187MB. The gcc documentation gives 2GB as
>> > the limit for having to switch to dynamic allocation. Any fixes? or
>> > relevant compiler options possibly available?
>>
>> I cannot reproduce it on my W2K Professional box:
>>
>>
>> $ cat aa.c
>> #define NXY 7000
>>
>> int xy[NXY][NXY];
>> main(){
>> printf("ok\n");
>> }
>>
>> $ gcc -o aa aa.c
>>
>> $ ./aa.exe
>>
>> Gerrit
>> --
>> =^..^=                                     http://nyckelpiga.de/donate.html
>>

Yes, I see.  Yhe problem is the default stack size on cygwin (2 MB), you
can increase it.

$ gcc -o aa -Wl,--stack,8388608 aa.c

$ ./aa
ok

$ cat aa.c
#define NXY 7000

int xy[NXY][NXY];
main(){
printf("ok\n");
}


Gerrit
-- 
=^..^=


--
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/

