delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/12/09/09:55:49

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.7 required=5.0 tests=AWL,BAYES_00,SPF_NEUTRAL
X-Spam-Check-By: sourceware.org
Message-ID: <4EE22156.4080402@cs.utoronto.ca>
Date: Fri, 09 Dec 2011 09:55:18 -0500
From: Ryan Johnson <ryan DOT johnson AT cs DOT utoronto DOT ca>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: gcc-4.5.3 segfaults wrt alloca
References: <20111209105801 DOT GA10388 AT po8371>
In-Reply-To: <20111209105801.GA10388@po8371>
X-IsSubscribed: yes
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

On 09/12/2011 5:58 AM, Denis Excoffier wrote:
> I use the latest packages and cygwin snapshots. The problem described
> below began several snapshots in the past, around beginning of December.
>
> The following program, with static allocation of a reasonable amount
> of data, segfaults, maybe in alloca(). With a smaller size
> (eg 10000) it's ok. With new/malloc (even with 100 times more) it's
> ok. With C or C++. 100% reproducible.
>    unsigned int const SIZE = 689471;
>    int foo[SIZE];
Reasonable? You're trying to stack-allocate 2.5MB of data. Don't do that 
-- stack sizes are 2MB or less in most operating systems. Besides, doing 
anything useful with a buffer that size would completely drown out the 
overhead of calling malloc.

Ryan




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