CXX-DEV: (forw) [xsd-users] hpux 11.11 basic_string abort

Dennis Handly dhandly at cup.hp.com
Mon Oct 30 22:21:09 EST 2006


>From: Boris Kolpackov <boris at codesynthesis.com>
>One of our users posted the following problem report to our mailing
>list. The problem seems to be specific to aCC A.03.70 on HP-UX 11.11

This is specific to the aC++ runtime, not the version of the aC++ compiler.
If you link with libpthread.1, you must compile everything with -mt.

>so I was wondering if there is a known issue with this setup

Yes.
http://www.docs.hp.com/en/7762/5991-4874/threads.htm
Required Command-Line Options

>Also is there a way to disable synchronization in std::basic_string
>for a single-threaded application?
Boris

No.  This application is NOT single-threaded if you link with libpthread.1.
If you don't call pthread_create, you may want to consider stubbing out
libpthread.1, if you can't remove the dependency.

----- Forwarded message from Mark Lofdahl <MEL at DISC.com> -----
>I'm getting strange aborts in the destructor for basic_string.
>Our code is compiled single-threaded, as is the xerces library we are
>linking to.

Who is linking in libpthread?
Using chatr(1) on each shlib and the executable.

>Works fine on hpux 11.23 and aCC A.06.10

I'm not sure how?

>Below is a sample stack trace of the abort.
>Any ideas of why this may be happening?
Mark Lofdahl

Did you try compiling everything with -mt?

>Program terminated with signal 10, Bus error.
>#0  0xc003d478 in pthread_mutex_destroy+0x18 /usr/lib/libpthread.1
>#1  0xc021c1f0 in __thread_mutex_free+0x40 /usr/lib/libc.2
>#2  0xeb035730 in _HPMutexWrapper::~_HPMutexWrapper+0x34 /usr/lib/libstd_v2.2
>#3  0xecaab454 in std::basic_string<char>::_C_unlink at
     /opt/aCC/include_std/string:1002



More information about the xsd-users mailing list