Closed Naviabheeman closed 1 year ago
In src/wallet/walletdb.cpp
,
catch (const boost::thread_interrupted&) {
still remain.
In configure.ac
boost::this_thread::sleep(boost::posix_time::milliseconds(0));
boost::this_thread::sleep_for(boost::chrono::milliseconds(0));
CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB"
still remain.
build-aux/m4/ax_boost_thread.m4
and build-aux/m4/ax_boost_chrono.m4
still need?
In depends/packages/boost.mk
still remain boost and chrono.
$(package)_config_libraries=chrono,filesystem,system,thread,test
This PR contains only c++ files. All build related changes are in PR#270.
configure.ac
build-aux/m4/ax_boost_thread.m4
and build-aux/m4/ax_boost_chrono.m4
depends/packages/boost.mk
All these are updated in #270 This seems to causing failures in the CI
/bin/bash: line 1: 25441 Aborted (core dumped) test/test_tapyrus -l test_suite -t "`cat test/checkqueue_tests.cpp
Please do not merge yet. Let me investigate.
I'm seeing that master/control thread of CCheckQueue
and CCheckQueueControl
hangs, waiting for the worker threads to signal. But the worker threads are also waiting for work. This could be because of the implementation of lock and condition variable. It should be tested further. the
tapyrusd, bench_tapyrus and test_tapyrus all hang because of this
Master call stack
(gdb) bt
#0 0x00007ff5dc1b9ad3 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 0x00007ff5dab9c8bc in std::condition_variable::wait(std::unique_lock<std::mutex>&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#2 0x0000555f03154342 in CCheckQueue<checkqueue_tests::FakeCheckCheckCompletion>::Loop (this=this@entry=0x555f058f05f0, fMaster=fMaster@entry=true) at ./checkqueue.h:100
#3 0x0000555f0314c1c1 in CCheckQueue<checkqueue_tests::FakeCheckCheckCompletion>::Wait (this=<optimized out>) at ./checkqueue.h:163
#4 CCheckQueueControl<checkqueue_tests::FakeCheckCheckCompletion>::Wait (this=<synthetic pointer>) at ./checkqueue.h:224
#5 checkqueue_tests::Correct_Queue_range (range=std::vector of length 1, capacity 1 = {...}) at test/checkqueue_tests.cpp:166
#6 0x0000555f0314ca28 in checkqueue_tests::test_CheckQueue_Correct_Zero::test_method (this=this@entry=0x7ffe26214a50) at test/checkqueue_tests.cpp:180
#7 0x0000555f0314cd33 in checkqueue_tests::test_CheckQueue_Correct_Zero_invoker () at test/checkqueue_tests.cpp:176
#8 0x00007ff5db8e82ce in boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) ()
from /usr/lib/x86_64-linux-gnu/libboost_unit_test_framework.so.1.65.1
Worker call stack
(gdb) bt
#0 0x00007ff5dc1b9ad3 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 0x00007ff5dab9c8bc in std::condition_variable::wait(std::unique_lock<std::mutex>&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#2 0x0000555f0341e382 in CCheckQueue<CScriptCheck>::Loop (this=<optimized out>, fMaster=fMaster@entry=false) at ./checkqueue.h:100
#3 0x0000555f0341e9e4 in CCheckQueue<CScriptCheck>::CCheckQueue(unsigned int, int)::{lambda()#1}::operator()() const (__closure=<optimized out>) at ./checkqueue.h:148
#4 std::__invoke_impl<void, CCheckQueue<CScriptCheck>::CCheckQueue(unsigned int, int)::{lambda()#1}>(std::__invoke_other, CCheckQueue<CScriptCheck>::CCheckQueue(unsigned int, int)::{lambda()#1}&&) (__f=...) at /usr/include/c++/7/bits/invoke.h:60
#5 std::__invoke<CCheckQueue<CScriptCheck>::CCheckQueue(unsigned int, int)::{lambda()#1}>(std::__invoke_result&&, (CCheckQueue<CScriptCheck>::CCheckQueue(unsigned int, int)::{lambda()#1}&&)...) (__fn=...) at /usr/include/c++/7/bits/invoke.h:95
#6 std::thread::_Invoker<std::tuple<CCheckQueue<CScriptCheck>::CCheckQueue(unsigned int, int)::{lambda()#1}> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) (
this=<optimized out>) at /usr/include/c++/7/thread:234
Thread deadlock is resolved by today's changes.
change boost::threads to std::threads
some changes made by bitcoin are ported to tapyrus 18264 - remove boost::chrono
18710 - local thread pool to CCheckQueue
21016 - remove boost::thread_group usage