program compiled with gcc crashes on HPUX, that never had gcc on it

  • Follow


Hi ,
Need help. I have a program compiled and statically linked with GCC
libraries with gcc3.3.3 and linked with HPUX11.11 ld.

When such program is put to another HPUX 11.11, which has never had gcc
on it, crashes in STL functions with core. But when system has gcc/gdb
on it , it does not crash. Program uses STL functions and it crashes in
STL functions always!!

OUTPUT of : adb programname corefile:
adb>$c
_ZNSo6sentryC1ERSo() from
_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc+0xD0
_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc() from
_ZN19BiiNNMConfigurationC1ESsSs+59C
_ZN19BiiNNMConfigurationC1ESsSs() from
_ZN13BiiNNMManager10initSystemEv+0xA18
_ZN13BiiNNMManager10initSystemEv() from
_ZN13BiiNNMManager10mainBiiNNMEiPPc+134
_ZN13BiiNNMManager10mainBiiNNMEiPPc() from main+3C
main() from main+8
can't unwind -- no_entry
adb>

=======
HPUX System has uptodate patches on it.
=====
compile and Links options used are:

g++ -D_DEBUG -g -o programname -O3 -D_REENTRANT -static-libgcc
-nostdlib -Wl,+b/usr/lib:/opt/OV/lib -Wl,+s /usr/ccs/lib/crt0.o
file1.o file2.o file3.o -L/usr/lib -L../lib -L/usr/local/lib
-L/usr/local/lib/gcc-lib/hppa2.0w-hp-hpux11.11/3.3.3 -L/opt/OV/lib
-Wl,-B,immediate -Wl,-B,nonfatal -Wl,-B,verbose -Wl,-a,archive,-lstdc++
-lgcc_eh -lgcc  -Wl,-a,shared -lpthread -lc -lstream -lnsl -lm -lcl
-lCsup -levent -lovsnmp -lov


- Thanks

0
Reply nileshg (7) 3/18/2005 3:55:47 PM

Core on HPUX 11.11 happens even with a simple C++ program that uses
STL.
Program is:
============
#include<iostream>
#include<string>

using namespace std;

int main()
{
        string str("test");

        cout << "test string " << str << endl;
}

