X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org X-Mail-Handler: MailHop Outbound by DynDNS X-Report-Abuse-To: abuse AT dyndns DOT com (see http://www.dyndns.com/services/mailhop/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+2BA7avYKqDNsiGcWgZvqW Date: Fri, 9 Dec 2011 09:31:22 -0500 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: gcc-4.5.3 segfaults wrt alloca Message-ID: <20111209143122.GA2620@ednor.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20111209105801 DOT GA10388 AT po8371> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111209105801.GA10388@po8371> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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 Fri, Dec 09, 2011 at 11:57:37AM +0059, 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. > >Thank you for your help. > >Regards, > >Denis Excoffier. > > > >% uname -a >CYGWIN_NT-5.1 %%EDITED%% 1.7.10s(0.255/5/3) 20111209 06:57:51 i686 Cygwin >% cat foo.cc >// >// /usr/bin/g++ -o foo foo.cc >// >#define DONT_USE_NEW >int main() { >// >#ifdef DONT_USE_NEW > unsigned int const SIZE = 689471; > int foo[SIZE]; >#else > unsigned int const SIZE = 68947100; > int *const foo = new int [SIZE]; >#endif > for ( unsigned int i = 0 ; i < SIZE ; ++i ) { > foo[i] = i; > }; >#ifdef DONT_USE_NEW >#else > // missing free >#endif > return(0); >}; >% /usr/bin/g++ -o foo foo.cc >% ./foo >Segmentation fault (core dumped) >% /usr/bin/gdb ./foo >GNU gdb (GDB) 7.3.50.20111026-cvs (cygwin-special) >Copyright (C) 2011 Free Software Foundation, Inc. >License GPLv3+: GNU GPL version 3 or later >This is free software: you are free to change and redistribute it. >There is NO WARRANTY, to the extent permitted by law. Type "show copying" >and "show warranty" for details. >This GDB was configured as "i686-cygwin". >For bug reporting instructions, please see: >... >Reading symbols from %%EDITED%%/foo...done. >(gdb) run >Starting program: %%EDITED%%/foo >[New Thread 3256.0xf44] >[New Thread 3256.0x1908] > >Program received signal SIGSEGV, Segmentation fault. >_alloca () > at /gnu/gcc/releases/respins/4.5.3-3/gcc4-4.5.3-3/src/gcc-4.5.3/libgcc/../gcc/config/i386/cygwin.asm:45 >45 /gnu/gcc/releases/respins/4.5.3-3/gcc4-4.5.3-3/src/gcc-4.5.3/libgcc/../gcc/config/i386/cygwin.asm: No such file or directory. > in /gnu/gcc/releases/respins/4.5.3-3/gcc4-4.5.3-3/src/gcc-4.5.3/libgcc/../gcc/config/i386/cygwin.asm >(gdb) quit >A debugging session is active. > > Inferior 1 [process 3256] will be killed. > >Quit anyway? (y or n) y WFM, sorry. cgf % gdb /tmp/foo GNU gdb (GDB) 7.3.50.20111026-cvs (cygwin-special) Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-cygwin". For bug reporting instructions, please see: ... /home/cgf/.gdbinit:2: Error in sourced command file: No symbol table is loaded. Use the "file" command. Reading symbols from /tmp/foo...done. (gdb) r Starting program: /tmp/foo [New Thread 1784.0x106c] warning: section .gnu_debuglink not found in /cygdrive/d/cygwin/bin/cygwin1.dbg [New Thread 1784.0xedc] [Inferior 1 (process 1784) exited normally] -- 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