delorie.com/archives/browse.cgi | search |
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:reply-to:subject:to:references:from:message-id | |
:date:mime-version:in-reply-to:content-type | |
:content-transfer-encoding; q=dns; s=default; b=K7gsAKbNgrwjMUTP | |
/NiHlBKlsxnVsoDQfg7fCO8BUaBlhi14hqp7WpJ3286tmShykIe2iws2f/6Q6/0n | |
JncfqbEclJulac+Mazrk8mFfKs7vJZuXeRSFsQSNZeHzW3gz3FkFBFpOgaupEY0K | |
RwVoFCmJ5Jm3bXS94hkFATnLV80= | |
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:reply-to:subject:to:references:from:message-id | |
:date:mime-version:in-reply-to:content-type | |
:content-transfer-encoding; s=default; bh=QUiAkeQfNBn98aYhoUcR0b | |
dxRa4=; b=puoddS8S7cJ4xlR4nX/+7Ah+OGfhqHF83QMrGlf8Dbn3xxAjqxvknh | |
otkSzvRF/bDfIYdCACyOT/nOounSvWLsj6UJFTQT1YGs9o1nnGuY4Vg33ubqCZ2e | |
TxWI3payKtnIiFZzjfedudOCZ41RN1lWWenEEm61z1FT1KykHmoaU= | |
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.4 required=5.0 tests=ASBESTOS_BODY,AWL,BAYES_00,SPF_PASS autolearn=no version=3.3.1 spammy=III, suit, charles, bg |
X-HELO: | mailsrv.cs.umass.edu |
Reply-To: | moss AT cs DOT umass DOT edu |
Subject: | Re: My C arrays are too large |
To: | cygwin AT cygwin DOT 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> <CAAr43iMBDJdYeybs0Lc3JZQyCDWGQuzU-MT-hVDDL0kg3LxFVg AT mail DOT gmail DOT com> <VI1P195MB0765C387C43BC4417FAFD8E3DE8E0 AT VI1P195MB0765 DOT EURP195 DOT PROD DOT OUTLOOK DOT COM> |
From: | Eliot Moss <moss AT cs DOT umass DOT edu> |
Message-ID: | <e2a3f85f-6005-a211-bbf8-5ed9c3faabbf@cs.umass.edu> |
Date: | Wed, 18 Sep 2019 16:40:47 -0400 |
User-Agent: | Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
MIME-Version: | 1.0 |
In-Reply-To: | <VI1P195MB0765C387C43BC4417FAFD8E3DE8E0@VI1P195MB0765.EURP195.PROD.OUTLOOK.COM> |
X-IsSubscribed: | yes |
On 9/18/2019 4:35 PM, Jose Isaias Cabrera wrote: > > Joel Rees, on Wednesday, September 18, 2019 02:38 PM, wrote... >> >> 2019$BG/(B9$B7n(B14$BF|(B($BEZ(B) 3:50 Jose Isaias Cabrera, on >>Moss >>> 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). :-) >>> >> >> Well, the behavior of the compiler itself is better discussed on the >> compiler's forums, although you may need your asbestos suit when you do so. >> >> That said, why do you want this variable to be automatic? Why do you want >> it allocated on the stack? > > I did not say automatically. I said that the compiler should provide some warning about the allocation being larger than the default stack. And, it should not result in a segmentation fault, but instead, the program should error out with out of memory, or, at least, "memory allocation is larger than default stack." Not just blow up. Automatic here means "stack allocated" (the "auto" keyword in C, which is almost always omitted because it is the default). Cheers - Eliot Moss -- 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
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |