Operating System - HP-UX
1754014 Members
7335 Online
108811 Solutions
New Discussion юеВ

Re: HPUX 11.23 STL core dump C_make_facet

 
HP UX 11.23 STL core du
Occasional Advisor

Re: HPUX 11.23 STL core dump C_make_facet

Thanks Dennis -

>> Ideally your lib shouldn't be linked against libc

Well, we donot explicitly link libc.

>>Well the horse answer is that you forgot -mt somewhere.

I ran "elfdump -dc" product1 binaries which loads prodict2 shared libraries and I think some of them are missing -mt options.
Just to clarify this. How do you identify wheather binary is -mt enabled or not

Is it "ecom options" section which must say -mt on?

I confirmed all product2 binararies are -mt enabled.

- Ajit
Dennis Handly
Acclaimed Contributor

Re: HPUX 11.23 STL core dump C_make_facet

>we do not explicitly link libc.

It was listed with your "ldd output" above. Unless that was for your whole application, not just the one shlib.

>I ran "elfdump -dc" product1 binaries which loads prodict2 shared libraries and I think some of them are missing -mt options.
>How do you identify whether binary is -mt enabled or not
>Is it "ecom options" section which must say -mt on?

It's complicated. That's why you should be using footprints(1). You see "-mt on" only if you are on A.06.07 or later AND you use -mt. For your A.06.05 objects you can't tell.

>I confirmed all product2 binaries are -mt enabled.

Except the problem could be elsewhere.
HP UX 11.23 STL core du
Occasional Advisor

Re: HPUX 11.23 STL core dump C_make_facet

Thanks Dennis -

I matched exact product1 flags to build product2 library but still fails. Interesting thing is even if we define -DRW_NO_STL it fails with same stack trace. I beleive RW_NO_STL flag should disable calling rw_ routines?

http://www.roguewave.com/support/docs/hppdocs/genbd/4-2.html

compile flags now -
+d -AA -mt -z -ext +w +We400 +W392 +W302 -Wc,-ansi_for_scope,on -D_POSIX_C_SOURCE=199506L -DHPUX_VERS=1100 +DD64 +DSitanium2 +Ofltacc +DD64 +DSitanium2 -DRW_NO_STL -DHPUX_IPF

link flags -
-Wl,+s +DD64 +d +DSitanium2 -b -Wl,+s -z ├в mt


Stack trace -
#10 0xc0000000000ced70:0 in pthread_mutex_lock+0x610 ()
#11 0xc000000000339d70:0 in __thread_mutex_lock+0xb0 ()
#12 0xc00000000440b530:0 in _HPMutexWrapper::lock(void*)+0x90 ()
#13 0xc000000004412d60:0 in std::basic_string,std::allocator >::operator=(std::basic_string,std::allocator > const&)+0xa0 ()
#14 0xc00000000444df10:0 in std::numpunct::_C_initfacet(std::locale const&)+0x1d0 ()
#15 0xc00000000441e320:0 in std::locale::_C_install_facet(__rw::__rw_facet_base*,std::locale::id const&) const+0x120 ()
#16 0xc00000000441d3c0:0 in std::locale::_C_make_facet(std::locale::id const&,bo---Type to continue, or q to quit---
ol,int,__rw::__rw_facet_base* (*)(int,char const*,unsigned long)) const
+0x3e0 ()
#17 0xc0000000044d77e0:0 in std::num_put > >::do_put(std::ostreambuf_iterator >,std::ios_base&,char,int) const+0x4a0 ()
#18 0xc000000057406ea0:0 in std::num_put > >::put () at /opt/aCC/include_std/rw/numeral:518
#19 0xc0000000574092d0:0 in std::basic_ostream >& __rw::__rw_insert,int> ()
at /opt/aCC/include_std/ostream.cc:51
#20 0xc000000057403150:0 in std::basic_ostream >::operator<< () at /opt/aCC/include_std/ostream:161
Dennis Handly
Acclaimed Contributor

Re: HPUX 11.23 STL core dump C_make_facet

>Interesting thing is even if we define -DRW_NO_STL it fails with same stack trace. I believe RW_NO_STL flag should disable calling rw_ routines?

You should absolutely NOT use -DRW_NO_STL. This is NOT supported with HP's version of tools.h++. (But you probably aren't using librwtool*.)

>+We400 +W392 +W302

These are old aCC5 messages.

>-Wc,-ansi_for_scope,on

Part of -AA.

>Stack trace

Can you get a stack trace to go all the way to the end?
Dennis Handly
Acclaimed Contributor

Re: HPUX 11.23 STL core dump C_make_facet

I typed up a small example to see the code flow.
You might try printing the data in _C_initfacet:
(gdb) rbreak numpunc.*_C_initfacet
(gdb) p ((std::numpunct*)$r32)[0]
I get:
$1 = {<:locale::facet> = {<__rw::__rw_facet_base> = {<__rw::__rw_synchronize
d> = {_C_mutex = {<__rw::__rw_mutex_base> = {_C_mutex = {
pmutex = 0x40023ea0}}, }}, _C_category = 128,
_C_flags = 0,
_C_ref_count = 0, __vfp = 0x76ded160}, }, <__rw::__rw_nump
unct_impl> = {<__rw::__rw_numpunct_impl_data> = {<__rw::__rw_punct_d
ata> = {_C_dp = 46 '.', _C_ts = 44 ',', _C_gr = {
_C_data = 0x76df5ab0 ""}}, _C_tn = {_C_data = 0x40026a50 "true"},
_C_fn = {_C_data = 0x40026b00 "false"}, tf_defs_ = {{_C_name = 0x0,
_C_indx = 0}, {_C_name = 0x0, _C_indx = 0}}, tf_map_ = {
_C_numdefs = 0, _C_defs = 0x0}}, }, }

You may have to compile with -g0 and have to add this to your source to get debug info for this class:
#include
struct foo : std::numpunct {
int member;
};
void dummy() {
foo *XX = 0;
XX->member = 99;
}

Or compile with -U_HP_INSTANTIATE_T_IN_LIB and you can just debug that function normally: p *this
Dennis Handly
Acclaimed Contributor

Re: HPUX 11.23 STL core dump C_make_facet

It turns out one of your shlibs wasn't compiled with -mt: libpmicuio.sl.32
HP UX 11.23 STL core du
Occasional Advisor

Re: HPUX 11.23 STL core dump C_make_facet

Dennis -

Issue is now fixed, After compiling ICU library.

Just wondering what tool we shall use to check -mt flag on libraries compiled
with A.06.05. Is it footprint?

Thanks for all your help.

- Ajit
HP UX 11.23 STL core du
Occasional Advisor

Re: HPUX 11.23 STL core dump C_make_facet

Hi Dennis -

Just quick on footprints command on binaries compiler with 06.05. I cann't see -mt option enabled on them?

How to check -mt for older compilers?

- Ajit
Dennis Handly
Acclaimed Contributor

Re: HPUX 11.23 STL core dump C_make_facet

>Just wondering what tool we shall use to check -mt flag on libraries compiled with A.06.05. Is it footprints?

Unfortunately footprints only works if you are on at least A.06.07 or you happen to compile with -g (fluke).

>Just quick on footprints command on binaries compiler with 06.05. I can't see -mt option enabled on them?

That's correct. :-( I finally fixed it.

>How to check -mt for older compilers?

You have to use advanced AI technology to look at the symbols being using and lots of guessing.