If you use -DBOOST_SP_USE_PTHREADS then the IA64-specific code I wrote for manipulating use counts will not be used. This worked on a dual-Itanium system under Linux, but I have not tested it on either the Itanium 2 or HP-UX. (Nor am I easily able to.) If you could use gdb to find exactly where the segmentation fault or bus error occurs, that might help me to track down the bug. You'll need to use the -g option to g++ in order for gdb to produce useful information.
Some more information: the problem does *not* occur on Red Hat Linux/IA64 or FreeBSD/IA64. The HP-UX problem you can reproduce/test for yourself by signing up for a HP-testdrive account and logging on to td176.testdrive.hp.com (see http://www.testdrive.hp.com/current.shtml). But you'll see: td176> g++ -I../../../ -g smart*.cpp td176> gdb a.out HP gdb 5.2 for HP Itanium (32 or 64 bit) and target HP-UX 11.2x. Copyright 1986 - 2001 Free Software Foundation, Inc. Hewlett-Packard Wildebeest 5.2 (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. .. (gdb) run Starting program: /house/maddock/libs/smart_ptr/test/a.out UDT with value 999888777 being destroyed UDT with value 111222333 being destroyed Program received signal SIGSEGV, Segmentation fault si_code: 1 - SEGV_MAPERR - Address not mapped to object. 0x400f021 in boost::detail::atomic_increment (pw=0x40012b94) at sp_counted_base_gcc_ia64.hpp:38 warning: Compilation directory is not absolute; could result in incorrect behavi or. Please report to HP. 38 "r"(pw)); (gdb) bt #0 0x400f021 in boost::detail::atomic_increment (pw=0x40012b94) at sp_counted_base_gcc_ia64.hpp:38 #1 0x400f4e0 in boost::detail::sp_counted_base::add_ref_copy (this=0x40012b90) at sp_counted_base_gcc_ia64.hpp:117 #2 0x400f950 in boost::detail::shared_count::shared_count (this=0x7ffff44c, r=@0x7ffff444) at shared_count.hpp:216 #3 0x4010d50 in boost::shared_ptr<int>::boost::shared_ptr<int> ( this=0x7ffff448) at shared_ptr.hpp:116 #4 0x400ad20:0 in test () at smart_ptr_test.cpp:165 #5 0x400ec30:0 in main () at smart_ptr_test.cpp:308 HTH, John.