CORE DUMP is: #gdb test core
=============================
HP gdb 3.3 for PA-RISC 1.1 or 2.0 (narrow), HP-UX 11.00.
Copyright 1986 - 2001 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 3.3 (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions
to
change it and/or distribute copies. Type "show warranty" for
warranty/support.
...
Core was generated by `test'.
Program terminated with signal 11, Segmentation fault.

warning: The shared libraries were not privately mapped; setting a
breakpoint in a shared library will not work until you rerun the
program.
warning: Can't find file /opt/graphics/OpenGL/lib/libogltls.sl
referenced in dld
_list.
/opt/graphics/OpenGL/lib/libogltls.sl: No such file or directory.
#0  0xc5c16500 in _ZNSo6sentryC1ERSo+0x20 () from
/usr/local/lib/libstdc++.sl.5
(gdb) bt
#0  0xc5c16500 in _ZNSo6sentryC1ERSo+0x20 () from
/usr/local/lib/libstdc++.sl.5
#1  0xc5c16bec in
_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc+0xec
    () from /usr/local/lib/libstdc++.sl.5
#2  0x35d8 in main+0x160 ()



-thanks in advance
-Nilesh

0
Reply Nilesh 3/18/2005 4:39:08 PM


"Nilesh" <nileshg@gmail.com> schreef in bericht 
news:1111163948.459329.74920@o13g2000cwo.googlegroups.com...
> Core on HPUX 11.11 happens even with a simple C++ program that uses
> STL.
> Program is:
> ============
> #include<iostream>
> #include<string>
>
> using namespace std;
>
> int main()
> {
>        string str("test");
>
>        cout << "test string " << str << endl;
> }
>
> CORE DUMP is: #gdb test core
> =============================
> HP gdb 3.3 for PA-RISC 1.1 or 2.0 (narrow), HP-UX 11.00.
> Copyright 1986 - 2001 Free Software Foundation, Inc.
> Hewlett-Packard Wildebeest 3.3 (based on GDB) is covered by the
> GNU General Public License. Type "show copying" to see the conditions
> to
> change it and/or distribute copies. Type "show warranty" for
> warranty/support.
> ..
> Core was generated by `test'.
> Program terminated with signal 11, Segmentation fault.
>
> warning: The shared libraries were not privately mapped; setting a
> breakpoint in a shared library will not work until you rerun the
> program.
> warning: Can't find file /opt/graphics/OpenGL/lib/libogltls.sl
> referenced in dld
> _list.
> /opt/graphics/OpenGL/lib/libogltls.sl: No such file or directory.
> #0  0xc5c16500 in _ZNSo6sentryC1ERSo+0x20 () from
> /usr/local/lib/libstdc++.sl.5
> (gdb) bt
> #0  0xc5c16500 in _ZNSo6sentryC1ERSo+0x20 () from
> /usr/local/lib/libstdc++.sl.5
> #1  0xc5c16bec in
> _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc+0xec
>    () from /usr/local/lib/libstdc++.sl.5
> #2  0x35d8 in main+0x160 ()
>
>
>
> -thanks in advance
> -Nilesh


Nilesh,



Have you checked whether or not your /opt/graphics/OpenGL/lib/libogltls.sl 
file exist on the target machine?
If not that might cause the problem.


Regards,


Jan Gerrit 


0
Reply Jan 3/22/2005 5:48:15 AM

Hi,

Found the cure myself- HPUX 11.11 patching can be painful sometimes.
For gcc/g++ to work fine it requires HPUX 11.11 system to have the
latest ld and linker patches installed on it. As of Mar 22 , 2005
PHSS_30970 is available as cumulative ld(1) and linker tools cumulative
patch.

Check http://www2.itrc.hp.com/service/patch/mainPage.do for searching
patches.

Hope this helps users of gcc/g++ in runtime linker core and crashes.

- Nilesh Gujarathi

Nilesh wrote:
> Core on HPUX 11.11 happens even with a simple C++ program that uses
> STL.
> Program is:
> ============
> #include<iostream>
> #include<string>
>
> using namespace std;
>
> int main()
> {
>         string str("test");
>
>         cout << "test string " << str << endl;
> }
>
> CORE DUMP is: #gdb test core
> =============================
> HP gdb 3.3 for PA-RISC 1.1 or 2.0 (narrow), HP-UX 11.00.
> Copyright 1986 - 2001 Free Software Foundation, Inc.
> Hewlett-Packard Wildebeest 3.3 (based on GDB) is covered by the
> GNU General Public License. Type "show copying" to see the conditions
> to
> change it and/or distribute copies. Type "show warranty" for
> warranty/support.
> ..
> Core was generated by `test'.
> Program terminated with signal 11, Segmentation fault.
>
> warning: The shared libraries were not privately mapped; setting a
> breakpoint in a shared library will not work until you rerun the
> program.
> warning: Can't find file /opt/graphics/OpenGL/lib/libogltls.sl
> referenced in dld
> _list.
> /opt/graphics/OpenGL/lib/libogltls.sl: No such file or directory.
> #0  0xc5c16500 in _ZNSo6sentryC1ERSo+0x20 () from
> /usr/local/lib/libstdc++.sl.5
> (gdb) bt
> #0  0xc5c16500 in _ZNSo6sentryC1ERSo+0x20 () from
> /usr/local/lib/libstdc++.sl.5
> #1  0xc5c16bec in
> _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc+0xec
>     () from /usr/local/lib/libstdc++.sl.5
> #2  0x35d8 in main+0x160 ()
> 
> 
> 
> -thanks in advance
> -Nilesh

0
Reply Nilesh 3/22/2005 5:57:26 AM

Hi,

Found the cure myself- HPUX 11.11 patching can be painful sometimes.
For gcc/g++ to work fine it requires HPUX 11.11 system to have the
latest ld and linker patches installed on it. As of Mar 22 , 2005
PHSS_30970 is available as cumulative ld(1) and linker tools cumulative
patch.

Check http://www2.itrc.hp.com/service/patch/mainPage.do for searching
patches.

Hope this helps users of gcc/g++ in runtime linker core and crashes.

- Nilesh Gujarathi

Nilesh wrote:
> Core on HPUX 11.11 happens even with a simple C++ program that uses
> STL.
> Program is:
> ============
> #include<iostream>
> #include<string>
>
> using namespace std;
>
> int main()
> {
>         string str("test");
>
>         cout << "test string " << str << endl;
> }
>
> CORE DUMP is: #gdb test core
> =============================
> HP gdb 3.3 for PA-RISC 1.1 or 2.0 (narrow), HP-UX 11.00.
> Copyright 1986 - 2001 Free Software Foundation, Inc.
> Hewlett-Packard Wildebeest 3.3 (based on GDB) is covered by the
> GNU General Public License. Type "show copying" to see the conditions
> to
> change it and/or distribute copies. Type "show warranty" for
> warranty/support.
> ..
> Core was generated by `test'.
> Program terminated with signal 11, Segmentation fault.
>
> warning: The shared libraries were not privately mapped; setting a
> breakpoint in a shared library will not work until you rerun the
> program.
> warning: Can't find file /opt/graphics/OpenGL/lib/libogltls.sl
> referenced in dld
> _list.
> /opt/graphics/OpenGL/lib/libogltls.sl: No such file or directory.
> #0  0xc5c16500 in _ZNSo6sentryC1ERSo+0x20 () from
> /usr/local/lib/libstdc++.sl.5
> (gdb) bt
> #0  0xc5c16500 in _ZNSo6sentryC1ERSo+0x20 () from
> /usr/local/lib/libstdc++.sl.5
> #1  0xc5c16bec in
> _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc+0xec
>     () from /usr/local/lib/libstdc++.sl.5
> #2  0x35d8 in main+0x160 ()
> 
> 
> 
> -thanks in advance
> -Nilesh

0
Reply Nilesh 3/22/2005 5:57:43 AM

4 Replies
174 Views

(page loaded in 0.039 seconds)

Similiar Articles:













7/7/2012 1:12:54 PM


Reply: