In release mode, this test crashes. In debug mode, it deadlocks. I have attached the call stacks of both.
./test-hdr
libcds version 2.1.0
Test started 2015-May-12 20:58:34
Using test config file: test.conf
System topology:
Logical processor count: 8
Use in-place scan strategy for Hazard Pointer memory reclamation algorithm
Hazard Pointer count: 72
Max thread count for HP: 100
Retired HP array capacity: 1600
TestIntrusiveStack::Elimination_DHP_member_disposer_relaxed
thread_init_fini::init_fini
Thread init/fini test,
thread count=8 pass count=100000...
Duration=1.13611Segmentation fault (core dumped)
Core was generated by `./test-hdr'.
Program terminated with signal 11, Segmentation fault.
#0 0x00007f4d245f57e0 in boost::detail::thread_data_base::~thread_data_base() () from /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.53.0
(gdb) where
#0 0x00007f4d245f57e0 in boost::detail::thread_data_base::~thread_data_base() () from /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.53.0
#1 0x000000000991fa69 in boost::detail::thread_data<boost::_bi::bind_t<void, void (*)(CppUnitMini::TestThread*), boost::_bi::list1<boost::_bi::value<CppUnitMini::TestThread*> > > >::~thread_data() ()
#2 0x00007f4d245f778e in boost::detail::sp_counted_base::release() () from /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.53.0
#3 0x00000000079ec7dc in boost::thread::~thread() ()
#4 0x00000000079ebf5f in thread_init_fini::Thread::~Thread() ()
#5 0x000000000991ed42 in CppUnitMini::ThreadPool::~ThreadPool() ()
#6 0x00000000079ebd61 in thread_init_fini::init_fini() ()
#7 0x00000000079eb772 in thread_init_fini::myRun(char const*, bool) ()
#8 0x000000000990b228 in CppUnitMini::TestCase::run(CppUnitMini::Reporter*, char const*, bool) ()
#9 0x000000000990d0a9 in main ()
(gdb) thread apply all backtrace
Thread 3 (Thread 0x7f4d228ec700 (LWP 7728)):
#0 pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1 0x00007f4d23f4ebc6 in std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) () from /usr/lib/x86_64-linux-gnu/libc++.so.1
#2 0x000000000990eb4b in cds::urcu::dispose_thread<cds::container::VyukovMPMCCycleQueue<cds::urcu::epoch_retired_ptr, cds::container::vyukov_queue::traits> >::execute() ()
#3 0x000000000990ea9e in void* std::__1::__thread_proxy<std::__1::tuple<void (*)(cds::urcu::dispose_thread<cds::container::VyukovMPMCCycleQueue<cds::urcu::epoch_retired_ptr, cds::container::vyukov_queue::traits> >*), cds::urcu::dispose_thread<cds::container::VyukovMPMCCycleQueue<cds::urcu::epoch_retired_ptr, cds::container::vyukov_queue::traits> >*> >(void*) ()
#4 0x00007f4d241cff6e in start_thread (arg=0x7f4d228ec700) at pthread_create.c:311
#5 0x00007f4d236f49cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113
Thread 2 (Thread 0x7f4d230ed700 (LWP 7727)):
#0 pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1 0x00007f4d23f4ebc6 in std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) () from /usr/lib/x86_64-linux-gnu/libc++.so.1
#2 0x000000000990eb4b in cds::urcu::dispose_thread<cds::container::VyukovMPMCCycleQueue<cds::urcu::epoch_retired_ptr, cds::container::vyukov_queue::traits> >::execute() ()
#3 0x000000000990ea9e in void* std::__1::__thread_proxy<std::__1::tuple<void (*)(cds::urcu::dispose_thread<cds::container::VyukovMPMCCycleQueue<cds::urcu::epoch_retired_ptr, cds::container::vyukov_queue::traits> >*), cds::urcu::dispose_thread<cds::container::VyukovMPMCCycleQueue<cds::urcu::epoch_retired_ptr, cds::container::vyukov_queue::traits> >*> >(void*) ()
#4 0x00007f4d241cff6e in start_thread (arg=0x7f4d230ed700) at pthread_create.c:311
#5 0x00007f4d236f49cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113
Thread 1 (Thread 0x7f4d24bf5840 (LWP 7726)):
#0 0x00007f4d245f57e0 in boost::detail::thread_data_base::~thread_data_base() () from /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.53.0
#1 0x000000000991fa69 in boost::detail::thread_data<boost::_bi::bind_t<void, void (*)(CppUnitMini::TestThread*), boost::_bi::list1<boost::_bi::value<CppUnitMini::TestThread*> > > >::~thread_data() ()
#2 0x00007f4d245f778e in boost::detail::sp_counted_base::release() () from /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.53.0
#3 0x00000000079ec7dc in boost::thread::~thread() ()
#4 0x00000000079ebf5f in thread_init_fini::Thread::~Thread() ()
#5 0x000000000991ed42 in CppUnitMini::ThreadPool::~ThreadPool() ()
#6 0x00000000079ebd61 in thread_init_fini::init_fini() ()
#7 0x00000000079eb772 in thread_init_fini::myRun(char const*, bool) ()
#8 0x000000000990b228 in CppUnitMini::TestCase::run(CppUnitMini::Reporter*, char const*, bool) ()
#9 0x000000000990d0a9 in main ()
DEBUG.
clang 3.5 DEBUG build. -stdlib=libc++
bin โฏ ./test-hdr
libcds version 2.1.0
Test started 2015-May-12 05:33:55
Using test config file: test-debug.conf
System topology:
Logical processor count: 8
Use in-place scan strategy for Hazard Pointer memory reclamation algorithm
Hazard Pointer count: 72
Max thread count for HP: 100
Retired HP array capacity: 1600
TestIntrusiveStack::Elimination_DHP_member_disposer_relaxed
thread_init_fini::init_fini
Thread init/fini test,
thread count=4 pass count=100000...
(gdb) info threads
Id Target Id Frame
6 Thread 0x7f43aa373700 (LWP 4014) "test-hdr" pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
5 Thread 0x7f43a9b72700 (LWP 4015) "test-hdr" pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
4 Thread 0x7f43a9371700 (LWP 4016) "test-hdr" pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
3 Thread 0x7f43a3fff700 (LWP 4018) "test-hdr" pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
2 Thread 0x7f43a37fe700 (LWP 4019) "test-hdr" pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
* 1 Thread 0x7f43abe97840 (LWP 4013) "test-hdr" pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
(gdb) thread apply all backtrace
Thread 6 (Thread 0x7f43aa373700 (LWP 4014)):
#0 pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1 0x00007f43ab1d4bc6 in std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) () from /usr/lib/x86_64-linux-gnu/libc++.so.1
#2 0x0000000017d71e8a in cds::urcu::dispose_thread<cds::container::VyukovMPMCCycleQueue<cds::urcu::epoch_retired_ptr, cds::container::vyukov_queue::traits> >::execute (this=0x3173ebd8)
at /home/khegeman/dev/libcds/cds/urcu/dispose_thread.h:85
#3 0x0000000017d71475 in cds::urcu::dispose_thread<cds::container::VyukovMPMCCycleQueue<cds::urcu::epoch_retired_ptr, cds::container::vyukov_queue::traits> >::dispose_thread_starter::thread_func (pThis=0x3173ebd8)
at /home/khegeman/dev/libcds/cds/urcu/dispose_thread.h:38
#4 0x0000000017d71b25 in __invoke<void (*)(cds::urcu::dispose_thread<cds::container::VyukovMPMCCycleQueue<cds::urcu::epoch_retired_ptr, cds::container::vyukov_queue::traits> >*), cds::urcu::dispose_thread<cds::container::VyukovMPMCCycleQueue<cds::urcu::epoch_retired_ptr, cds::container::vyukov_queue::traits> >*> (__f=<unknown type in /home/khegeman/build/libcds_clangdebuglibc/bin/test-hdr, CU 0x87b9d58, DIE 0x87dddcc>,
__args=<unknown type in /home/khegeman/build/libcds_clangdebuglibc/bin/test-hdr, CU 0x87b9d58, DIE 0x87dddd4>) at /usr/include/c++/v1/__functional_base:413
#5 __thread_execute<void (*)(cds::urcu::dispose_thread<cds::container::VyukovMPMCCycleQueue<cds::urcu::epoch_retired_ptr, cds::container::vyukov_queue::traits> >*), cds::urcu::dispose_thread<cds::container::VyukovMPMCCycleQueue<cds::urcu::epoch_retired_ptr, cds::container::vyukov_queue::traits> >*, 1> (__t=...) at /usr/include/c++/v1/thread:332
#6 std::__1::__thread_proxy<std::__1::tuple<void (*)(cds::urcu::dispose_thread<cds::container::VyukovMPMCCycleQueue<cds::urcu::epoch_retired_ptr, cds::container::vyukov_queue::traits> >*), cds::urcu::dispose_thread<cds::container::VyukovMPMCCycleQueue<cds::urcu::epoch_retired_ptr, cds::container::vyukov_queue::traits> >*> > (__vp=0x3173d5e0) at /usr/include/c++/v1/thread:342
#7 0x00007f43ab455f6e in start_thread (arg=0x7f43aa373700) at pthread_create.c:311
#8 0x00007f43aa97a9cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113
Thread 5 (Thread 0x7f43a9b72700 (LWP 4015)):
#0 pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1 0x00007f43ab1d4bc6 in std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) () from /usr/lib/x86_64-linux-gnu/libc++.so.1
#2 0x0000000017d71e8a in cds::urcu::dispose_thread<cds::container::VyukovMPMCCycleQueue<cds::urcu::epoch_retired_ptr, cds::container::vyukov_queue::traits> >::execute (this=0x3173f078)
at /home/khegeman/dev/libcds/cds/urcu/dispose_thread.h:85
#3 0x0000000017d71475 in cds::urcu::dispose_thread<cds::container::VyukovMPMCCycleQueue<cds::urcu::epoch_retired_ptr, cds::container::vyukov_queue::traits> >::dispose_thread_starter::thread_func (pThis=0x3173f078)
at /home/khegeman/dev/libcds/cds/urcu/dispose_thread.h:38
#4 0x0000000017d71b25 in __invoke<void (*)(cds::urcu::dispose_thread<cds::container::VyukovMPMCCycleQueue<cds::urcu::epoch_retired_ptr, cds::container::vyukov_queue::traits> >*), cds::urcu::dispose_thread<cds::container::VyukovMPMCCycleQueue<cds::urcu::epoch_retired_ptr, cds::container::vyukov_queue::traits> >*> (__f=<unknown type in /home/khegeman/build/libcds_clangdebuglibc/bin/test-hdr, CU 0x87b9d58, DIE 0x87dddcc>,
__args=<unknown type in /home/khegeman/build/libcds_clangdebuglibc/bin/test-hdr, CU 0x87b9d58, DIE 0x87dddd4>) at /usr/include/c++/v1/__functional_base:413
#5 __thread_execute<void (*)(cds::urcu::dispose_thread<cds::container::VyukovMPMCCycleQueue<cds::urcu::epoch_retired_ptr, cds::container::vyukov_queue::traits> >*), cds::urcu::dispose_thread<cds::container::VyukovMPMCCycleQueue<cds::urcu::epoch_retired_ptr, cds::container::vyukov_queue::traits> >*, 1> (__t=...) at /usr/include/c++/v1/thread:332
#6 std::__1::__thread_proxy<std::__1::tuple<void (*)(cds::urcu::dispose_thread<cds::container::VyukovMPMCCycleQueue<cds::urcu::epoch_retired_ptr, cds::container::vyukov_queue::traits> >*), cds::urcu::dispose_thread<cds::container::VyukovMPMCCycleQueue<cds::urcu::epoch_retired_ptr, cds::container::vyukov_queue::traits> >*> > (__vp=0x3173f150) at /usr/include/c++/v1/thread:342
#7 0x00007f43ab455f6e in start_thread (arg=0x7f43a9b72700) at pthread_create.c:311
#8 0x00007f43aa97a9cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113
Thread 4 (Thread 0x7f43a9371700 (LWP 4016)):
#0 pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1 0x0000000017da9ce0 in boost::condition_variable::wait (this=0x31780ff8, m=...) at /usr/include/boost/thread/pthread/condition_variable.hpp:73
#2 0x0000000017da634a in boost::barrier::wait (this=0x31780fd0) at /usr/include/boost/thread/barrier.hpp:233
#3 0x0000000017da4b60 in CppUnitMini::ThreadPool::onThreadFiniDone (this=0x7ffff4bc89f0) at /home/khegeman/dev/libcds/tests/cppunit/thread.cpp:127
#4 0x0000000017da4995 in CppUnitMini::TestThread::run (this=0x3177e410) at /home/khegeman/dev/libcds/tests/cppunit/thread.cpp:29
#5 0x0000000017da4905 in CppUnitMini::TestThread::threadEntryPoint (pInst=0x3177e410) at /home/khegeman/dev/libcds/tests/cppunit/thread.cpp:11
#6 0x0000000017da9845 in boost::_bi::list1<boost::_bi::value<CppUnitMini::TestThread*> >::operator()<void (*)(CppUnitMini::TestThread*), boost::_bi::list0> (this=0x317819d8,
f=@0x317819d0: 0x17da48f0 <CppUnitMini::TestThread::threadEntryPoint(CppUnitMini::TestThread*)>, a=...) at /usr/include/boost/bind/bind.hpp:253
#7 0x0000000017da97cf in boost::_bi::bind_t<void, void (*)(CppUnitMini::TestThread*), boost::_bi::list1<boost::_bi::value<CppUnitMini::TestThread*> > >::operator() (this=0x317819d0)
at /usr/include/boost/bind/bind_template.hpp:20
#8 0x0000000017da85cc in boost::detail::thread_data<boost::_bi::bind_t<void, void (*)(CppUnitMini::TestThread*), boost::_bi::list1<boost::_bi::value<CppUnitMini::TestThread*> > > >::run (this=0x31781830)
at /usr/include/boost/thread/detail/thread.hpp:116
#9 0x00007f43ab87a94a in ?? () from /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.53.0
#10 0x00007f43ab455f6e in start_thread (arg=0x7f43a9371700) at pthread_create.c:311
#11 0x00007f43aa97a9cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113
Thread 3 (Thread 0x7f43a3fff700 (LWP 4018)):
#0 pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1 0x0000000017da9ce0 in boost::condition_variable::wait (this=0x31780ff8, m=...) at /usr/include/boost/thread/pthread/condition_variable.hpp:73
#2 0x0000000017da634a in boost::barrier::wait (this=0x31780fd0) at /usr/include/boost/thread/barrier.hpp:233
#3 0x0000000017da4b60 in CppUnitMini::ThreadPool::onThreadFiniDone (this=0x7ffff4bc89f0) at /home/khegeman/dev/libcds/tests/cppunit/thread.cpp:127
#4 0x0000000017da4995 in CppUnitMini::TestThread::run (this=0x3177af20) at /home/khegeman/dev/libcds/tests/cppunit/thread.cpp:29
#5 0x0000000017da4905 in CppUnitMini::TestThread::threadEntryPoint (pInst=0x3177af20) at /home/khegeman/dev/libcds/tests/cppunit/thread.cpp:11
#6 0x0000000017da9845 in boost::_bi::list1<boost::_bi::value<CppUnitMini::TestThread*> >::operator()<void (*)(CppUnitMini::TestThread*), boost::_bi::list0> (this=0x31783318,
f=@0x31783310: 0x17da48f0 <CppUnitMini::TestThread::threadEntryPoint(CppUnitMini::TestThread*)>, a=...) at /usr/include/boost/bind/bind.hpp:253
#7 0x0000000017da97cf in boost::_bi::bind_t<void, void (*)(CppUnitMini::TestThread*), boost::_bi::list1<boost::_bi::value<CppUnitMini::TestThread*> > >::operator() (this=0x31783310)
at /usr/include/boost/bind/bind_template.hpp:20
#8 0x0000000017da85cc in boost::detail::thread_data<boost::_bi::bind_t<void, void (*)(CppUnitMini::TestThread*), boost::_bi::list1<boost::_bi::value<CppUnitMini::TestThread*> > > >::run (this=0x31783170)
at /usr/include/boost/thread/detail/thread.hpp:116
#9 0x00007f43ab87a94a in ?? () from /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.53.0
#10 0x00007f43ab455f6e in start_thread (arg=0x7f43a3fff700) at pthread_create.c:311
#11 0x00007f43aa97a9cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113
Thread 2 (Thread 0x7f43a37fe700 (LWP 4019)):
#0 pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1 0x0000000017da9ce0 in boost::condition_variable::wait (this=0x31780ff8, m=...) at /usr/include/boost/thread/pthread/condition_variable.hpp:73
#2 0x0000000017da634a in boost::barrier::wait (this=0x31780fd0) at /usr/include/boost/thread/barrier.hpp:233
#3 0x0000000017da4b60 in CppUnitMini::ThreadPool::onThreadFiniDone (this=0x7ffff4bc89f0) at /home/khegeman/dev/libcds/tests/cppunit/thread.cpp:127
#4 0x0000000017da4995 in CppUnitMini::TestThread::run (this=0x31781d20) at /home/khegeman/dev/libcds/tests/cppunit/thread.cpp:29
#5 0x0000000017da4905 in CppUnitMini::TestThread::threadEntryPoint (pInst=0x31781d20) at /home/khegeman/dev/libcds/tests/cppunit/thread.cpp:11
#6 0x0000000017da9845 in boost::_bi::list1<boost::_bi::value<CppUnitMini::TestThread*> >::operator()<void (*)(CppUnitMini::TestThread*), boost::_bi::list0> (this=0x31769db8,
f=@0x31769db0: 0x17da48f0 <CppUnitMini::TestThread::threadEntryPoint(CppUnitMini::TestThread*)>, a=...) at /usr/include/boost/bind/bind.hpp:253
#7 0x0000000017da97cf in boost::_bi::bind_t<void, void (*)(CppUnitMini::TestThread*), boost::_bi::list1<boost::_bi::value<CppUnitMini::TestThread*> > >::operator() (this=0x31769db0)
at /usr/include/boost/bind/bind_template.hpp:20
#8 0x0000000017da85cc in boost::detail::thread_data<boost::_bi::bind_t<void, void (*)(CppUnitMini::TestThread*), boost::_bi::list1<boost::_bi::value<CppUnitMini::TestThread*> > > >::run (this=0x31769c10)
at /usr/include/boost/thread/detail/thread.hpp:116
#9 0x00007f43ab87a94a in ?? () from /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.53.0
#10 0x00007f43ab455f6e in start_thread (arg=0x7f43a37fe700) at pthread_create.c:311
#11 0x00007f43aa97a9cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113
Thread 1 (Thread 0x7f43abe97840 (LWP 4013)):
#0 pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1 0x0000000017da9ce0 in boost::condition_variable::wait (this=0x31780ff8, m=...) at /usr/include/boost/thread/pthread/condition_variable.hpp:73
#2 0x0000000017da634a in boost::barrier::wait (this=0x31780fd0) at /usr/include/boost/thread/barrier.hpp:233
#3 0x0000000017da5310 in CppUnitMini::ThreadPool::run (this=0x7ffff4bc89f0) at /home/khegeman/dev/libcds/tests/cppunit/thread.cpp:82
#4 0x0000000014ef2261 in thread_init_fini::init_fini (this=0x3154e338 <_ZL5local>) at /home/khegeman/dev/libcds/tests/test-hdr/misc/thread_init_fini.cpp:62
#5 0x0000000014ef190a in thread_init_fini::myRun (this=0x3154e338 <_ZL5local>, in_name=0x181b8f10 "", invert=false) at /home/khegeman/dev/libcds/tests/test-hdr/misc/thread_init_fini.cpp:73
#6 0x0000000017d68c99 in CppUnitMini::TestCase::run (in_reporter=0x3173d600, in_testName=0x181b8f10 "", invert=false) at /home/khegeman/dev/libcds/tests/cppunit/test_main.cpp:111
#7 0x0000000017d6b9d1 in main (argc=1, argv=0x7ffff4bc97e8) at /home/khegeman/dev/libcds/tests/cppunit/test_main.cpp:447