[Bug target/24649] Hello world c++ prog core dumps
--- Comment #12 from steve at telxio dot com 2006-09-13 22:07 --- I will try again with the latest gcc 4.x -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24649
[Bug target/24649] Hello world c++ prog core dumps
--- Comment #13 from steve at telxio dot com 2006-09-19 05:41 --- I have tried gcc 4.1.1 and I still have the same problem - I tried it on a different Solaris10 machine than before, with all the latest patches, and got the same result. gcc was built with: PKG_BUILD_GCC_LANGS=c,c++ test -d objdir || mkdir objdir (cd objdir; ../configure \ --prefix=/opt/aegis \ --with-as=/usr/ccs/bin/as \ --without-gnu-as \ --with-ld=/usr/ccs/bin/ld \ --without-gnu-ld \ --enable-languages=$PKG_BUILD_GCC_LANGS \ --enable-shared \ --enable-__cxa_atexit \ --with-cpu=ultrasparc) gmake -j3 -C objdir LIBCXXFLAGS='-O2' bootstrap-lean I am going to try a simpler build to see if any of the options are causing the problems. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24649
[Bug target/24649] Hello world c++ prog core dumps
--- Comment #15 from steve at telxio dot com 2006-10-12 20:27 --- Subject: RE: Hello world c++ prog core dumps I have found the cause of the problem. It isn't a problem with gcc. I use the binutils shipped with Solaris10 to strip the binaries and create separate debug symbol files. If I do not strip g++/libstdc++, the test program runs with no problems. -Original Message- From: ebotcazou at gcc dot gnu dot org [mailto:[EMAIL PROTECTED] Sent: Monday, September 11, 2006 11:35 PM To: [EMAIL PROTECTED] Subject: [Bug target/24649] Hello world c++ prog core dumps --- Comment #11 from ebotcazou at gcc dot gnu dot org 2006-09-12 06:35 --- I've never been able to reproduce this. Do you still have the problem with the 4.x series of compiler? -- ebotcazou at gcc dot gnu dot org changed: What|Removed |Added CC||ebotcazou at gcc dot gnu dot ||org Status|ASSIGNED|WAITING http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24649 --- You are receiving this mail because: --- You reported the bug, or are watching the reporter. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24649
[Bug c++/24649] New: Hello world c++ prog core dumps when configured with /usr/ccs/bin/as
When gcc is configured to use /usr/ccs/bin/as on Solaris2.10, simple c++ prog involving cout fails with core dump. When the same version is configured to use GNU as the problem disappears R500.ramses.602> gcc -v Reading specs from /opt/utsi/test/R500/opt/utsi/lib/gcc/sparc-sun-solaris2.10/3.4.4/specs Configured with: ../configure --prefix=/opt/utsi/test/R500/opt/utsi --with-as=/usr/ccs/bin/as --without-gnu-as --with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-languages=c,c++ --enable-shared --with-cpu=ultrasparc Thread model: posix gcc version 3.4.4 R500.ramses.604> g++ tt.cc R500.ramses.605> ./a.out Segmentation Fault(coredump) R500.ramses.606> ldd a.out libstdc++.so.6 => /opt/utsi/test/R500/opt/utsi/lib/libstdc++.so.6 libm.so.2 => /lib/libm.so.2 libgcc_s.so.1 => /opt/utsi/test/R500/opt/utsi/lib/libgcc_s.so.1 libc.so.1 => /lib/libc.so.1 /platform/SUNW,Sun-Fire-V440/lib/libc_psr.so.1 == tt.cc === #if 0 #include #else #include using namespace std; #endif int main(int argc, char*argv[]) { cout << "Hello World" << endl; return 0; } -- Summary: Hello world c++ prog core dumps when configured with /usr/ccs/bin/as Product: gcc Version: 3.4.4 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: steve at telxio dot com GCC build triplet: sparc-sun-solaris2.10 GCC host triplet: sparc-sun-solaris2.10 GCC target triplet: sparc-sun-solaris2.10 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24649
[Bug c++/24649] Hello world c++ prog core dumps when configured with /usr/ccs/bin/as
--- Comment #2 from steve at telxio dot com 2005-11-03 20:31 --- Sorry, I forgot to post the version of the Solaris tools: R500.ramses.129> /usr/ccs/bin/as -V /usr/ccs/bin/as: Sun Compiler Common 10 s10_73 11/23/2004 R500.ramses.130> /usr/ccs/bin/ld -V ld: Software Generation Utilities - Solaris Link Editors: 5.10-1.480 R500.ramses.131> I have a different version of the link editor. I am up to date on Solaris10 patches. The last patch cluster was installed two days ago. The latest cluster contains: 117461-06 SunOS 5.10: ld Patch The patch README refers to a lot of issues working with gcc. I will get the additional info you require. Thanks for looking at this. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24649
[Bug c++/24649] Hello world c++ prog core dumps when configured with /usr/ccs/bin/as
--- Comment #3 from steve at telxio dot com 2005-11-03 21:09 --- = Backtace from gdb: = R500.ramses.185> g++ -g tt.cc R500.ramses.186> gdb a.out GNU gdb 6.3 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "sparc-sun-solaris2.10"... (gdb) r Starting program: /telos/src_dev/a.out Program received signal SIGSEGV, Segmentation fault. 0xff312650 in std::ostream::sentry::sentry () from /opt/utsi/test/R500/opt/utsi/lib/libstdc++.so.6 (gdb) bt #0 0xff312650 in std::ostream::sentry::sentry () from /opt/utsi/test/R500/opt/utsi/lib/libstdc++.so.6 #1 0xff3127b0 in std::operator<< > () from /opt/utsi/test/R500/opt/utsi/lib/libstdc++.so.6 #2 0x00010cc8 in main (argc=1, argv=0xffbffab4) at tt.cc:11 (gdb) l 11 cout << "Hello World" << endl; 12 return 0; 13 } (gdb) === Assember at point of failure === 0xff312640 <_ZNSo6sentryC1ERSo+0>: save %sp, -112, %sp 0xff312644 <_ZNSo6sentryC1ERSo+4>: clrb [ %i0 ] 0xff312648 <_ZNSo6sentryC1ERSo+8>: st %i1, [ %i0 + 4 ] 0xff31264c <_ZNSo6sentryC1ERSo+12>: ld [ %i1 ], %o5 0xff312650 <_ZNSo6sentryC1ERSo+16>: ld [ %o5 + -12 ], %g1 0xff312654 <_ZNSo6sentryC1ERSo+20>: add %i1, %g1, %g1 0xff312658 <_ZNSo6sentryC1ERSo+24>: ld [ %g1 + 0x70 ], %o0 0xff31265c <_ZNSo6sentryC1ERSo+28>: cmp %o0, 0 0xff312660 <_ZNSo6sentryC1ERSo+32>: be,pn %icc, 0xff312678 <_ZNSo6sentryC1ERSo+56> 0xff312664 <_ZNSo6sentryC1ERSo+36>: mov %i0, %l0 0xff312668 <_ZNSo6sentryC1ERSo+40>: ld [ %g1 + 0x14 ], %g1 0xff31266c <_ZNSo6sentryC1ERSo+44>: cmp %g1, 0 0xff312670 <_ZNSo6sentryC1ERSo+48>: be,pn %icc, 0xff31269c <_ZNSo6sentryC1ERSo+92> 0xff312674 <_ZNSo6sentryC1ERSo+52>: nop 0xff312678 <_ZNSo6sentryC1ERSo+56>: ld [ %o5 + -12 ], %g1 0xff31267c <_ZNSo6sentryC1ERSo+60>: add %i1, %g1, %g1 0xff312680 <_ZNSo6sentryC1ERSo+64>: ld [ %g1 + 0x14 ], %o5 0xff312684 <_ZNSo6sentryC1ERSo+68>: mov %g1, %i0 0xff312688 <_ZNSo6sentryC1ERSo+72>: cmp %o5, 0 0xff31268c <_ZNSo6sentryC1ERSo+76>: be %icc, 0xff3126ac <_ZNSo6sentryC1ERSo+108> 0xff312690 <_ZNSo6sentryC1ERSo+80>: or %o5, 4, %i1 0xff312694 <_ZNSo6sentryC1ERSo+84>: call 0xff3579a4 <_PROCEDURE_LINKAGE_TABLE_+384> ---Type to continue, or q to quit--- 0xff312698 <_ZNSo6sentryC1ERSo+88>: restore 0xff31269c <_ZNSo6sentryC1ERSo+92>: call 0xff357d7c <_PROCEDURE_LINKAGE_TABLE_+1368> 0xff3126a0 <_ZNSo6sentryC1ERSo+96>: nop 0xff3126a4 <_ZNSo6sentryC1ERSo+100>:b %xcc, 0xff312678 <_ZNSo6sentryC1ERSo+56> 0xff3126a8 <_ZNSo6sentryC1ERSo+104>:ld [ %i1 ], %o5 0xff3126ac <_ZNSo6sentryC1ERSo+108>:mov 1, %g1 0xff3126b0 <_ZNSo6sentryC1ERSo+112>:stb %g1, [ %l0 ] 0xff3126b4 <_ZNSo6sentryC1ERSo+116>:rett %i7 + 8 End of assembler dump. (gdb) == Output of truss: == R500.ramses.182> LD_LIBRARY_PATH=/opt/utsi/test/R500/opt/utsi/lib truss ./a.o> execve("a.out", 0xFFBFFB14, 0xFFBFFB1C) argc = 1 resolvepath("/usr/lib/ld.so.1", "/lib/ld.so.1", 1023) = 12 getcwd("/telos/src_dev", 1017) = 0 resolvepath("/telos/src_dev/a.out", "/telos/src_dev/a.out", 1023) = 20 stat("/telos/src_dev/a.out", 0xFFBFF8F0)= 0 open("/var/ld/ld.config", O_RDONLY) Err#2 ENOENT stat("/opt/utsi/test/R500/opt/utsi/lib/libstdc++.so.6", 0xFFBFF410) = 0 resolvepath("/opt/utsi/test/R500/opt/utsi/lib/libstdc++.so.6", "/opt/utsi/test/R500/opt/utsi/lib/libstdc++.so.6.0.3", 1023) = 51 open("/opt/utsi/test/R500/opt/utsi/lib/libstdc++.so.6", O_RDONLY) = 3 mmap(0x0001, 8192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 3, 0) = 0xFF3A mmap(0x0001, 1024000, PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF28 mmap(0xFF28, 814550, PROT_READ|PROT_EXEC, MAP_PRIVATE|0x410, 3, 0) = 0xFF28 mmap(0xFF356000, 124352, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|0x810, 3, 811008) = 0xFF356000 mmap(0xFF376000, 15992, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANON, -1, 0) = 0xFF376000 munmap(0xFF348000, 57344) = 0 memcntl(0xFF28, 316652, MC_ADVIS
[Bug c++/24649] Hello world c++ prog core dumps when configured with /usr/ccs/bin/as
--- Comment #4 from steve at telxio dot com 2005-11-03 21:58 --- I have created assembler files for both g++-3.4.4 --with-gnu-as and g++3.4.4 --without-gnu-as. I ran a diff on the two assembler files and their is only one significant difference: R500.ramses.240> diff tt.s.gnu-as tt.s.sol-as 322,323c322,323 < .uleb128 0x1 < .sleb128 -4 --- > .byte 0x1 > .byte 0x7c I will zip up both assembler files and attach them -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24649
[Bug c++/24649] Hello world c++ prog core dumps when configured with /usr/ccs/bin/as
--- Comment #5 from steve at telxio dot com 2005-11-03 22:06 --- Created an attachment (id=10137) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10137&action=view) gcc assembler output for both Solaris as and GNU as Contains two files that untar into the current directory: tt.s.gnu-as - output of gcc-3.4.4 -S (configed with --with-gnu-as) tt.s.sol-as - output of gcc-3.4.4 -S (configed with --without-gnu-as) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24649
[Bug c++/24649] Hello world c++ prog core dumps when configured with /usr/ccs/bin/as
--- Comment #7 from steve at telxio dot com 2005-11-03 23:05 --- If I install gcc-3.4.4 --without-gnu-as and using the Solaris tools directly I assemble and link the code, the resultant executable fails. If I install gcc-3.4.4 --with-gnu-as and again using the solaris tools directly and the same assembler, the resultant executable works. Only the gcc installation is changed. The assembler file and the Solaris tools and the way the tools are invoked remain constant. The following two commands were used to invoke the assembler and linker respectively both times: /usr/ccs/bin/as -V -Qy -s -xarch=v8plusa -o tt.o tt.s.sol-as /usr/ccs/bin/ld -V -Y P,/usr/ccs/lib:/usr/lib -Qy \ /opt/utsi/test/R500/opt/utsi/lib/gcc/sparc-sun-solaris2.10/3.4.4/crt1.o \ /opt/utsi/test/R500/opt/utsi/lib/gcc/sparc-sun-solaris2.10/3.4.4/crti.o \ /usr/ccs/lib/values-Xa.o \ /opt/utsi/test/R500/opt/utsi/lib/gcc/sparc-sun-solaris2.10/3.4.4/crtbegin.o \ -L/opt/utsi/test/R500/opt/utsi/lib/gcc/sparc-sun-solaris2.10/3.4.4 \ -L/usr/ccs/bin -L/usr/ccs/lib \ -L/opt/utsi/test/R500/opt/utsi/lib/gcc/sparc-sun-solaris2.10/3.4.4/../../.. \ tt.o \ -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc -lc \ /opt/utsi/test/R500/opt/utsi/lib/gcc/sparc-sun-solaris2.10/3.4.4/crtend.o \ /opt/utsi/test/R500/opt/utsi/lib/gcc/sparc-sun-solaris2.10/3.4.4/crtn.o -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24649
[Bug c++/24649] Hello world c++ prog core dumps when configured with /usr/ccs/bin/as
--- Comment #8 from steve at telxio dot com 2005-11-03 23:08 --- I forgot to mention, the assembler used was the code generated by gcc-3.4.4 --without-gnu-as, i.e. the configuration that fails. Would you like me to try and get the same backtrace and assembler information for the configuration that works. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24649
[Bug c++/24649] Hello world c++ prog core dumps when configured with /usr/ccs/bin/as
--- Comment #9 from steve at telxio dot com 2005-11-03 23:15 --- The problem lies in the file: /opt/utsi/test/R500/opt/utsi/lib/libstdc++.so.6.0.3 If I compile the program with gcc-3.4.3 --without-gnu-as, the executable fails. I then install the libstdc++ library from the config --with-gnu-as, the executable now runs correctly. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24649