nanocurrency / nano-node

Nano is digital currency. Its ticker is: XNO and its currency symbol is: Ӿ
https://nano.org
BSD 3-Clause "New" or "Revised" License
3.48k stars 786 forks source link

core_test confirmation_height.gap_live can hang (happens rarely on my computer) #3261

Open dsiganos opened 3 years ago

dsiganos commented 3 years ago

Both Sergei and I have seen confirmation_height.gap_live test hang. Here is a backtrace for it when it is hang.

(gdb) bt
#0  __pthread_clockjoin_ex (threadid=140315954259712, thread_return=0x0, clockid=<optimised out>, 
    abstime=<optimised out>, block=<optimised out>) at pthread_join_common.c:145
#1  0x0000558921410715 in boost::asio::detail::posix_thread::join (this=0x558923913c00)
    at /fast/stopbug/boost_1_70_0/boost/asio/detail/impl/posix_thread.ipp:42
#2  0x000055892141096e in boost::asio::detail::thread_group::join (this=0x558923970ee0)
    at /fast/stopbug/boost_1_70_0/boost/asio/detail/thread_group.hpp:61
#3  0x000055892217d791 in boost::asio::thread_pool::join (this=0x558923970ed0)
    at /fast/stopbug/boost_1_70_0/boost/asio/impl/thread_pool.ipp:73
#4  0x00005589221795c5 in nano::thread_pool::stop (this=0x5589238c2ae0)
    at /fast/stopbug/nano-node/nano/lib/threading.cpp:225
#5  0x0000558921da0aee in nano::node::stop (this=0x5589238c1d50)
    at /fast/stopbug/nano-node/nano/node/node.cpp:695
#6  0x0000558921e97338 in nano::system::~system (this=0x7ffee4bbf920, __in_chrg=<optimised out>)
    at /fast/stopbug/nano-node/nano/node/testing.cpp:129
#7  0x00005589215bedf0 in confirmation_height_gap_live_Test::<lambda(nano::confirmation_height_mode)>::operator()(nano::confirmation_height_mode) const (__closure=0x7ffee4bc02c7, 
    mode_a=nano::confirmation_height_mode::bounded)
    at /fast/stopbug/nano-node/nano/core_test/confirmation_height.cpp:377
#8  0x00005589215bf742 in confirmation_height_gap_live_Test::TestBody (this=0x55892390a0c0)
    at /fast/stopbug/nano-node/nano/core_test/confirmation_height.cpp:380
#9  0x000055892205b2a9 in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void> (object=0x55892390a0c0, method=&virtual testing::Test::TestBody(), 
    location=0x558922bd806b "the test body")
    at /fast/stopbug/nano-node/gtest/googletest/src/gtest.cc:2443
#10 0x00005589220552f1 in testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void> (object=0x55892390a0c0, method=&virtual testing::Test::TestBody(), 
--Type <RET> for more, q to quit, c to continue without paging--
     body")
    at /fast/stopbug/nano-node/gtest/googletest/src/gtest.cc:2479
#11 0x0000558922033180 in testing::Test::Run (this=0x55892390a0c0)
    at /fast/stopbug/nano-node/gtest/googletest/src/gtest.cc:2517
#12 0x0000558922033b3d in testing::TestInfo::Run (this=0x55892382a9a0)
    at /fast/stopbug/nano-node/gtest/googletest/src/gtest.cc:2693
#13 0x000055892203421d in testing::TestCase::Run (this=0x55892382a4b0)
    at /fast/stopbug/nano-node/gtest/googletest/src/gtest.cc:2811
#14 0x000055892203f73d in testing::internal::UnitTestImpl::RunAllTests (this=0x558923816610)
    at /fast/stopbug/nano-node/gtest/googletest/src/gtest.cc:5177
#15 0x000055892205c1d3 in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (object=0x558923816610, 
    method=(bool (testing::internal::UnitTestImpl::*)(class testing::internal::UnitTestImpl * const)) 0x55892203f482 <testing::internal::UnitTestImpl::RunAllTests()>, 
    location=0x558922bd8a48 "auxiliary test code (environments or event listeners)")
    at /fast/stopbug/nano-node/gtest/googletest/src/gtest.cc:2443
#16 0x000055892205620d in testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (object=0x558923816610, 
    method=(bool (testing::internal::UnitTestImpl::*)(class testing::internal::UnitTestImpl * const)) 0x55892203f482 <testing::internal::UnitTestImpl::RunAllTests()>, 
    location=0x558922bd8a48 "auxiliary test code (environments or event listeners)")
    at /fast/stopbug/nano-node/gtest/googletest/src/gtest.cc:2479
#17 0x000055892203e0e5 in testing::UnitTest::Run (
    this=0x5589235183e0 <testing::UnitTest::GetInstance()::instance>)
    at /fast/stopbug/nano-node/gtest/googletest/src/gtest.cc:4786
#18 0x000055892140e87e in RUN_ALL_TESTS ()
    at /fast/stopbug/nano-node/gtest/googletest/include/gtest/gtest.h:2341
#19 0x000055892140e3db in main (argc=1, argv=0x7ffee4bc0868)
    at /fast/stopbug/nano-node/nano/core_test/core_test_main.cc:24
dsiganos commented 3 years ago

This hang might be related to the stop bug since they both hang on node stop: https://github.com/nanocurrency/nano-node/issues/3191