public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Denis Excoffier <cygwin@Denis-Excoffier.org>
To: cygwin@cygwin.com
Subject: gcc-4.5.3 segfaults wrt alloca
Date: Fri, 09 Dec 2011 10:58:00 -0000	[thread overview]
Message-ID: <20111209105801.GA10388@po8371> (raw)


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 <http://gnu.org/licenses/gpl.html>
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:
<http://www.gnu.org/software/gdb/bugs/>...
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
%

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

             reply	other threads:[~2011-12-09 10:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-09 10:58 Denis Excoffier [this message]
2011-12-09 14:31 ` Christopher Faylor
2011-12-09 14:55 ` Ryan Johnson
2011-12-09 17:02   ` Denis Excoffier
2011-12-09 17:07   ` Eric Blake
2011-12-09 17:41     ` Ryan Johnson
2011-12-09 20:37       ` Corinna Vinschen
2011-12-10 14:43         ` Dave Korn
2011-12-12  6:53           ` Denis Excoffier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111209105801.GA10388@po8371 \
    --to=cygwin@denis-excoffier.org \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).