From mboxrd@z Thu Jan 1 00:00:00 1970 From: "John David Anglin" To: law@redhat.com Cc: mark@codesourcery.com, gcc@gcc.gnu.org Subject: Re: C++ Issue on GCC 3.0 branch Date: Mon, 23 Apr 2001 10:39:00 -0000 Message-id: <200104231739.NAA07856@hiauly1.hia.nrc.ca> References: <18550.988013590@slagheap.cygnus.com> X-SW-Source: 2001-04/msg01076.html > > I reverted the subspace name truncation in pa.h and did a build last night. > > This resolved the problem with missing symbols that I saw. With this and > > the constructor patch, the shared libstdc++ now builds. However, most > > applications linked to it generate a segmentation fault when they start. > > It appears this happens when they try to run the constructors. I will see > > if > > I can figure out what's going wrong. > Please stop. You're going down the wrong direction into a rathole. Here is some more information about the above problem using: # /usr/local/bin/hp735-hpux-gdb header_ciso646.sh-exe GDB is free software and you are welcome to 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. GDB 4.16 (hppa1.1-hp-hpux --target hp735-hpux), Copyright 1996 Free Software Foundation, Inc... (gdb) run Starting program: /xxx/gnu/gcc-3.0/objdir/hppa1.1-hp-hpux10.20/libstdc++-v3/test suite/header_ciso646.sh-exe warning: Unable to find __d_pid symbol in object file. warning: Suggest linking with /usr/lib/end.o. warning: GDB will be unable to track shl_load/shl_unload calls Current language: auto; currently c Program received signal SIGSEGV, Segmentation fault. 0x7adfdc08 in _ZNSt8ios_base4InitC1Ev (this=0x7ada5998) at ../../../../libstdc++-v3/src/ios.cc:138 138 if (++_S_ios_base_init == 1) Current language: auto; currently c++ (gdb) bt #0 0x7adfdc08 in _ZNSt8ios_base4InitC1Ev (this=0x7ada5998) at ../../../../libstdc++-v3/src/ios.cc:138 #1 0x7adfae90 in _Z41__static_initialization_and_destruction_0ii ( __initialize_p=1, __priority=65535) at ../../../../libstdc++-v3/include/bits/stl_algobase.h:57 #2 0x7adfb264 in _GLOBAL__I__ZNKSt12_Base_bitsetILj1EE16_M_do_find_firstEj () at ../../../../libstdc++-v3/include/bits/stl_algobase.h:727 #3 0x7ade43dc in _GLOBAL__FI_libstdc___sl_3_0 () #4 0x28a0 in __do_global_ctors () #5 0x2950 in __main () #6 0x4f20 in main () at /xxx/gnu/gcc-3.0/libstdc++-v3/testsuite/17_intro/header_ciso646.cc:122 The program binding has been changed to immediate. I am using the above old version of gdb because gdb 5.0 (my latest build) dumps core when the program hits the SIGSEGV. (gdb) disass Dump of assembler code for function _ZNSt8ios_base4InitC1Ev: 0x7adfdb58 <_ZNSt8ios_base4InitC1Ev>: stw rp,-14(sr0,sp) 0x7adfdb5c <_ZNSt8ios_base4InitC1Ev+4>: copy r3,r1 0x7adfdb60 <_ZNSt8ios_base4InitC1Ev+8>: copy sp,r3 0x7adfdb64 <_ZNSt8ios_base4InitC1Ev+12>: stwm r1,1c0(sr0,sp) 0x7adfdb68 <_ZNSt8ios_base4InitC1Ev+16>: stw r19,-20(sr0,sp) 0x7adfdb6c <_ZNSt8ios_base4InitC1Ev+20>: stw r18,c8(sr0,r3) 0x7adfdb70 <_ZNSt8ios_base4InitC1Ev+24>: stw r17,cc(sr0,r3) 0x7adfdb74 <_ZNSt8ios_base4InitC1Ev+28>: stw r16,d0(sr0,r3) 0x7adfdb78 <_ZNSt8ios_base4InitC1Ev+32>: stw r15,d4(sr0,r3) 0x7adfdb7c <_ZNSt8ios_base4InitC1Ev+36>: stw r14,d8(sr0,r3) 0x7adfdb80 <_ZNSt8ios_base4InitC1Ev+40>: stw r13,dc(sr0,r3) 0x7adfdb84 <_ZNSt8ios_base4InitC1Ev+44>: stw r12,e0(sr0,r3) 0x7adfdb88 <_ZNSt8ios_base4InitC1Ev+48>: stw r11,e4(sr0,r3) 0x7adfdb8c <_ZNSt8ios_base4InitC1Ev+52>: stw r10,e8(sr0,r3) 0x7adfdb90 <_ZNSt8ios_base4InitC1Ev+56>: stw r9,ec(sr0,r3) 0x7adfdb94 <_ZNSt8ios_base4InitC1Ev+60>: stw r8,f0(sr0,r3) 0x7adfdb98 <_ZNSt8ios_base4InitC1Ev+64>: stw r7,f4(sr0,r3) 0x7adfdb9c <_ZNSt8ios_base4InitC1Ev+68>: stw r6,f8(sr0,r3) 0x7adfdba0 <_ZNSt8ios_base4InitC1Ev+72>: stw r5,fc(sr0,r3) 0x7adfdba4 <_ZNSt8ios_base4InitC1Ev+76>: stw r4,100(sr0,r3) 0x7adfdba8 <_ZNSt8ios_base4InitC1Ev+80>: ldo 108(r3),r1 0x7adfdbac <_ZNSt8ios_base4InitC1Ev+84>: fstds,ma fr21,8(sr0,r1) 0x7adfdbb0 <_ZNSt8ios_base4InitC1Ev+88>: fstds,ma fr20,8(sr0,r1) 0x7adfdbb4 <_ZNSt8ios_base4InitC1Ev+92>: fstds,ma fr19,8(sr0,r1) 0x7adfdbb8 <_ZNSt8ios_base4InitC1Ev+96>: fstds,ma fr18,8(sr0,r1) 0x7adfdbbc <_ZNSt8ios_base4InitC1Ev+100>: fstds,ma fr17,8(sr0,r1) 0x7adfdbc0 <_ZNSt8ios_base4InitC1Ev+104>: fstds,ma fr16,8(sr0,r1) 0x7adfdbc4 <_ZNSt8ios_base4InitC1Ev+108>: fstds,ma fr15,8(sr0,r1) 0x7adfdbc8 <_ZNSt8ios_base4InitC1Ev+112>: fstds,ma fr14,8(sr0,r1) 0x7adfdbcc <_ZNSt8ios_base4InitC1Ev+116>: fstds,ma fr13,8(sr0,r1) 0x7adfdbd0 <_ZNSt8ios_base4InitC1Ev+120>: fstds,ma fr12,8(sr0,r1) 0x7adfdbd4 <_ZNSt8ios_base4InitC1Ev+124>: stw r26,-24(sr0,r3) 0x7adfdbd8 <_ZNSt8ios_base4InitC1Ev+128>: bl 0x7adfdac8 <__get_eh_context>,rp 0x7adfdbdc <_ZNSt8ios_base4InitC1Ev+132>: nop 0x7adfdbe0 <_ZNSt8ios_base4InitC1Ev+136>: ldw 9c(sr0,r3),r19 0x7adfdbe4 <_ZNSt8ios_base4InitC1Ev+140>: copy ret0,r20 0x7adfdbe8 <_ZNSt8ios_base4InitC1Ev+144>: stws r20,-10(sr0,sp) 0x7adfdbec <_ZNSt8ios_base4InitC1Ev+148>: fldws -10(sr0,sp),fr22 0x7adfdbf0 <_ZNSt8ios_base4InitC1Ev+152>: fstws fr22,-10(sr0,sp) 0x7adfdbf4 <_ZNSt8ios_base4InitC1Ev+156>: ldws -10(sr0,sp),r1 0x7adfdbf8 <_ZNSt8ios_base4InitC1Ev+160>: stw r1,a4(sr0,r3) 0x7adfdbfc <_ZNSt8ios_base4InitC1Ev+164>: stw r19,9c(sr0,r3) 0x7adfdc00 <_ZNSt8ios_base4InitC1Ev+168>: addil -1000,r19 0x7adfdc04 <_ZNSt8ios_base4InitC1Ev+172>: copy r1,r21 0x7adfdc08 <_ZNSt8ios_base4InitC1Ev+176>: ldw 324(sr0,r21),r21 Register is wrong (it is 0 at 0x7adfdc00) causing the fault at the ldw. Register r21 is 0xfffff000. This looks like a code problem. Dave -- J. David Anglin dave.anglin@nrc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6605)