Boost logo

Boost :

From: Caleb Epstein (caleb.epstein_at_[hidden])
Date: 2004-12-06 14:57:14


The Boost.Threads test program test_mutex, when built with the SunPRO
C++ compiler, always hangs when I run it on a Solaris machine under
regression.py. The same binary finishes in short order with status 0
when run on the command line, but under regression.py it never exits.
If I attach to it with the debugger, or with strace or truss, it
finishes successfully.

I'm unclear what could be going wrong here and expect it is either a
bug in the code produced by SunPRO or a really subtle bug in the test
program. Perhaps someone could take a look? I am stumped. Here's
the output of a program I found called "thrstack" which produces a
stack trace for each thread w/o attaching to it:

status for pid 13551 (6 LWPs)
-- LWP 1 --
  ff19f48c: libc.so.1:__lwp_sema_wait + 0x8
  ff2396dc: libthread.so.1:_park + 0x114
  ff2393a4: libthread.so.1:_swtch + 0x424
  ff23da10: libthread.so.1:_reap_wait_cancel + 0x40
  ff23fc9c: libthread.so.1:_thrp_join + 0x344
  ff33d0d8: libboost_thread-sw-mt-d-1_32.so:void boost::thread::join() + 0x18
  000334a4: test_mutex:void
__unnamed_lpburfiEtB2zM::indirect_adapter<void(*)()>::operator()()const
+ 0x44
  000333b4: test_mutex:boost::detail::function::unusable
boost::detail::function::void_function_obj_invoker0<__unnamed_lpburfiEtB2zM::indirect_adapter<void(*)()>,void>::invoke(boost::detail::function::any_pointer)
+ 0x1c
  ff330748: libboost_thread-sw-mt-d-1_32.so:void
boost::function0<void,int>::operator()()const + 0x78
  ff33cd4c: libboost_thread-sw-mt-d-1_32.so:thread_proxy + 0x44
  ff24b01c: libthread.so.1:_thread_start + 0x40
  ff33cd08: libboost_thread-sw-mt-d-1_32.so:thread_proxy + 0x0
-- LWP 2 --
  ff19eddc: libc.so.1:__signotifywait + 0x4
  ff23e950: libthread.so.1:_dynamiclwps + 0x1c
  ff241c2c: libthread.so.1:_thr_yield + 0x8c
-- LWP 3 --
  ff19f48c: libc.so.1:__lwp_sema_wait + 0x8
  ff2396dc: libthread.so.1:_park + 0x114
  ff2393a4: libthread.so.1:_swtch + 0x424
  ff23ada0: libthread.so.1:_mutex_adaptive_lock + 0x160
  ff23aab4: libthread.so.1:_cmutex_lock + 0x84
  ff141cd0: libc.so.1:malloc + 0x18
  ff136174: libc.so.1:calloc + 0x54
  ff243e2c: libthread.so.1:_thr_setspecific + 0x38
  ff2e54bc: libCrun.so.1:__Cimpl::ex_thread*__Cimpl::ex_thread::get_thr_data()
+ 0x118
  ff2e4160: libCrun.so.1:__Cimpl::xstack*&__Cimpl::get_cur_xptr() + 0x4
  ff2e41b0: libCrun.so.1:void*__Crun::ex_alloc(unsigned) + 0x14
  0007c338: test_mutex:int
boost::detail::catch_signals(boost::execution_monitor&,bool,int) +
0x310
  0007ac38: test_mutex:int boost::execution_monitor::execute(bool,int) + 0x28
  00076e40: test_mutex:boost::unit_test::ut_detail::unit_test_monitor::error_level
boost::unit_test::ut_detail::unit_test_monitor::execute_and_translate(boost::unit_test::test_case*,void(boost::unit_test::test_case::*)(),int)
+ 0x60
  0005c1b0: test_mutex:void boost::unit_test::test_case::run() + 0x498
  0005cbc4: test_mutex:void boost::unit_test::test_suite::do_run() + 0x7c
  0005c3e0: test_mutex:void boost::unit_test::test_case::run() + 0x6c8
  00062208: test_mutex:main + 0x458
  0002cbb0: test_mutex:_start + 0x108
-- LWP 4 --
  ff19f48c: libc.so.1:__lwp_sema_wait + 0x8
  ff2396dc: libthread.so.1:_park + 0x114
  ff2393a4: libthread.so.1:_swtch + 0x424
  ff23ada0: libthread.so.1:_mutex_adaptive_lock + 0x160
  ff23aab4: libthread.so.1:_cmutex_lock + 0x84
  ff142b64: libc.so.1:free + 0x18
  ff2e6260: libCrun.so.1:void operator delete(void*) + 0x4
  00031c24: test_mutex:__SLIP.DELETER__H + 0x2c
  00031ba0: test_mutex:void boost::detail::sp_counted_base::destruct() + 0x40
  00030a5c: test_mutex:void
boost::detail::sp_counted_base::weak_release() + 0x6c
  0002f9cc: test_mutex:void boost::detail::sp_counted_base::release() + 0x8c
  0002f6ec: test_mutex:boost::detail::shared_count::~shared_count
#Nvariant 1() + 0x24
  0002ef58: test_mutex:boost::shared_ptr<boost::basic_wrap_stringstream<char>
>::~shared_ptr() + 0x10
  0002e540: test_mutex:boost::test_tools::extended_predicate_value::~extended_predicate_value()
+ 0x10
  0002e2dc: test_mutex:bool
boost::test_tools::tt_detail::equal_and_continue_impl<int,int>(const
__type_0&,const
__type_1&,boost::basic_wrap_stringstream<char>&,boost::unit_test::basic_cstring<const
char>,unsigned,boost::unit_test::log_level,unsigned) + 0x37c
  0002d6ac: test_mutex:boost::xtime
__unnamed_lpburfiEtB2zM::delay(int,int,int) + 0x10c
  0002d110: test_mutex:bool
__unnamed_lpburfiEtB2zM::execution_monitor::wait() + 0x20
  ff25c000: libthread.so.1:?? + 0x0
-- LWP 5 --
  ff2491fc: libthread.so.1:private___lwp_cond_wait + 0x4
  ff238998: libthread.so.1:_co_timerset + 0xa0
  ff24b01c: libthread.so.1:_thread_start + 0x40
  ff2388f8: libthread.so.1:_co_timerset + 0x0
-- LWP 6 --
  ff19c980: libc.so.1:__door_return + 0xc
  ff2467c8: libthread.so.1:_sc_door_func + 0x54
  ff23a358: libthread.so.1:_lwp_start + 0x18
  ff241c2c: libthread.so.1:_thr_yield + 0x8c

-- 
Caleb Epstein
caleb dot epstein at gmail dot com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk