delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/09/13/19:06:32

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:from:date
:message-id:subject:to:content-type; q=dns; s=default; b=IBIFnPc
KXVmzSx53QXhEOi14DKgAVlkoxzw/F/+XQsx9HshzzFx2yOHEQuVZsvb7NFuiymW
GCTi9ndOlHDbAzv+YQDcaGMOgmCqGcAD6UbDRNriT/uCEc72NhacKdLlHfHLHY3I
RNPknFjOaZZ9Hzy5di7zFvksBFffo1KCKrrI=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:from:date
:message-id:subject:to:content-type; s=default; bh=Ktf2aTv6kEK0L
SskPviFATKxoHo=; b=eODv9xciYBdGpQZChTfxnuNkWMHoimZH68iWseTGaQ9xv
CaP+PpbdUsUFobmSdZmcqR14uaBtnqmwTfFPUYsTugoLzwqBNb7knmvoZA2uNo2Y
zVPWR8TawyRqJRpMfZp5/97ADbh4N6NP+jMwLdRYEiSilOMAWHHkUR8yV+Lhjw=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
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
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.1 spammy=Lee, HX-Languages-Length:1603, H*r:4985, talk
X-HELO: mail-qk1-f178.google.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=h7/ihB62CVspHSPZdq6fxXSI5aQqW4empDSkcBy+MGg=; b=ija7h3Nhb/jbqy/UgKFfgayiiPrntXhECfIJu3yXsoCGbYWC7WFIphzygpvtFLIPF/ wCq6ghg+7sdsyZ9jnW3mVCxkl1QEze+XHv+xGMkO2rDn4avHACYSGF/9NRZ2JRGR2JSf /CxowF7RG2AB5yCLQHG+vlPDtBZR1uXHpxTT/Q/0oE3OKoKK83G1pLgkTh4pRWN3C2JE T1QmzxPW5gu2aIJA99s5IfubLyJclGysOoHtNdYVnS8E37M34tbqphCEMq0haSW+SGAn mtKesaEMX72Z1b9Xufqm/HP8GX1CF79Mc/IiZHJd0qUEZExowC151C2hIiGMA7xmlwvz 9Obw==
MIME-Version: 1.0
In-Reply-To: <VI1PR01MB44132EB2432CCD4CE1892304DEB30@VI1PR01MB4413.eurprd01.prod.exchangelabs.com>
References: <CY4PR1101MB21339312E8F5656D8C887BFE81B30 AT CY4PR1101MB2133 DOT namprd11 DOT prod DOT outlook DOT com> <87ftl0jb1i DOT fsf AT Rainer DOT invalid> <VI1PR01MB44132EB2432CCD4CE1892304DEB30 AT VI1PR01MB4413 DOT eurprd01 DOT prod DOT exchangelabs DOT com>
From: Lee <ler762 AT gmail DOT com>
Date: Fri, 13 Sep 2019 19:05:38 -0400
Message-ID: <CAD8GWsu80Fd7edqaC5GYZnFvkjUGdtxd6Lpg9t_WJ-uUoCv_mA@mail.gmail.com>
Subject: Re: My C arrays are too large
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes

On 9/13/19, Jose Isaias Cabrera wrote:
>
> Achim Gratz, on Friday, September 13, 2019 02:39 PM, wrote...
>>
>> Blair, Charles E III writes:
>> > My apologies for failing to reply on-list.  I don't know how :(
>> >
>> > My machine is 64 bit, and I hope I installed the correct version of
>> > cygwin.
>> >
>> > This program:
>> >
>> > #include<stdio.h>
>> > int main(){char *a[50][8192];
>> > return 0;}
>> >
>> > compiles with gcc  (no special options) but gives "Segmentation fault".
>>
>> You are creating an automatic variable that's larger than the default
>> stack.  You need to enlarge the stack, either during link time or later
>> e.g. via
>>
>> peflags -x0x800000 a.out
>
> This is great! Thanks.
>
> But, let's talk about this a bit... Shouldn't the compiler provide some
> warning, and also, it should never blow up with a "Segmentation fault".  I
> believe there should be some type of Out Of Memory error, or something like
> it.  But now just blow up.  Anyone thinks like me?  Just my 102 Dominican
> cents ($1 = $51 Dominican). :-)

Yes, it would be nice if you got an error message.  But once you
notice a .stackdump file has magically appeared, then
$ gcc -o a.exe starray.c

$ ./a
Segmentation fault (core dumped)

$ cat a.exe.stackdump
Exception: STATUS_STACK_OVERFLOW at rip=001004010C6
  <.. snip ..>

Search for "cygwin STATUS_STACK_OVERFLOW" and find
  https://github.com/OpenFAST/openfast/issues/144

which gives you
$ gcc -o a.exe -Wl,--stack,0x1000000 starray.c

$ ./a

$ peflags -x a.exe
a.exe: stack reserve size      : 16777216 (0x1000000) bytes

Regards,
Lee

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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