From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86776 invoked by alias); 13 Sep 2019 12:18:26 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 86764 invoked by uid 89); 13 Sep 2019 12:18:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=mine, HX-Languages-Length:995 X-HELO: mailsrv.cs.umass.edu Received: from mailsrv.cs.umass.edu (HELO mailsrv.cs.umass.edu) (128.119.240.136) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Sep 2019 12:18:25 +0000 Received: from [192.168.0.14] (c-24-62-203-86.hsd1.ma.comcast.net [24.62.203.86]) by mailsrv.cs.umass.edu (Postfix) with ESMTPSA id 4B5B84023B8E; Fri, 13 Sep 2019 08:18:24 -0400 (EDT) Reply-To: moss@cs.umass.edu Subject: Re: My C arrays are too large To: cygwin@cygwin.com References: From: Eliot Moss Message-ID: <870fc8d4-4816-26b1-0b1f-3ed0aaa456f0@cs.umass.edu> Date: Fri, 13 Sep 2019 12:37:00 -0000 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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg00153.txt.bz2 On 9/13/2019 8:10 AM, Blair, Charles E III wrote: > 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 > int main(){char *a[50][8192]; > return 0;} > > compiles with gcc (no special options) but gives "Segmentation fault". Ah, it's a local variable, which means it's going on your stack. Have you set a stack size limit that's large enough? On my system ulimit -a will report all the limits, and ulimit -s can be used to set the stack limit. In my 64-bit cygwin, ulimit -a reports a stack size of 2032 K bytes. Your structure will be 50 * 8K * 8 = 3200 K bytes. So if your setup is similar to mine, your tack isn't big enough. If you declared the array outside of main so that it is global and in the bss area, if would probably work out of the box, but adjusting your stack size should fix your problem, I believe. Regards - EM -- 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