Skip to content

Instantly share code, notes, and snippets.

@wezrule
Created June 5, 2019 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wezrule/409a4ad962e36f18c4f6c446232f2803 to your computer and use it in GitHub Desktop.
Save wezrule/409a4ad962e36f18c4f6c446232f2803 to your computer and use it in GitHub Desktop.
==================
WARNING: ThreadSanitizer: heap-use-after-free (pid=24592)
Read of size 8 at 0x7b18000162c0 by thread T13 (mutexes: write M907):
#0 std::__detail::_Hash_node<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, true>::_M_next() const /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/hashtable_policy.h:270:47 (core_test+0x1069a22)
#1 std::__detail::_Node_iterator_base<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, true>::_M_incr() /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/hashtable_policy.h:299:26 (core_test+0x1074fde)
#2 std::__detail::_Node_iterator<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, false, true>::operator++() /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/hashtable_policy.h:354:8 (core_test+0x1066782)
#3 nano::work_watcher::run() /root/nano-node/nano/node/wallet.cpp:1442:17 (core_test+0x10575d1)
#4 nano::work_watcher::work_watcher(nano::node&)::$_12::operator()() const /root/nano-node/nano/node/wallet.cpp:1380:2 (core_test+0x1063381)
#5 void std::__invoke_impl<void, nano::work_watcher::work_watcher(nano::node&)::$_12>(std::__invoke_other, nano::work_watcher::work_watcher(nano::node&)::$_12&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/invoke.h:60:14 (core_test+0x1063300)
#6 std::__invoke_result<nano::work_watcher::work_watcher(nano::node&)::$_12>::type std::__invoke<nano::work_watcher::work_watcher(nano::node&)::$_12>(nano::work_watcher::work_watcher(nano::node&)::$_12&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/invoke.h:95:14 (core_test+0x1063210)
#7 void std::thread::_Invoker<std::tuple<nano::work_watcher::work_watcher(nano::node&)::$_12> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/thread:244:13 (core_test+0x10631b8)
#8 std::thread::_Invoker<std::tuple<nano::work_watcher::work_watcher(nano::node&)::$_12> >::operator()() /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/thread:251:11 (core_test+0x1063158)
#9 std::thread::_State_impl<std::thread::_Invoker<std::tuple<nano::work_watcher::work_watcher(nano::node&)::$_12> > >::_M_run() /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/thread:195:13 (core_test+0x1062f3c)
#10 execute_native_thread_routine <null> (core_test+0x15d673f)
Previous write of size 8 at 0x7b18000162c0 by main thread (mutexes: write M907):
#0 operator delete(void*) <null> (core_test+0x50957d)
#1 __gnu_cxx::new_allocator<std::__detail::_Hash_node<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, true> >::deallocate(std::__detail::_Hash_node<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, true>*, unsigned long) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/ext/new_allocator.h:128:2 (core_test+0x1069ed0)
#2 std::allocator_traits<std::allocator<std::__detail::_Hash_node<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, true> > >::deallocate(std::allocator<std::__detail::_Hash_node<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, true> >&, std::__detail::_Hash_node<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, true>*, unsigned long) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/alloc_traits.h:470:13 (core_test+0x1069df8)
#3 std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, true> > >::_M_deallocate_node_ptr(std::__detail::_Hash_node<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, true>*) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/hashtable_policy.h:2102:7 (core_test+0x1069c07)
#4 std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, true> > >::_M_deallocate_node(std::__detail::_Hash_node<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, true>*) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/hashtable_policy.h:2092:7 (core_test+0x1069aa3)
#5 std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, true> > >::_M_deallocate_nodes(std::__detail::_Hash_node<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, true>*) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/hashtable_policy.h:2113:4 (core_test+0x1069960)
#6 std::_Hashtable<nano::uint512_union, std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, std::allocator<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> > >, std::__detail::_Select1st, std::equal_to<nano::uint512_union>, std::hash<nano::uint512_union>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::clear() /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/hashtable.h:2034:13 (core_test+0x1069799)
#7 std::unordered_map<nano::uint512_union, std::shared_ptr<nano::state_block>, std::hash<nano::uint512_union>, std::equal_to<nano::uint512_union>, std::allocator<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> > > >::clear() /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/unordered_map.h:843:14 (core_test+0x1066518)
#8 nano::work_watcher::stop() /root/nano-node/nano/node/wallet.cpp:1392:9 (core_test+0x105660c)
#9 nano::wallets::stop() /root/nano-node/nano/node/wallet.cpp:1773:10 (core_test+0x1059583)
#10 nano::node::stop() /root/nano-node/nano/node/node.cpp:828:11 (core_test+0xe9b3a8)
#11 nano::system::~system() /root/nano-node/nano/node/testing.cpp:126:6 (core_test+0xf8b16a)
#12 wallet_send_race_Test::TestBody() /root/nano-node/nano/core_test/wallet.cpp:890:1 (core_test+0xa6f6e5)
#13 void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /root/nano-node/gtest/googletest/src/gtest.cc:2443:10 (core_test+0x11a7f66)
#14 void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /root/nano-node/gtest/googletest/src/gtest.cc:2479:14 (core_test+0x1183dce)
#15 testing::Test::Run() /root/nano-node/gtest/googletest/src/gtest.cc:2517:5 (core_test+0x1156f2e)
#16 testing::TestInfo::Run() /root/nano-node/gtest/googletest/src/gtest.cc:2693:11 (core_test+0x1158196)
#17 testing::TestCase::Run() /root/nano-node/gtest/googletest/src/gtest.cc:2811:28 (core_test+0x1158bd7)
#18 testing::internal::UnitTestImpl::RunAllTests() /root/nano-node/gtest/googletest/src/gtest.cc:5177:43 (core_test+0x1169ea4)
#19 bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /root/nano-node/gtest/googletest/src/gtest.cc:2443:10 (core_test+0x11acb26)
#20 bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /root/nano-node/gtest/googletest/src/gtest.cc:2479:14 (core_test+0x1187c0e)
#21 testing::UnitTest::Run() /root/nano-node/gtest/googletest/src/gtest.cc:4786:10 (core_test+0x116991b)
#22 RUN_ALL_TESTS() /root/nano-node/gtest/googletest/include/gtest/gtest.h:2341:46 (core_test+0x50baa7)
#23 main /root/nano-node/nano/core_test/core_test_main.cc:17:13 (core_test+0x50ae36)
Mutex M907 (0x7ba000007b80) created at:
#0 pthread_mutex_lock <null> (core_test+0x49ba9e)
#1 __gthread_mutex_lock(pthread_mutex_t*) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/x86_64-linux-gnu/c++/9/bits/gthr-default.h:749:12 (core_test+0x51e1a6)
#2 std::mutex::lock() /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/std_mutex.h:100:17 (core_test+0x527d58)
#3 std::unique_lock<std::mutex>::lock() /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/unique_lock.h:141:17 (core_test+0x66b861)
#4 std::unique_lock<std::mutex>::unique_lock(std::mutex&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/unique_lock.h:71:2 (core_test+0x66b333)
#5 nano::work_watcher::run() /root/nano-node/nano/node/wallet.cpp:1403:31 (core_test+0x1056736)
#6 nano::work_watcher::work_watcher(nano::node&)::$_12::operator()() const /root/nano-node/nano/node/wallet.cpp:1380:2 (core_test+0x1063381)
#7 void std::__invoke_impl<void, nano::work_watcher::work_watcher(nano::node&)::$_12>(std::__invoke_other, nano::work_watcher::work_watcher(nano::node&)::$_12&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/invoke.h:60:14 (core_test+0x1063300)
#8 std::__invoke_result<nano::work_watcher::work_watcher(nano::node&)::$_12>::type std::__invoke<nano::work_watcher::work_watcher(nano::node&)::$_12>(nano::work_watcher::work_watcher(nano::node&)::$_12&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/invoke.h:95:14 (core_test+0x1063210)
#9 void std::thread::_Invoker<std::tuple<nano::work_watcher::work_watcher(nano::node&)::$_12> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/thread:244:13 (core_test+0x10631b8)
#10 std::thread::_Invoker<std::tuple<nano::work_watcher::work_watcher(nano::node&)::$_12> >::operator()() /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/thread:251:11 (core_test+0x1063158)
#11 std::thread::_State_impl<std::thread::_Invoker<std::tuple<nano::work_watcher::work_watcher(nano::node&)::$_12> > >::_M_run() /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/thread:195:13 (core_test+0x1062f3c)
#12 execute_native_thread_routine <null> (core_test+0x15d673f)
Thread T13 'Work watcher' (tid=24609, running) created by main thread at:
#0 pthread_create <null> (core_test+0x47f8d5)
#1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (core_test+0x15d69d4)
#2 nano::work_watcher::work_watcher(nano::node&) /root/nano-node/nano/node/wallet.cpp:1378:1 (core_test+0x10563c0)
#3 nano::wallets::wallets(bool, nano::node&) /root/nano-node/nano/node/wallet.cpp:1539:1 (core_test+0x1057d0b)
#4 nano::node::node(nano::node_init&, boost::asio::io_context&, boost::filesystem::path const&, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags, bool) /root/nano-node/nano/node/node.cpp:230:1 (core_test+0xe98506)
#5 void __gnu_cxx::new_allocator<nano::node>::construct<nano::node, nano::node_init&, boost::asio::io_context&, boost::filesystem::path, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags, bool&>(nano::node*, nano::node_init&, boost::asio::io_context&, boost::filesystem::path&&, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags&&, bool&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/ext/new_allocator.h:147:23 (core_test+0xf96448)
#6 void std::allocator_traits<std::allocator<nano::node> >::construct<nano::node, nano::node_init&, boost::asio::io_context&, boost::filesystem::path, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags, bool&>(std::allocator<nano::node>&, nano::node*, nano::node_init&, boost::asio::io_context&, boost::filesystem::path&&, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags&&, bool&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/alloc_traits.h:484:8 (core_test+0xf96255)
#7 std::_Sp_counted_ptr_inplace<nano::node, std::allocator<nano::node>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<nano::node_init&, boost::asio::io_context&, boost::filesystem::path, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags, bool&>(std::allocator<nano::node>, nano::node_init&, boost::asio::io_context&, boost::filesystem::path&&, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags&&, bool&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/shared_ptr_base.h:548:4 (core_test+0xf96089)
#8 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<nano::node, std::allocator<nano::node>, nano::node_init&, boost::asio::io_context&, boost::filesystem::path, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags, bool&>(nano::node*&, std::_Sp_alloc_shared_tag<std::allocator<nano::node> >, nano::node_init&, boost::asio::io_context&, boost::filesystem::path&&, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags&&, bool&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/shared_ptr_base.h:680:6 (core_test+0xf95d79)
#9 std::__shared_ptr<nano::node, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<nano::node>, nano::node_init&, boost::asio::io_context&, boost::filesystem::path, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags, bool&>(std::_Sp_alloc_shared_tag<std::allocator<nano::node> >, nano::node_init&, boost::asio::io_context&, boost::filesystem::path&&, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags&&, bool&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/shared_ptr_base.h:1344:14 (core_test+0xf95b0f)
#10 std::shared_ptr<nano::node>::shared_ptr<std::allocator<nano::node>, nano::node_init&, boost::asio::io_context&, boost::filesystem::path, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags, bool&>(std::_Sp_alloc_shared_tag<std::allocator<nano::node> >, nano::node_init&, boost::asio::io_context&, boost::filesystem::path&&, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags&&, bool&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/shared_ptr.h:359:4 (core_test+0xf95926)
#11 std::shared_ptr<nano::node> std::allocate_shared<nano::node, std::allocator<nano::node>, nano::node_init&, boost::asio::io_context&, boost::filesystem::path, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags, bool&>(std::allocator<nano::node> const&, nano::node_init&, boost::asio::io_context&, boost::filesystem::path&&, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags&&, bool&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/shared_ptr.h:701:14 (core_test+0xf956db)
#12 std::shared_ptr<nano::node> std::make_shared<nano::node, nano::node_init&, boost::asio::io_context&, boost::filesystem::path, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags, bool&>(nano::node_init&, boost::asio::io_context&, boost::filesystem::path&&, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags&&, bool&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/shared_ptr.h:717:14 (core_test+0xf9384f)
#13 nano::system::add_node(nano::node_config const&, bool, nano::transport::transport_type) /root/nano-node/nano/node/testing.cpp:29:13 (core_test+0xf89f50)
#14 nano::system::system(unsigned short, unsigned short, nano::transport::transport_type) /root/nano-node/nano/node/testing.cpp:118:17 (core_test+0xf8b019)
#15 wallet_send_race_Test::TestBody() /root/nano-node/nano/core_test/wallet.cpp:882:15 (core_test+0xa6f0e3)
#16 void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /root/nano-node/gtest/googletest/src/gtest.cc:2443:10 (core_test+0x11a7f66)
#17 void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /root/nano-node/gtest/googletest/src/gtest.cc:2479:14 (core_test+0x1183dce)
#18 testing::Test::Run() /root/nano-node/gtest/googletest/src/gtest.cc:2517:5 (core_test+0x1156f2e)
#19 testing::TestInfo::Run() /root/nano-node/gtest/googletest/src/gtest.cc:2693:11 (core_test+0x1158196)
#20 testing::TestCase::Run() /root/nano-node/gtest/googletest/src/gtest.cc:2811:28 (core_test+0x1158bd7)
#21 testing::internal::UnitTestImpl::RunAllTests() /root/nano-node/gtest/googletest/src/gtest.cc:5177:43 (core_test+0x1169ea4)
#22 bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /root/nano-node/gtest/googletest/src/gtest.cc:2443:10 (core_test+0x11acb26)
#23 bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /root/nano-node/gtest/googletest/src/gtest.cc:2479:14 (core_test+0x1187c0e)
#24 testing::UnitTest::Run() /root/nano-node/gtest/googletest/src/gtest.cc:4786:10 (core_test+0x116991b)
#25 RUN_ALL_TESTS() /root/nano-node/gtest/googletest/include/gtest/gtest.h:2341:46 (core_test+0x50baa7)
#26 main /root/nano-node/nano/core_test/core_test_main.cc:17:13 (core_test+0x50ae36)
SUMMARY: ThreadSanitizer: heap-use-after-free /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/hashtable_policy.h:270:47 in std::__detail::_Hash_node<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, true>::_M_next() const
==================
==================
WARNING: ThreadSanitizer: heap-use-after-free (pid=24592)
Read of size 8 at 0x7b1800016ae8 by thread T13 (mutexes: write M907):
#0 std::__shared_ptr<nano::state_block, (__gnu_cxx::_Lock_policy)2>::get() const /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/shared_ptr_base.h:1310:16 (core_test+0x532572)
#1 std::__shared_ptr_access<nano::state_block, (__gnu_cxx::_Lock_policy)2, false, false>::_M_get() const /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/shared_ptr_base.h:1021:66 (core_test+0x532528)
#2 std::__shared_ptr_access<nano::state_block, (__gnu_cxx::_Lock_policy)2, false, false>::operator->() const /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/shared_ptr_base.h:1015:9 (core_test+0x51fe48)
#3 nano::work_watcher::run() /root/nano-node/nano/node/wallet.cpp:1445:16 (core_test+0x1056de2)
#4 nano::work_watcher::work_watcher(nano::node&)::$_12::operator()() const /root/nano-node/nano/node/wallet.cpp:1380:2 (core_test+0x1063381)
#5 void std::__invoke_impl<void, nano::work_watcher::work_watcher(nano::node&)::$_12>(std::__invoke_other, nano::work_watcher::work_watcher(nano::node&)::$_12&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/invoke.h:60:14 (core_test+0x1063300)
#6 std::__invoke_result<nano::work_watcher::work_watcher(nano::node&)::$_12>::type std::__invoke<nano::work_watcher::work_watcher(nano::node&)::$_12>(nano::work_watcher::work_watcher(nano::node&)::$_12&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/invoke.h:95:14 (core_test+0x1063210)
#7 void std::thread::_Invoker<std::tuple<nano::work_watcher::work_watcher(nano::node&)::$_12> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/thread:244:13 (core_test+0x10631b8)
#8 std::thread::_Invoker<std::tuple<nano::work_watcher::work_watcher(nano::node&)::$_12> >::operator()() /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/thread:251:11 (core_test+0x1063158)
#9 std::thread::_State_impl<std::thread::_Invoker<std::tuple<nano::work_watcher::work_watcher(nano::node&)::$_12> > >::_M_run() /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/thread:195:13 (core_test+0x1062f3c)
#10 execute_native_thread_routine <null> (core_test+0x15d673f)
Previous write of size 8 at 0x7b1800016ae8 by main thread (mutexes: write M907):
#0 operator delete(void*) <null> (core_test+0x50957d)
#1 __gnu_cxx::new_allocator<std::__detail::_Hash_node<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, true> >::deallocate(std::__detail::_Hash_node<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, true>*, unsigned long) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/ext/new_allocator.h:128:2 (core_test+0x1069ed0)
#2 std::allocator_traits<std::allocator<std::__detail::_Hash_node<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, true> > >::deallocate(std::allocator<std::__detail::_Hash_node<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, true> >&, std::__detail::_Hash_node<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, true>*, unsigned long) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/alloc_traits.h:470:13 (core_test+0x1069df8)
#3 std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, true> > >::_M_deallocate_node_ptr(std::__detail::_Hash_node<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, true>*) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/hashtable_policy.h:2102:7 (core_test+0x1069c07)
#4 std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, true> > >::_M_deallocate_node(std::__detail::_Hash_node<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, true>*) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/hashtable_policy.h:2092:7 (core_test+0x1069aa3)
#5 std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, true> > >::_M_deallocate_nodes(std::__detail::_Hash_node<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, true>*) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/hashtable_policy.h:2113:4 (core_test+0x1069960)
#6 std::_Hashtable<nano::uint512_union, std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> >, std::allocator<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> > >, std::__detail::_Select1st, std::equal_to<nano::uint512_union>, std::hash<nano::uint512_union>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::clear() /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/hashtable.h:2034:13 (core_test+0x1069799)
#7 std::unordered_map<nano::uint512_union, std::shared_ptr<nano::state_block>, std::hash<nano::uint512_union>, std::equal_to<nano::uint512_union>, std::allocator<std::pair<nano::uint512_union const, std::shared_ptr<nano::state_block> > > >::clear() /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/unordered_map.h:843:14 (core_test+0x1066518)
#8 nano::work_watcher::stop() /root/nano-node/nano/node/wallet.cpp:1392:9 (core_test+0x105660c)
#9 nano::wallets::stop() /root/nano-node/nano/node/wallet.cpp:1773:10 (core_test+0x1059583)
#10 nano::node::stop() /root/nano-node/nano/node/node.cpp:828:11 (core_test+0xe9b3a8)
#11 nano::system::~system() /root/nano-node/nano/node/testing.cpp:126:6 (core_test+0xf8b16a)
#12 wallet_send_race_Test::TestBody() /root/nano-node/nano/core_test/wallet.cpp:890:1 (core_test+0xa6f6e5)
#13 void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /root/nano-node/gtest/googletest/src/gtest.cc:2443:10 (core_test+0x11a7f66)
#14 void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /root/nano-node/gtest/googletest/src/gtest.cc:2479:14 (core_test+0x1183dce)
#15 testing::Test::Run() /root/nano-node/gtest/googletest/src/gtest.cc:2517:5 (core_test+0x1156f2e)
#16 testing::TestInfo::Run() /root/nano-node/gtest/googletest/src/gtest.cc:2693:11 (core_test+0x1158196)
#17 testing::TestCase::Run() /root/nano-node/gtest/googletest/src/gtest.cc:2811:28 (core_test+0x1158bd7)
#18 testing::internal::UnitTestImpl::RunAllTests() /root/nano-node/gtest/googletest/src/gtest.cc:5177:43 (core_test+0x1169ea4)
#19 bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /root/nano-node/gtest/googletest/src/gtest.cc:2443:10 (core_test+0x11acb26)
#20 bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /root/nano-node/gtest/googletest/src/gtest.cc:2479:14 (core_test+0x1187c0e)
#21 testing::UnitTest::Run() /root/nano-node/gtest/googletest/src/gtest.cc:4786:10 (core_test+0x116991b)
#22 RUN_ALL_TESTS() /root/nano-node/gtest/googletest/include/gtest/gtest.h:2341:46 (core_test+0x50baa7)
#23 main /root/nano-node/nano/core_test/core_test_main.cc:17:13 (core_test+0x50ae36)
Mutex M907 (0x7ba000007b80) created at:
#0 pthread_mutex_lock <null> (core_test+0x49ba9e)
#1 __gthread_mutex_lock(pthread_mutex_t*) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/x86_64-linux-gnu/c++/9/bits/gthr-default.h:749:12 (core_test+0x51e1a6)
#2 std::mutex::lock() /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/std_mutex.h:100:17 (core_test+0x527d58)
#3 std::unique_lock<std::mutex>::lock() /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/unique_lock.h:141:17 (core_test+0x66b861)
#4 std::unique_lock<std::mutex>::unique_lock(std::mutex&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/unique_lock.h:71:2 (core_test+0x66b333)
#5 nano::work_watcher::run() /root/nano-node/nano/node/wallet.cpp:1403:31 (core_test+0x1056736)
#6 nano::work_watcher::work_watcher(nano::node&)::$_12::operator()() const /root/nano-node/nano/node/wallet.cpp:1380:2 (core_test+0x1063381)
#7 void std::__invoke_impl<void, nano::work_watcher::work_watcher(nano::node&)::$_12>(std::__invoke_other, nano::work_watcher::work_watcher(nano::node&)::$_12&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/invoke.h:60:14 (core_test+0x1063300)
#8 std::__invoke_result<nano::work_watcher::work_watcher(nano::node&)::$_12>::type std::__invoke<nano::work_watcher::work_watcher(nano::node&)::$_12>(nano::work_watcher::work_watcher(nano::node&)::$_12&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/invoke.h:95:14 (core_test+0x1063210)
#9 void std::thread::_Invoker<std::tuple<nano::work_watcher::work_watcher(nano::node&)::$_12> >::_M_invoke<0ul>(std::_Index_tuple<0ul>) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/thread:244:13 (core_test+0x10631b8)
#10 std::thread::_Invoker<std::tuple<nano::work_watcher::work_watcher(nano::node&)::$_12> >::operator()() /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/thread:251:11 (core_test+0x1063158)
#11 std::thread::_State_impl<std::thread::_Invoker<std::tuple<nano::work_watcher::work_watcher(nano::node&)::$_12> > >::_M_run() /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/thread:195:13 (core_test+0x1062f3c)
#12 execute_native_thread_routine <null> (core_test+0x15d673f)
Thread T13 'Work watcher' (tid=24609, running) created by main thread at:
#0 pthread_create <null> (core_test+0x47f8d5)
#1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (core_test+0x15d69d4)
#2 nano::work_watcher::work_watcher(nano::node&) /root/nano-node/nano/node/wallet.cpp:1378:1 (core_test+0x10563c0)
#3 nano::wallets::wallets(bool, nano::node&) /root/nano-node/nano/node/wallet.cpp:1539:1 (core_test+0x1057d0b)
#4 nano::node::node(nano::node_init&, boost::asio::io_context&, boost::filesystem::path const&, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags, bool) /root/nano-node/nano/node/node.cpp:230:1 (core_test+0xe98506)
#5 void __gnu_cxx::new_allocator<nano::node>::construct<nano::node, nano::node_init&, boost::asio::io_context&, boost::filesystem::path, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags, bool&>(nano::node*, nano::node_init&, boost::asio::io_context&, boost::filesystem::path&&, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags&&, bool&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/ext/new_allocator.h:147:23 (core_test+0xf96448)
#6 void std::allocator_traits<std::allocator<nano::node> >::construct<nano::node, nano::node_init&, boost::asio::io_context&, boost::filesystem::path, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags, bool&>(std::allocator<nano::node>&, nano::node*, nano::node_init&, boost::asio::io_context&, boost::filesystem::path&&, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags&&, bool&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/alloc_traits.h:484:8 (core_test+0xf96255)
#7 std::_Sp_counted_ptr_inplace<nano::node, std::allocator<nano::node>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<nano::node_init&, boost::asio::io_context&, boost::filesystem::path, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags, bool&>(std::allocator<nano::node>, nano::node_init&, boost::asio::io_context&, boost::filesystem::path&&, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags&&, bool&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/shared_ptr_base.h:548:4 (core_test+0xf96089)
#8 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<nano::node, std::allocator<nano::node>, nano::node_init&, boost::asio::io_context&, boost::filesystem::path, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags, bool&>(nano::node*&, std::_Sp_alloc_shared_tag<std::allocator<nano::node> >, nano::node_init&, boost::asio::io_context&, boost::filesystem::path&&, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags&&, bool&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/shared_ptr_base.h:680:6 (core_test+0xf95d79)
#9 std::__shared_ptr<nano::node, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<nano::node>, nano::node_init&, boost::asio::io_context&, boost::filesystem::path, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags, bool&>(std::_Sp_alloc_shared_tag<std::allocator<nano::node> >, nano::node_init&, boost::asio::io_context&, boost::filesystem::path&&, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags&&, bool&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/shared_ptr_base.h:1344:14 (core_test+0xf95b0f)
#10 std::shared_ptr<nano::node>::shared_ptr<std::allocator<nano::node>, nano::node_init&, boost::asio::io_context&, boost::filesystem::path, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags, bool&>(std::_Sp_alloc_shared_tag<std::allocator<nano::node> >, nano::node_init&, boost::asio::io_context&, boost::filesystem::path&&, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags&&, bool&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/shared_ptr.h:359:4 (core_test+0xf95926)
#11 std::shared_ptr<nano::node> std::allocate_shared<nano::node, std::allocator<nano::node>, nano::node_init&, boost::asio::io_context&, boost::filesystem::path, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags, bool&>(std::allocator<nano::node> const&, nano::node_init&, boost::asio::io_context&, boost::filesystem::path&&, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags&&, bool&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/shared_ptr.h:701:14 (core_test+0xf956db)
#12 std::shared_ptr<nano::node> std::make_shared<nano::node, nano::node_init&, boost::asio::io_context&, boost::filesystem::path, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags, bool&>(nano::node_init&, boost::asio::io_context&, boost::filesystem::path&&, nano::alarm&, nano::node_config const&, nano::work_pool&, nano::node_flags&&, bool&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/shared_ptr.h:717:14 (core_test+0xf9384f)
#13 nano::system::add_node(nano::node_config const&, bool, nano::transport::transport_type) /root/nano-node/nano/node/testing.cpp:29:13 (core_test+0xf89f50)
#14 nano::system::system(unsigned short, unsigned short, nano::transport::transport_type) /root/nano-node/nano/node/testing.cpp:118:17 (core_test+0xf8b019)
#15 wallet_send_race_Test::TestBody() /root/nano-node/nano/core_test/wallet.cpp:882:15 (core_test+0xa6f0e3)
#16 void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /root/nano-node/gtest/googletest/src/gtest.cc:2443:10 (core_test+0x11a7f66)
#17 void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /root/nano-node/gtest/googletest/src/gtest.cc:2479:14 (core_test+0x1183dce)
#18 testing::Test::Run() /root/nano-node/gtest/googletest/src/gtest.cc:2517:5 (core_test+0x1156f2e)
#19 testing::TestInfo::Run() /root/nano-node/gtest/googletest/src/gtest.cc:2693:11 (core_test+0x1158196)
#20 testing::TestCase::Run() /root/nano-node/gtest/googletest/src/gtest.cc:2811:28 (core_test+0x1158bd7)
#21 testing::internal::UnitTestImpl::RunAllTests() /root/nano-node/gtest/googletest/src/gtest.cc:5177:43 (core_test+0x1169ea4)
#22 bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /root/nano-node/gtest/googletest/src/gtest.cc:2443:10 (core_test+0x11acb26)
#23 bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /root/nano-node/gtest/googletest/src/gtest.cc:2479:14 (core_test+0x1187c0e)
#24 testing::UnitTest::Run() /root/nano-node/gtest/googletest/src/gtest.cc:4786:10 (core_test+0x116991b)
#25 RUN_ALL_TESTS() /root/nano-node/gtest/googletest/include/gtest/gtest.h:2341:46 (core_test+0x50baa7)
#26 main /root/nano-node/nano/core_test/core_test_main.cc:17:13 (core_test+0x50ae36)
SUMMARY: ThreadSanitizer: heap-use-after-free /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/shared_ptr_base.h:1310:16 in std::__shared_ptr<nano::state_block, (__gnu_cxx::_Lock_policy)2>::get() const
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment