Version of GCC: 4.4.3
System Type: SunOS 5.10 Generic_139555-08 sun4u sparc SUNW,SPARC-Enterprise Source Code: // foo.C ////// #include <iostream> // main.C ///// #include <iostream> int main() { std::cerr << "Hello, World!" << std::endl; return 0; } Build Options: g++ -v -save-temps -G -o libfoo.so foo.C g++ -v -save-temps main.C -o main -lfoo -L${PWD} Compiler Output: Using built-in specs. Target: sparc-sun-solaris2.10 Configured with: ../gcc-4.4.3/configure --prefix=/usr/local/gcc-4.4.3 --disable-shared --enable-languages=c,c++ --enable-threads=posix --enable-__cxa_atexit --with-gnu-as --with-as=/usr/local/binutils-2.20.1/bin/as --with-gnu-ld --with-ld=/usr/local/binutils-2.20.1/bin/ld Thread model: posix gcc version 4.4.3 (GCC) COLLECT_GCC_OPTIONS='-v' '-save-temps' '-G' '-o' 'libfoo.so' '-mcpu=v9' /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../libexec/gcc/sparc-sun-solaris2.10/4.4.3/cc1plus -E -quiet -v -iprefix /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/ -D__sparcv8 foo.C -mcpu=v9 -fpch-preprocess -o foo.ii ignoring nonexistent directory "/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/../../../../sparc-sun-solaris2.10/include" ignoring duplicate directory "/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/../../lib/gcc/sparc-sun-solaris2.10/4.4.3/../../../../include/c++/4.4.3" ignoring duplicate directory "/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/../../lib/gcc/sparc-sun-solaris2.10/4.4.3/../../../../include/c++/4.4.3/sparc-sun-solaris2.10" ignoring duplicate directory "/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/../../lib/gcc/sparc-sun-solaris2.10/4.4.3/../../../../include/c++/4.4.3/backward" ignoring duplicate directory "/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/../../lib/gcc/sparc-sun-solaris2.10/4.4.3/include" ignoring duplicate directory "/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/../../lib/gcc/sparc-sun-solaris2.10/4.4.3/include-fixed" ignoring nonexistent directory "/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/../../lib/gcc/sparc-sun-solaris2.10/4.4.3/../../../../sparc-sun-solaris2.10/include" #include "..." search starts here: #include <...> search starts here: /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/../../../../include/c++/4.4.3 /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/../../../../include/c++/4.4.3/sparc-sun-solaris2.10 /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/../../../../include/c++/4.4.3/backward /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/include /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/include-fixed /usr/local/include /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/../../include /usr/include End of search list. COLLECT_GCC_OPTIONS='-v' '-save-temps' '-G' '-o' 'libfoo.so' '-mcpu=v9' /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../libexec/gcc/sparc-sun-solaris2.10/4.4.3/cc1plus -fpreprocessed foo.ii -quiet -dumpbase foo.C -mcpu=v9 -auxbase foo -version -o foo.s GNU C++ (GCC) version 4.4.3 (sparc-sun-solaris2.10) compiled by GNU C version 4.4.3, GMP version 4.3.1, MPFR version 2.4.1. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 5ef610e48486b83fe31fd3ba609e79bb COLLECT_GCC_OPTIONS='-v' '-save-temps' '-G' '-o' 'libfoo.so' '-mcpu=v9' /usr/local/binutils-2.20.1/bin/as -v --traditional-format -V -Qy -s -xarch=v8plus -o foo.o foo.s GNU assembler version 2.20.1 (sparc-sun-solaris2.10) using BFD version (GNU Binutils) 2.20.1.20100303 COMPILER_PATH=/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../libexec/gcc/sparc-sun-solaris2.10/4.4.3/:/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../libexec/gcc/:/usr/ccs/bin/ LIBRARY_PATH=/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/:/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/:/usr/ccs/lib/:/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/../../../:/lib/:/usr/lib/ COLLECT_GCC_OPTIONS='-v' '-save-temps' '-G' '-o' 'libfoo.so' '-mcpu=v9' /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../libexec/gcc/sparc-sun-solaris2.10/4.4.3/collect2 -V -G -Y P,/usr/ccs/lib:/usr/lib -rpath-link /usr/lib -Qy -o libfoo.so /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/crt1.o /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/crti.o /usr/ccs/lib/values-Xa.o /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/crtbegin.o -L/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3 -L/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc -L/usr/ccs/lib -L/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/../../.. foo.o -lstdc++ -lm -lgcc -lc -lgcc -lc /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/crtend.o /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/crtn.o GNU ld (GNU Binutils) 2.20.1.20100303 Supported emulations: elf32_sparc elf64_sparc Using built-in specs. Target: sparc-sun-solaris2.10 Configured with: ../gcc-4.4.3/configure --prefix=/usr/local/gcc-4.4.3 --disable-shared --enable-languages=c,c++ --enable-threads=posix --enable-__cxa_atexit --with-gnu-as --with-as=/usr/local/binutils-2.20.1/bin/as --with-gnu-ld --with-ld=/usr/local/binutils-2.20.1/bin/ld Thread model: posix gcc version 4.4.3 (GCC) COLLECT_GCC_OPTIONS='-v' '-save-temps' '-o' 'main' '-L/net/hqfs02.solipsys.com/nas/unix/users/p/s/pshakl/tests/wtf' '-mcpu=v9' /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../libexec/gcc/sparc-sun-solaris2.10/4.4.3/cc1plus -E -quiet -v -iprefix /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/ -D__sparcv8 main.C -mcpu=v9 -fpch-preprocess -o main.ii ignoring nonexistent directory "/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/../../../../sparc-sun-solaris2.10/include" ignoring duplicate directory "/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/../../lib/gcc/sparc-sun-solaris2.10/4.4.3/../../../../include/c++/4.4.3" ignoring duplicate directory "/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/../../lib/gcc/sparc-sun-solaris2.10/4.4.3/../../../../include/c++/4.4.3/sparc-sun-solaris2.10" ignoring duplicate directory "/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/../../lib/gcc/sparc-sun-solaris2.10/4.4.3/../../../../include/c++/4.4.3/backward" ignoring duplicate directory "/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/../../lib/gcc/sparc-sun-solaris2.10/4.4.3/include" ignoring duplicate directory "/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/../../lib/gcc/sparc-sun-solaris2.10/4.4.3/include-fixed" ignoring nonexistent directory "/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/../../lib/gcc/sparc-sun-solaris2.10/4.4.3/../../../../sparc-sun-solaris2.10/include" #include "..." search starts here: #include <...> search starts here: /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/../../../../include/c++/4.4.3 /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/../../../../include/c++/4.4.3/sparc-sun-solaris2.10 /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/../../../../include/c++/4.4.3/backward /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/include /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/include-fixed /usr/local/include /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/../../include /usr/include End of search list. COLLECT_GCC_OPTIONS='-v' '-save-temps' '-o' 'main' '-L/net/hqfs02.solipsys.com/nas/unix/users/p/s/pshakl/tests/wtf' '-mcpu=v9' /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../libexec/gcc/sparc-sun-solaris2.10/4.4.3/cc1plus -fpreprocessed main.ii -quiet -dumpbase main.C -mcpu=v9 -auxbase main -version -o main.s GNU C++ (GCC) version 4.4.3 (sparc-sun-solaris2.10) compiled by GNU C version 4.4.3, GMP version 4.3.1, MPFR version 2.4.1. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 5ef610e48486b83fe31fd3ba609e79bb COLLECT_GCC_OPTIONS='-v' '-save-temps' '-o' 'main' '-L/net/hqfs02.solipsys.com/nas/unix/users/p/s/pshakl/tests/wtf' '-mcpu=v9' /usr/local/binutils-2.20.1/bin/as -v --traditional-format -V -Qy -s -xarch=v8plus -o main.o main.s GNU assembler version 2.20.1 (sparc-sun-solaris2.10) using BFD version (GNU Binutils) 2.20.1.20100303 COMPILER_PATH=/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../libexec/gcc/sparc-sun-solaris2.10/4.4.3/:/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../libexec/gcc/:/usr/ccs/bin/ LIBRARY_PATH=/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/:/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/:/usr/ccs/lib/:/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/../../../:/lib/:/usr/lib/ COLLECT_GCC_OPTIONS='-v' '-save-temps' '-o' 'main' '-L/net/hqfs02.solipsys.com/nas/unix/users/p/s/pshakl/tests/wtf' '-mcpu=v9' /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../libexec/gcc/sparc-sun-solaris2.10/4.4.3/collect2 -V -Y P,/usr/ccs/lib:/usr/lib -rpath-link /usr/lib -Qy -o main /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/crt1.o /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/crti.o /usr/ccs/lib/values-Xa.o /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/crtbegin.o -L/net/hqfs02.solipsys.com/nas/unix/users/p/s/pshakl/tests/wtf -L/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3 -L/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc -L/usr/ccs/lib -L/net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/../../.. main.o -lfoo -lstdc++ -lm -lgcc -lc -lgcc -lc /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/crtend.o /net/tcnsrva/export/usr/local/SunOS/5.10/sun4/gcc-4.4.3/bin/../lib/gcc/sparc-sun-solaris2.10/4.4.3/crtn.o GNU ld (GNU Binutils) 2.20.1.20100303 Supported emulations: elf32_sparc elf64_sparc Program Output: Hello, World!zsh: segmentation fault (core dumped) Core Backtrace: GNU gdb (GDB) 7.1 Copyright (C) 2010 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 "sparc-sun-solaris2.10". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /net/hqfs02.solipsys.com/nas/unix/users/p/s/pshakl/tests/wtf/main...done. [New LWP 1] Reading symbols from /net/hqfs02.solipsys.com/nas/unix/users/p/s/pshakl/tests/wtf/libfoo.so...done. Loaded symbols for /net/hqfs02.solipsys.com/nas/unix/users/p/s/pshakl/tests/wtf/libfoo.so Reading symbols from /lib//libm.so.2...(no debugging symbols found)...done. Loaded symbols for /lib//libm.so.2 Reading symbols from /lib//libc.so.1...(no debugging symbols found)...done. [Thread debugging using libthread_db enabled] [New Thread 1 (LWP 1)] Loaded symbols for /lib//libc.so.1 Reading symbols from /platform/SUNW,SPARC-Enterprise/lib/libc_psr.so.1...(no debugging symbols found)...done. Loaded symbols for /platform/SUNW,SPARC-Enterprise/lib/libc_psr.so.1 Reading symbols from /lib/ld.so.1...(no debugging symbols found)...done. Loaded symbols for /lib/ld.so.1 Core was generated by `./main'. Program terminated with signal 11, Segmentation fault. #0 0xff32bbec in std::uncaught_exception () at ../../../../gcc-4.4.3/libstdc++-v3/libsupc++/eh_catch.cc:136 136 __cxa_eh_globals *globals = __cxa_get_globals (); (gdb) bt #0 0xff32bbec in std::uncaught_exception () at ../../../../gcc-4.4.3/libstdc++-v3/libsupc++/eh_catch.cc:136 #1 0xff30d3ec in ~sentry (__out=..., __s=0x10968 <error reading variable>, __n=13) at /tmp/sjlipco/gcc443obj/sparc-sun-solaris2.10/libstdc++-v3/include/ostream:408 #2 std::__ostream_insert<char, std::char_traits<char> > (__out=..., __s=0x10968 <error reading variable>, __n=13) at /tmp/sjlipco/gcc443obj/sparc-sun-solaris2.10/libstdc++-v3/include/bits/ostream_insert.h:110 #3 0xff30d764 in operator<< <std::char_traits<char> > (__out=..., __s=0x10968 <error reading variable>) at /tmp/sjlipco/gcc443obj/sparc-sun-solaris2.10/libstdc++-v3/include/ostream:510 #4 0x000107fc in main () (gdb) Additional Notes: - I've reproduced the seg fault on a Solaris 10 x86 machine. - I've reproduced the seg fault with g++ 4.4.1 - I've reproduced the seg fault using binutils ld version 2.19.1 - I have not been able to reproduce using g++ 4.3.3, 3.4.6, nor 3.3.2 - I have not been able to reproduce on Red Hat Enterprise Linux ES release 4 - I'm not entirely convinced this isn't a linker problem, but (at this point) I'm unsure how to go about distinguishing. -- Summary: cerr related segmentation fault Product: gcc Version: 4.4.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: paul dot shaklan at solipsys dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43734