Bug 12938 - segmentation fault
Summary: segmentation fault
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.3.1
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2003-11-07 08:15 UTC by Dave Abrahams
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host:
Target: i686-pc-cygwin
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
test case (293 bytes, text/plain)
2003-11-07 08:15 UTC, Dave Abrahams
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Abrahams 2003-11-07 08:15:09 UTC
G++ first reports an internal compiler error and segfault and then appears to 
go into an infinite loop when I try to compile the enclosed under Cygwin
Comment 1 Dave Abrahams 2003-11-07 08:15:42 UTC
Created attachment 5083 [details]
test case
Comment 2 Andrew Pinski 2003-11-07 15:30:20 UTC
I cannot reproduce this problem on i686-pc-linux-gnu with 3.4 (20031107), 3.2.3, or 3.3.1 
(20030707), 3.3.3 (20031105), or 3.3 (20021216). Can you provide the exact comand you invoke 
to get the seg fault? Also provide the exact version of gcc, by giving the output of gcc -v?
Comment 3 Dave Abrahams 2003-11-07 17:14:45 UTC
Subject: Re:  segmentation fault

"pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

    g++   -c -Wall -ftemplate-depth-100   -g -O0 -fno-inline  -v   -I "c:\boost"  -o "bix.test\gcc\debug\bix.obj"  "bix.cpp" 
    

Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/specs
Configured with: /netrel/src/gcc-3.3.1-2/configure --enable-languages=c,c++,f77,java --enable-libgcj --enable-threads=posix --with-system-zlib --enable-nls --without-included-gettext --enable-interpreter --enable-sjlj-exceptions --disable-version-specific-runtime-libs --enable-shared --build=i686-pc-linux --host=i686-pc-cygwin --target=i686-pc-cygwin --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --includedir=/nonexistent/include --libexecdir=/usr/sbin
Thread model: posix
gcc version 3.3.1 (cygming special)
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/cc1plus.exe -quiet -v -I c:\boost -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=1 -D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../../include/w32api -idirafter /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../../i686-pc-cygwin/lib/../../include/w32api bix.cpp -D__GNUG__=3 -quiet -dumpbase bix.cpp -auxbase-strip bix.test\gcc\debug\bix.obj -g -O0 -Wall -version -ftemplate-depth-100 -fno-inline -o /cygdrive/c/DOCUME~1/dave/LOCALS~1/Temp/ccl4SuA3.s
GNU C++ version 3.3.1 (cygming special) (i686-pc-cygwin)
	compiled by GNU C version 3.3.1 (cygming special).
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=65467
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:
 c:/boost
 /usr/include/c++/3.3.1
 /usr/include/c++/3.3.1/i686-pc-cygwin
 /usr/include/c++/3.3.1/backward
 /usr/local/include
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/include
 /usr/include
 /usr/include/w32api
End of search list.
bix.cpp: In function `int main()':
bix.cpp:14: internal compiler error: Segmentation fault

Comment 4 Andrew Pinski 2003-11-07 17:20:10 UTC
What happens if you remove the "-g" from the command line?
Comment 5 Dave Abrahams 2003-11-07 19:18:33 UTC
Subject: Re:  segmentation fault


g++   -c -Wall -ftemplate-depth-100  -O0 -fno-inline  -v   -I "c:\boost"  -o "bix.test\gcc\debug\bix.obj"  "her.cpp"
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/specs
Configured with: /netrel/src/gcc-3.3.1-2/configure --enable-languages=c,c++,f77,java --enable-libgcj --enable-threads=posix --with-system-zlib --enable-nls --without-included-gettext --enable-interpreter --enable-sjlj-exceptions --disable-version-specific-runtime-libs --enable-shared --build=i686-pc-linux --host=i686-pc-cygwin --target=i686-pc-cygwin --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --includedir=/nonexistent/include --libexecdir=/usr/sbin
Thread model: posix
gcc version 3.3.1 (cygming special)
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/cc1plus.exe -quiet -v -I c:\boost -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=1 -D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../../include/w32api -idirafter /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../../i686-pc-cygwin/lib/../../include/w32api her.cpp -D__GNUG__=3 -quiet -dumpbase her.cpp -auxbase-strip bix.test\gcc\debug\bix.obj -O0 -Wall -version -ftemplate-depth-100 -fno-inline -o /cygdrive/c/DOCUME~1/dave/LOCALS~1/Temp/ccFXHAz8.s
GNU C++ version 3.3.1 (cygming special) (i686-pc-cygwin)
	compiled by GNU C version 3.3.1 (cygming special).
GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=65467
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:
 c:/boost
 /usr/include/c++/3.3.1
 /usr/include/c++/3.3.1/i686-pc-cygwin
 /usr/include/c++/3.3.1/backward
 /usr/local/include
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/include
 /usr/include
 /usr/include/w32api
End of search list.
her.cpp: In function `int main()':
her.cpp:14: internal compiler error: Segmentation fault

Comment 6 Andrew Pinski 2003-11-09 02:46:18 UTC
Changing this to invalid to ...
Comment 7 Andrew Pinski 2003-11-09 02:46:44 UTC
change to unconfirmed.
Comment 8 Andrew Pinski 2003-11-10 16:47:28 UTC
3.3.1 is getting old at this point and your compiler is not a FSF compiler, can you test 
3.3.2 and maybe also report this to cygwin?
Comment 9 Dara Hazeghi 2003-11-23 05:40:54 UTC
I can't reproduce this with either 3.3.1 or 3.3 branch (20031122) cross-compilers to i686-pc-
cygwin.
Comment 10 Andrew Pinski 2003-11-23 06:30:38 UTC
The stack size on cygwin is too low, you have to compile GCC with a raised stack size 
(look at man ld or info ld for the option to pass to gcc to recompile gcc).
Comment 11 Geoff Keating 2003-11-23 07:27:10 UTC
Is it not possible to print a better error message than 'segmentation error' in this case?  For 
example, on Darwin GCC prints:

Out of stack space.
Try running `ulimit -S -s unlimited' in the shell to raise its limit.

(See config/rs6000/host-darwin.c.)
Comment 12 Andrew Pinski 2003-11-23 07:33:09 UTC
Yes it is but this is a known issue with cygwin and that you cannot change the stack size by using 
limit/ulimit on cygwin at all so you have to recompile GCC anyway.