public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/17696] New: [cygwin] builtin alloca SIGSEGV with size too large
@ 2004-09-27 16:31 gcc at axel-naumann dot de
  2004-09-27 16:52 ` [Bug middle-end/17696] " bangerth at dealii dot org
  0 siblings, 1 reply; 2+ messages in thread
From: gcc at axel-naumann dot de @ 2004-09-27 16:31 UTC (permalink / raw)
  To: gcc-bugs

Calling alloca with a large size triggers a SIGSEGV on cygwin. On linux, it does
not. I would expect it to do the same on cygwin, returning NULL if the size is
too large. 
Sorry, no idea what component that belongs to - target, c, middle-end?
Axel.
--
// preproc code:
# 1 "alloca_iss.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "alloca_iss.c"
int main() { return (alloca(4200000)!=0); }
--
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs
Configured with: /gcc/gcc-3.3.3-3/configure --verbose --prefix=/usr --exec-prefi
x=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/s
hare/man --infodir=/usr/share/info --enable-languages=c,ada,c++,d,f77,java,objc,
pascal --enable-nls --without-included-gettext --enable-libgcj --with-system-zli
b --enable-interpreter --enable-threads=posix --enable-java-gc=boehm --enable-sj
lj-exceptions --disable-version-specific-runtime-libs --disable-win32-registry
Thread model: posix
gcc version 3.3.3 (cygwin special)
--
CYGWIN_NT-5.1 ACEL 1.5.11(0.116/4/2) 2004-09-04 23:17 i686 unknown unknown Cygwin
--
command line triggering the issue: gcc alloca_iss.c
--
output of gcc -v -save-temps alloca_iss.c
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs
Configured with: /gcc/gcc-3.3.3-3/configure --verbose --prefix=/usr
--exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib
--mandir=/usr/share/man --infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,java,objc,pascal --enable-nls
--without-included-gettext --enable-libgcj --with-system-zlib
--enable-interpreter --enable-threads=posix --enable-java-gc=boehm
--enable-sjlj-exceptions --disable-version-specific-runtime-libs
--disable-win32-registry
Thread model: posix
gcc version 3.3.3 (cygwin special)
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/cc1.exe -E -quiet -v -D__GNUC__=3
-D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3 -D__CYGWIN32__ -D__CYGWIN__ -Dunix
-D__unix__ -D__unix -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../include/w32api -idirafter
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/lib/../../include/w32api
alloca_iss.c alloca_iss.i
ignoring nonexistent directory "/usr/i686-pc-cygwin/include"
ignoring duplicate directory "/usr/i686-pc-cygwin/lib/../../include/w32api"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/include
 /usr/include
 /usr/include/w32api
End of search list.
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/cc1.exe -fpreprocessed alloca_iss.i
-quiet -dumpbase alloca_iss.c -auxbase alloca_iss -version -o alloca_iss.s
GNU C version 3.3.3 (cygwin special) (i686-pc-cygwin)
        compiled by GNU C version 3.3.3 (cygwin special).
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=65406
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/bin/as.exe
--traditional-format -o alloca_iss.o alloca_iss.s
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/collect2.exe -Bdynamic
--dll-search-prefix=cyg /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../crt0.o
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/crtbegin.o
-L/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3
-L/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../.. alloca_iss.o -lgcc -lcygwin
-luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/crtend.o

-- 
           Summary: [cygwin] builtin alloca SIGSEGV with size too large
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gcc at axel-naumann dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-cygwin
  GCC host triplet: i686-pc-cygwin
GCC target triplet: i686-pc-cygwin


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17696


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug middle-end/17696] [cygwin] builtin alloca SIGSEGV with size too large
  2004-09-27 16:31 [Bug middle-end/17696] New: [cygwin] builtin alloca SIGSEGV with size too large gcc at axel-naumann dot de
@ 2004-09-27 16:52 ` bangerth at dealii dot org
  0 siblings, 0 replies; 2+ messages in thread
From: bangerth at dealii dot org @ 2004-09-27 16:52 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 747 bytes --]


------- Additional Comments From bangerth at dealii dot org  2004-09-27 16:52 -------
The man page of alloca says: 
    RETURN VALUE 
       The alloca function returns a pointer to the beginning  of 
       the allocated space.  If the allocation causes stack over­ 
       flow, program behaviour is undefined. 
 
I guess you have to live with the fact that allocating large chunks of 
memory on the stack isn't such a great idea. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17696


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-09-27 16:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-27 16:31 [Bug middle-end/17696] New: [cygwin] builtin alloca SIGSEGV with size too large gcc at axel-naumann dot de
2004-09-27 16:52 ` [Bug middle-end/17696] " bangerth at dealii dot org

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