[Interprocess] barrier_test hanging on Apple PowerPC

The "barrier_test" test from the interprocess library seems to be hanging on Mac OS X 10.4 PowerPC, and is causing at least one of the regression testers (OSL) to fail to submit nightly regression results. - Doug

Doug Gregor wrote:
The "barrier_test" test from the interprocess library seems to be hanging on Mac OS X 10.4 PowerPC, and is causing at least one of the regression testers (OSL) to fail to submit nightly regression results.
Ummm. I have no MacOS or PowerPC to test this, so until I figure what's happening, what's the correct thing to do, remove the test from the test-suite? Regards, Ion

Ion Gaztañaga wrote:
Doug Gregor wrote:
The "barrier_test" test from the interprocess library seems to be hanging on Mac OS X 10.4 PowerPC, and is causing at least one of the regression testers (OSL) to fail to submit nightly regression results.
Ummm. I have no MacOS or PowerPC to test this, so until I figure what's happening, what's the correct thing to do, remove the test from the test-suite?
Yes, that's the most reasonable thing to do. And of course asking around if anyone might help in debugging it comes next :-) -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com -- 102708583/icq - grafikrobot/aim - grafikrobot/yahoo

On Aug 21, 2007, at 1:52 PM, Ion Gaztañaga wrote:
Doug Gregor wrote:
The "barrier_test" test from the interprocess library seems to be hanging on Mac OS X 10.4 PowerPC, and is causing at least one of the regression testers (OSL) to fail to submit nightly regression results.
Ummm. I have no MacOS or PowerPC to test this, so until I figure what's happening, what's the correct thing to do, remove the test from the test-suite?
I guess so :( The problem only seems to occur on PowerPC Mac, because the test is running fine on my Intel Mac. There's a gdb dump of the backtraces for all running threads below. - Doug (gdb) info threads 11 process 2227 thread 0x2703 0x9002c448 in swtch_pri () 10 process 2227 thread 0x2603 0x9002c448 in swtch_pri () 9 process 2227 thread 0x2503 0x9002c448 in swtch_pri () 8 process 2227 thread 0x2403 0x9002c448 in swtch_pri () 7 process 2227 thread 0x2303 0x9002c448 in swtch_pri () 6 process 2227 thread 0x2203 0x9002c448 in swtch_pri () 5 process 2227 thread 0x2103 0x9002c448 in swtch_pri () 4 process 2227 thread 0x2003 0x9002c448 in swtch_pri () 3 process 2227 thread 0x1f03 0x9002c448 in swtch_pri () 2 process 2227 thread 0xc07 0x9002c448 in swtch_pri () * 1 process 2227 thread 0xd03 0x9002c4b8 in semaphore_wait_trap () (gdb) thread apply all bt Thread 11 (process 2227 thread 0x2703): #0 0x9002c448 in swtch_pri () #1 0x9002c414 in sched_yield () #2 0x00006990 in boost::interprocess::detail::thread_yield () at ../../../boost/interprocess/detail/os_thread_functions.hpp:66 #3 0x0000a810 in boost::interprocess::interprocess_condition::do_timed_wait (this=0xd8ac, tout_enabled=false, abs_time=@0xf0509bc8, mut=@0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_condition.hpp:113 #4 0x0000aa3c in boost::interprocess::interprocess_condition::do_wait (this=0xd8ac, mut=@0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_condition.hpp:70 #5 0x0000ab00 in boost::interprocess::interprocess_condition::wait<boost::interprocess::s coped_lock<boost::interprocess::interprocess_mutex> > (this=0xd8ac, lock=@0xf0509c7c) at ../../../boost/interprocess/sync/ interprocess_condition.hpp:85 #6 0x0000abd4 in boost::interprocess::barrier::wait (this=0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_barrier.hpp:40 #7 0x00003f40 in (anonymous namespace)::barrier_thread () at barrier_test.cpp:41 #8 0x0000ae6c in boost::detail::function::void_function_invoker0<void (*)(), void>::invoke (function_ptr=@0xf0509e00) at ../../../boost/function/ function_template.hpp:104 #9 0x00228e00 in boost::function0<void, std::allocator<boost::function_base> >::operator() (this=0xf0509dfc) at ../../../boost/function/function_template.hpp:693 #10 0x00215a34 in thread_proxy (param=0xbffff24c) at ../../../libs/ thread/src/thread.cpp:126 #11 0x9002bd08 in _pthread_body () Thread 10 (process 2227 thread 0x2603): #0 0x9002c448 in swtch_pri () #1 0x9002c414 in sched_yield () #2 0x00006990 in boost::interprocess::detail::thread_yield () at ../../../boost/interprocess/detail/os_thread_functions.hpp:66 #3 0x0000a810 in boost::interprocess::interprocess_condition::do_timed_wait (this=0xd8ac, tout_enabled=false, abs_time=@0xf0488bc8, mut=@0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_condition.hpp:113 #4 0x0000aa3c in boost::interprocess::interprocess_condition::do_wait (this=0xd8ac, mut=@0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_condition.hpp:70 #5 0x0000ab00 in boost::interprocess::interprocess_condition::wait<boost::interprocess::s coped_lock<boost::interprocess::interprocess_mutex> > (this=0xd8ac, lock=@0xf0488c7c) at ../../../boost/interprocess/sync/ interprocess_condition.hpp:85 #6 0x0000abd4 in boost::interprocess::barrier::wait (this=0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_barrier.hpp:40 #7 0x00003f40 in (anonymous namespace)::barrier_thread () at barrier_test.cpp:41 #8 0x0000ae6c in boost::detail::function::void_function_invoker0<void (*)(), void>::invoke (function_ptr=@0xf0488e00) at ../../../boost/function/ function_template.hpp:104 #9 0x00228e00 in boost::function0<void, std::allocator<boost::function_base> >::operator() (this=0xf0488dfc) at ../../../boost/function/function_template.hpp:693 #10 0x00215a34 in thread_proxy (param=0xbffff24c) at ../../../libs/ thread/src/thread.cpp:126 #11 0x9002bd08 in _pthread_body () Thread 9 (process 2227 thread 0x2503): #0 0x9002c448 in swtch_pri () #1 0x9002c414 in sched_yield () #2 0x00006990 in boost::interprocess::detail::thread_yield () at ../../../boost/interprocess/detail/os_thread_functions.hpp:66 #3 0x0000a810 in boost::interprocess::interprocess_condition::do_timed_wait (this=0xd8ac, tout_enabled=false, abs_time=@0xf0407bc8, mut=@0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_condition.hpp:113 #4 0x0000aa3c in boost::interprocess::interprocess_condition::do_wait (this=0xd8ac, mut=@0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_condition.hpp:70 #5 0x0000ab00 in boost::interprocess::interprocess_condition::wait<boost::interprocess::s coped_lock<boost::interprocess::interprocess_mutex> > (this=0xd8ac, lock=@0xf0407c7c) at ../../../boost/interprocess/sync/ interprocess_condition.hpp:85 #6 0x0000abd4 in boost::interprocess::barrier::wait (this=0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_barrier.hpp:40 #7 0x00003f40 in (anonymous namespace)::barrier_thread () at barrier_test.cpp:41 #8 0x0000ae6c in boost::detail::function::void_function_invoker0<void (*)(), void>::invoke (function_ptr=@0xf0407e00) at ../../../boost/function/ function_template.hpp:104 #9 0x00228e00 in boost::function0<void, std::allocator<boost::function_base> >::operator() (this=0xf0407dfc) at ../../../boost/function/function_template.hpp:693 #10 0x00215a34 in thread_proxy (param=0xbffff24c) at ../../../libs/ thread/src/thread.cpp:126 #11 0x9002bd08 in _pthread_body () Thread 8 (process 2227 thread 0x2403): #0 0x9002c448 in swtch_pri () #1 0x9002c414 in sched_yield () #2 0x00006990 in boost::interprocess::detail::thread_yield () at ../../../boost/interprocess/detail/os_thread_functions.hpp:66 #3 0x0000a810 in boost::interprocess::interprocess_condition::do_timed_wait (this=0xd8ac, tout_enabled=false, abs_time=@0xf0386bc8, mut=@0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_condition.hpp:113 #4 0x0000aa3c in boost::interprocess::interprocess_condition::do_wait (this=0xd8ac, mut=@0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_condition.hpp:70 #5 0x0000ab00 in boost::interprocess::interprocess_condition::wait<boost::interprocess::s coped_lock<boost::interprocess::interprocess_mutex> > (this=0xd8ac, lock=@0xf0386c7c) at ../../../boost/interprocess/sync/ interprocess_condition.hpp:85 #6 0x0000abd4 in boost::interprocess::barrier::wait (this=0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_barrier.hpp:40 #7 0x00003f40 in (anonymous namespace)::barrier_thread () at barrier_test.cpp:41 #8 0x0000ae6c in boost::detail::function::void_function_invoker0<void (*)(), void>::invoke (function_ptr=@0xf0386e00) at ../../../boost/function/ function_template.hpp:104 #9 0x00228e00 in boost::function0<void, std::allocator<boost::function_base> >::operator() (this=0xf0386dfc) at ../../../boost/function/function_template.hpp:693 #10 0x00215a34 in thread_proxy (param=0xbffff24c) at ../../../libs/ thread/src/thread.cpp:126 #11 0x9002bd08 in _pthread_body () Thread 7 (process 2227 thread 0x2303): #0 0x9002c448 in swtch_pri () #1 0x9002c414 in sched_yield () #2 0x00006990 in boost::interprocess::detail::thread_yield () at ../../../boost/interprocess/detail/os_thread_functions.hpp:66 #3 0x0000a810 in boost::interprocess::interprocess_condition::do_timed_wait (this=0xd8ac, tout_enabled=false, abs_time=@0xf0305bc8, mut=@0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_condition.hpp:113 #4 0x0000aa3c in boost::interprocess::interprocess_condition::do_wait (this=0xd8ac, mut=@0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_condition.hpp:70 #5 0x0000ab00 in boost::interprocess::interprocess_condition::wait<boost::interprocess::s coped_lock<boost::interprocess::interprocess_mutex> > (this=0xd8ac, lock=@0xf0305c7c) at ../../../boost/interprocess/sync/ interprocess_condition.hpp:85 #6 0x0000abd4 in boost::interprocess::barrier::wait (this=0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_barrier.hpp:40 #7 0x00003f40 in (anonymous namespace)::barrier_thread () at barrier_test.cpp:41 #8 0x0000ae6c in boost::detail::function::void_function_invoker0<void (*)(), void>::invoke (function_ptr=@0xf0305e00) at ../../../boost/function/ function_template.hpp:104 #9 0x00228e00 in boost::function0<void, std::allocator<boost::function_base> >::operator() (this=0xf0305dfc) at ../../../boost/function/function_template.hpp:693 #10 0x00215a34 in thread_proxy (param=0xbffff24c) at ../../../libs/ thread/src/thread.cpp:126 #11 0x9002bd08 in _pthread_body () Thread 6 (process 2227 thread 0x2203): #0 0x9002c448 in swtch_pri () #1 0x9002c414 in sched_yield () #2 0x00006990 in boost::interprocess::detail::thread_yield () at ../../../boost/interprocess/detail/os_thread_functions.hpp:66 #3 0x0000a810 in boost::interprocess::interprocess_condition::do_timed_wait (this=0xd8ac, tout_enabled=false, abs_time=@0xf0284bc8, mut=@0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_condition.hpp:113 #4 0x0000aa3c in boost::interprocess::interprocess_condition::do_wait (this=0xd8ac, mut=@0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_condition.hpp:70 #5 0x0000ab00 in boost::interprocess::interprocess_condition::wait<boost::interprocess::s coped_lock<boost::interprocess::interprocess_mutex> > (this=0xd8ac, lock=@0xf0284c7c) at ../../../boost/interprocess/sync/ interprocess_condition.hpp:85 #6 0x0000abd4 in boost::interprocess::barrier::wait (this=0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_barrier.hpp:40 #7 0x00003f40 in (anonymous namespace)::barrier_thread () at barrier_test.cpp:41 #8 0x0000ae6c in boost::detail::function::void_function_invoker0<void (*)(), void>::invoke (function_ptr=@0xf0284e00) at ../../../boost/function/ function_template.hpp:104 #9 0x00228e00 in boost::function0<void, std::allocator<boost::function_base> >::operator() (this=0xf0284dfc) at ../../../boost/function/function_template.hpp:693 #10 0x00215a34 in thread_proxy (param=0xbffff24c) at ../../../libs/ thread/src/thread.cpp:126 #11 0x9002bd08 in _pthread_body () Thread 5 (process 2227 thread 0x2103): #0 0x9002c448 in swtch_pri () #1 0x9002c414 in sched_yield () #2 0x00006990 in boost::interprocess::detail::thread_yield () at ../../../boost/interprocess/detail/os_thread_functions.hpp:66 #3 0x0000a810 in boost::interprocess::interprocess_condition::do_timed_wait (this=0xd8ac, tout_enabled=false, abs_time=@0xf0203bc8, mut=@0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_condition.hpp:113 #4 0x0000aa3c in boost::interprocess::interprocess_condition::do_wait (this=0xd8ac, mut=@0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_condition.hpp:70 #5 0x0000ab00 in boost::interprocess::interprocess_condition::wait<boost::interprocess::s coped_lock<boost::interprocess::interprocess_mutex> > (this=0xd8ac, lock=@0xf0203c7c) at ../../../boost/interprocess/sync/ interprocess_condition.hpp:85 #6 0x0000abd4 in boost::interprocess::barrier::wait (this=0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_barrier.hpp:40 #7 0x00003f40 in (anonymous namespace)::barrier_thread () at barrier_test.cpp:41 #8 0x0000ae6c in boost::detail::function::void_function_invoker0<void (*)(), void>::invoke (function_ptr=@0xf0203e00) at ../../../boost/function/ function_template.hpp:104 #9 0x00228e00 in boost::function0<void, std::allocator<boost::function_base> >::operator() (this=0xf0203dfc) at ../../../boost/function/function_template.hpp:693 #10 0x00215a34 in thread_proxy (param=0xbffff24c) at ../../../libs/ thread/src/thread.cpp:126 #11 0x9002bd08 in _pthread_body () Thread 4 (process 2227 thread 0x2003): #0 0x9002c448 in swtch_pri () #1 0x9002c414 in sched_yield () #2 0x00006990 in boost::interprocess::detail::thread_yield () at ../../../boost/interprocess/detail/os_thread_functions.hpp:66 #3 0x0000a810 in boost::interprocess::interprocess_condition::do_timed_wait (this=0xd8ac, tout_enabled=false, abs_time=@0xf0182bc8, mut=@0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_condition.hpp:113 #4 0x0000aa3c in boost::interprocess::interprocess_condition::do_wait (this=0xd8ac, mut=@0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_condition.hpp:70 #5 0x0000ab00 in boost::interprocess::interprocess_condition::wait<boost::interprocess::s coped_lock<boost::interprocess::interprocess_mutex> > (this=0xd8ac, lock=@0xf0182c7c) at ../../../boost/interprocess/sync/ interprocess_condition.hpp:85 #6 0x0000abd4 in boost::interprocess::barrier::wait (this=0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_barrier.hpp:40 #7 0x00003f40 in (anonymous namespace)::barrier_thread () at barrier_test.cpp:41 #8 0x0000ae6c in boost::detail::function::void_function_invoker0<void (*)(), void>::invoke (function_ptr=@0xf0182e00) at ../../../boost/function/ function_template.hpp:104 #9 0x00228e00 in boost::function0<void, std::allocator<boost::function_base> >::operator() (this=0xf0182dfc) at ../../../boost/function/function_template.hpp:693 #10 0x00215a34 in thread_proxy (param=0xbffff24c) at ../../../libs/ thread/src/thread.cpp:126 #11 0x9002bd08 in _pthread_body () Thread 3 (process 2227 thread 0x1f03): #0 0x9002c448 in swtch_pri () #1 0x9002c414 in sched_yield () #2 0x00006990 in boost::interprocess::detail::thread_yield () at ../../../boost/interprocess/detail/os_thread_functions.hpp:66 #3 0x0000a810 in boost::interprocess::interprocess_condition::do_timed_wait (this=0xd8ac, tout_enabled=false, abs_time=@0xf0101bc8, mut=@0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_condition.hpp:113 #4 0x0000aa3c in boost::interprocess::interprocess_condition::do_wait (this=0xd8ac, mut=@0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_condition.hpp:70 #5 0x0000ab00 in boost::interprocess::interprocess_condition::wait<boost::interprocess::s coped_lock<boost::interprocess::interprocess_mutex> > (this=0xd8ac, lock=@0xf0101c7c) at ../../../boost/interprocess/sync/ interprocess_condition.hpp:85 #6 0x0000abd4 in boost::interprocess::barrier::wait (this=0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_barrier.hpp:40 #7 0x00003f40 in (anonymous namespace)::barrier_thread () at barrier_test.cpp:41 #8 0x0000ae6c in boost::detail::function::void_function_invoker0<void (*)(), void>::invoke (function_ptr=@0xf0101e00) at ../../../boost/function/ function_template.hpp:104 #9 0x00228e00 in boost::function0<void, std::allocator<boost::function_base> >::operator() (this=0xf0101dfc) at ../../../boost/function/function_template.hpp:693 #10 0x00215a34 in thread_proxy (param=0xbffff24c) at ../../../libs/ thread/src/thread.cpp:126 #11 0x9002bd08 in _pthread_body () Thread 2 (process 2227 thread 0xc07): #0 0x9002c448 in swtch_pri () #1 0x9002c414 in sched_yield () #2 0x00006990 in boost::interprocess::detail::thread_yield () at ../../../boost/interprocess/detail/os_thread_functions.hpp:66 #3 0x0000a810 in boost::interprocess::interprocess_condition::do_timed_wait (this=0xd8ac, tout_enabled=false, abs_time=@0xf0080bc8, mut=@0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_condition.hpp:113 #4 0x0000aa3c in boost::interprocess::interprocess_condition::do_wait (this=0xd8ac, mut=@0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_condition.hpp:70 #5 0x0000ab00 in boost::interprocess::interprocess_condition::wait<boost::interprocess::s coped_lock<boost::interprocess::interprocess_mutex> > (this=0xd8ac, lock=@0xf0080c7c) at ../../../boost/interprocess/sync/ interprocess_condition.hpp:85 #6 0x0000abd4 in boost::interprocess::barrier::wait (this=0xd8a8) at ../../../boost/interprocess/sync/emulation/ interprocess_barrier.hpp:40 #7 0x00003f40 in (anonymous namespace)::barrier_thread () at barrier_test.cpp:41 #8 0x0000ae6c in boost::detail::function::void_function_invoker0<void (*)(), void>::invoke (function_ptr=@0xf0080e00) at ../../../boost/function/ function_template.hpp:104 #9 0x00228e00 in boost::function0<void, std::allocator<boost::function_base> >::operator() (this=0xf0080dfc) at ../../../boost/function/function_template.hpp:693 #10 0x00215a34 in thread_proxy (param=0xbffff24c) at ../../../libs/ thread/src/thread.cpp:126 #11 0x9002bd08 in _pthread_body () Thread 1 (process 2227 thread 0xd03): #0 0x9002c4b8 in semaphore_wait_trap () #1 0x9005f388 in pthread_join () #2 0x00215804 in boost::thread::join (this=0x500330) at ../../../ libs/thread/src/thread.cpp:241 #3 0x00215960 in boost::thread_group::join_all (this=0xbffff380) at ../../../libs/thread/src/thread.cpp:377 #4 0x000040cc in main () at barrier_test.cpp:63

Doug Gregor wrote:
The problem only seems to occur on PowerPC Mac, because the test is running fine on my Intel Mac. There's a gdb dump of the backtraces for all running threads below.
Removed from SVN. The main problem is that Mac does not have process-shared barrier/mutexes/condition variables and an emulation using spinlocks is used. Since my knowledge about atomic operations is *zero* my implementation of interprocess_condition might be wrong or just the atomic operations I'm using are not correctly implemented. I guess I should ask Boost thread-experts (Boost.Thread maintainers willing to help?) to write these synchronization primitives for me or/and beg for a simple atomic operation package in Boost. At least some that implement increment, cas, decrement, atomic read and read (full barrier semantics are enough for me, I just don't understand what acquire and release are ;-) ). The implementation of the emulated barrier is pretty simple: inline barrier::barrier(unsigned int count) : m_threshold(count), m_count(count), m_generation(0) { if (count == 0) throw std::invalid_argument("count cannot be zero."); } inline bool barrier::wait() { scoped_lock<interprocess_mutex> lock(m_mutex); unsigned int gen = m_generation; if (--m_count == 0){ m_generation++; m_count = m_threshold; m_cond.notify_all(); return true; } while (gen == m_generation){ m_cond.wait(lock); } return false; } so I guess there is problem with my emulated condition implementation or with atomic operations (which are taken from apache run-time library). Regards, Ion
participants (3)
-
Doug Gregor
-
Ion Gaztañaga
-
Rene Rivera