delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/07/16/11:08:34

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 16 Jul 2004 17:08:22 +0200
From: "Gerrit P. Haase" <freeweb AT nyckelpiga DOT de>
Reply-To: "Gerrit P. Haase" <freeweb AT nyckelpiga DOT de>
Organization: Esse keine toten Tiere
Message-ID: <70279455896.20040716170822@familiehaase.de>
To: cygwin AT cygwin DOT com
Subject: Re: gcc 3.3.1-3 runtime error: static data storage size
In-Reply-To: <20040716141546.GC20693@trixie.casa.cgf.cx>
References: <6 DOT 0 DOT 1 DOT 1 DOT 2 DOT 20040715140233 DOT 01af80b0 AT yellow DOT ucdavis DOT edu> <198222099492 DOT 20040716011226 AT familiehaase DOT de> <Pine DOT GSO DOT 4 DOT 58 DOT 0407151639540 DOT 29941 AT vici DOT ucdavis DOT edu> <96255937158 DOT 20040716103623 AT familiehaase DOT de> <20040716141546 DOT GC20693 AT trixie DOT casa DOT cgf DOT cx>
MIME-Version: 1.0

Christopher wrote:

> On Fri, Jul 16, 2004 at 10:36:23AM +0200, Gerrit P. Haase wrote:
>>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");
>>}

> Why would the stack size affect a global variable?

I don't know.  In this case it seems to work when I define the stack
with 8MB and it doesn't work when I use the default stack settings.


Gerrit
-- 
=^..^=                                     http://nyckelpiga.de/donate.html


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019