sugarchain-project / yumekawa

[TEST] Yumekawa 2.0 Taproot
MIT License
6 stars 5 forks source link

data race: net.h:229:35 in CConnman::Init(CConnman::Options const&) #73

Open decryp2kanon opened 3 years ago

decryp2kanon commented 3 years ago

https://github.com/sugarchain-project/yumekawa/pull/72/checks?check_run_id=1500764815

randomly occurs

Cirrus CI / x86_64 Linux [GOAL: install] [focal] [depends, sanitizers: thread (TSan), no gui]
failed 5 minutes ago in 29m 37s
Task Summary
Instruction ci failed in 28:39

DETAILS
white_check_mark 00:25 clone
white_check_mark 00:02 ccache
white_check_mark 00:01 depends_built
white_check_mark 00:00 depends_sdk
white_check_mark 00:00 depends_releases
white_check_mark 00:26 merge_base
x 28:39 ci

    #0 CConnman::Init(CConnman::Options const&) /tmp/cirrus-ci-build/ci/scratch/build/sugarchain-x86_64-pc-linux-gnu/src/./net.h:229:35 (sugarchaind+0x198ceb)
    #1 CConnman::Start(CScheduler&, CConnman::Options const&) /tmp/cirrus-ci-build/ci/scratch/build/sugarchain-x86_64-pc-linux-gnu/src/net.cpp:2446:5 (sugarchaind+0x18ca3c)
    #2 AppInitMain(util::Ref const&, NodeContext&, interfaces::BlockAndHeaderTipInfo*) /tmp/cirrus-ci-build/ci/scratch/build/sugarchain-x86_64-pc-linux-gnu/src/init.cpp:2017:24 (sugarchaind+0x13b07b)
    #3 AppInit(int, char**) /tmp/cirrus-ci-build/ci/scratch/build/sugarchain-x86_64-pc-linux-gnu/src/bitcoind.cpp:142:43 (sugarchaind+0x118428)
    #4 main /tmp/cirrus-ci-build/ci/scratch/build/sugarchain-x86_64-pc-linux-gnu/src/bitcoind.cpp:172:13 (sugarchaind+0x118428)

  Previous read of size 4 at 0x7f224b9fe36c by thread T4 (mutexes: write M141):
    #0 CConnman::GetExtraOutboundCount() /tmp/cirrus-ci-build/ci/scratch/build/sugarchain-x86_64-pc-linux-gnu/src/net.cpp:1853:33 (sugarchaind+0x1839c6)
    #1 PeerManager::EvictExtraOutboundPeers(long) /tmp/cirrus-ci-build/ci/scratch/build/sugarchain-x86_64-pc-linux-gnu/src/net_processing.cpp:3935:33 (sugarchaind+0x1d88ad)
    #2 PeerManager::CheckForStaleTipAndEvictPeers() /tmp/cirrus-ci-build/ci/scratch/build/sugarchain-x86_64-pc-linux-gnu/src/net_processing.cpp:3997:5 (sugarchaind+0x1d8afc)
    #3 PeerManager::PeerManager(CChainParams const&, CConnman&, BanMan*, CScheduler&, ChainstateManager&, CTxMemPool&)::$_3::operator()() const /tmp/cirrus-ci-build/ci/scratch/build/sugarchain-x86_64-pc-linux-gnu/src/net_processing.cpp:1191:44 (sugarchaind+0x1e8625)
    #4 decltype(std::__1::forward<PeerManager::PeerManager(CChainParams const&, CConnman&, BanMan*, CScheduler&, ChainstateManager&, CTxMemPool&)::$_3&>(fp)()) std::__1::__invoke<PeerManager::PeerManager(CChainParams const&, CConnman&, BanMan*, CScheduler&, ChainstateManager&, CTxMemPool&)::$_3&>(PeerManager::PeerManager(CChainParams const&, CConnman&, BanMan*, CScheduler&, ChainstateManager&, CTxMemPool&)::$_3&) /usr/lib/llvm-10/bin/../include/c++/v1/type_traits:3539:1 (sugarchaind+0x1e8625)
    #5 void std::__1::__invoke_void_return_wrapper<void>::__call<PeerManager::PeerManager(CChainParams const&, CConnman&, BanMan*, CScheduler&, ChainstateManager&, CTxMemPool&)::$_3&>(PeerManager::PeerManager(CChainParams const&, CConnman&, BanMan*, CScheduler&, ChainstateManager&, CTxMemPool&)::$_3&) /usr/lib/llvm-10/bin/../include/c++/v1/__functional_base:348:9 (sugarchaind+0x1e8625)
    #6 std::__1::__function::__alloc_func<PeerManager::PeerManager(CChainParams const&, CConnman&, BanMan*, CScheduler&, ChainstateManager&, CTxMemPool&)::$_3, std::__1::allocator<PeerManager::PeerManager(CChainParams const&, CConnman&, BanMan*, CScheduler&, ChainstateManager&, CTxMemPool&)::$_3>, void ()>::operator()() /usr/lib/llvm-10/bin/../include/c++/v1/functional:1540:16 (sugarchaind+0x1e8625)
    #7 std::__1::__function::__func<PeerManager::PeerManager(CChainParams const&, CConnman&, BanMan*, CScheduler&, ChainstateManager&, CTxMemPool&)::$_3, std::__1::allocator<PeerManager::PeerManager(CChainParams const&, CConnman&, BanMan*, CScheduler&, ChainstateManager&, CTxMemPool&)::$_3>, void ()>::operator()() /usr/lib/llvm-10/bin/../include/c++/v1/functional:1714:12 (sugarchaind+0x1e8625)
    #8 std::__1::__function::__value_func<void ()>::operator()() const /usr/lib/llvm-10/bin/../include/c++/v1/functional:1867:16 (sugarchaind+0x6f4681)
    #9 std::__1::function<void ()>::operator()() const /usr/lib/llvm-10/bin/../include/c++/v1/functional:2473:12 (sugarchaind+0x6f4681)
    #10 Repeat(CScheduler&, std::__1::function<void ()>, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> >) /tmp/cirrus-ci-build/ci/scratch/build/sugarchain-x86_64-pc-linux-gnu/src/scheduler.cpp:104:5 (sugarchaind+0x6f4681)
    #11 CScheduler::scheduleEvery(std::__1::function<void ()>, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> >)::$_0::operator()() const /tmp/cirrus-ci-build/ci/scratch/build/sugarchain-x86_64-pc-linux-gnu/src/scheduler.cpp:110:27 (sugarchaind+0x6f44cb)
    #12 decltype(std::__1::forward<CScheduler::scheduleEvery(std::__1::function<void ()>, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> >)::$_0&>(fp)()) std::__1::__invoke<CScheduler::scheduleEvery(std::__1::function<void ()>, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> >)::$_0&>(CScheduler::scheduleEvery(std::__1::function<void ()>, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> >)::$_0&) /usr/lib/llvm-10/bin/../include/c++/v1/type_traits:3539:1 (sugarchaind+0x6f44cb)
    #13 void std::__1::__invoke_void_return_wrapper<void>::__call<CScheduler::scheduleEvery(std::__1::function<void ()>, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> >)::$_0&>(CScheduler::scheduleEvery(std::__1::function<void ()>, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> >)::$_0&) /usr/lib/llvm-10/bin/../include/c++/v1/__functional_base:348:9 (sugarchaind+0x6f44cb)
    #14 std::__1::__function::__alloc_func<CScheduler::scheduleEvery(std::__1::function<void ()>, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> >)::$_0, std::__1::allocator<CScheduler::scheduleEvery(std::__1::function<void ()>, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> >)::$_0>, void ()>::operator()() /usr/lib/llvm-10/bin/../include/c++/v1/functional:1540:16 (sugarchaind+0x6f44cb)
    #15 std::__1::__function::__func<CScheduler::scheduleEvery(std::__1::function<void ()>, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> >)::$_0, std::__1::allocator<CScheduler::scheduleEvery(std::__1::function<void ()>, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> >)::$_0>, void ()>::operator()() /usr/lib/llvm-10/bin/../include/c++/v1/functional:1714:12 (sugarchaind+0x6f44cb)
    #16 std::__1::__function::__value_func<void ()>::operator()() const /usr/lib/llvm-10/bin/../include/c++/v1/functional:1867:16 (sugarchaind+0x6f28c5)
    #17 std::__1::function<void ()>::operator()() const /usr/lib/llvm-10/bin/../include/c++/v1/functional:2473:12 (sugarchaind+0x6f28c5)
    #18 CScheduler::serviceQueue() /tmp/cirrus-ci-build/ci/scratch/build/sugarchain-x86_64-pc-linux-gnu/src/scheduler.cpp:60:17 (sugarchaind+0x6f28c5)
    #19 AppInitMain(util::Ref const&, NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_6::operator()() const::'lambda'()::operator()() const /tmp/cirrus-ci-build/ci/scratch/build/sugarchain-x86_64-pc-linux-gnu/src/init.cpp:1356:84 (sugarchaind+0x1403b1)
    #20 void TraceThread<AppInitMain(util::Ref const&, NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_6::operator()() const::'lambda'()>(char const*, AppInitMain(util::Ref const&, NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_6::operator()() const::'lambda'()) /tmp/cirrus-ci-build/ci/scratch/build/sugarchain-x86_64-pc-linux-gnu/src/./util/system.h:438:9 (sugarchaind+0x1403b1)
    #21 AppInitMain(util::Ref const&, NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_6::operator()() const /tmp/cirrus-ci-build/ci/scratch/build/sugarchain-x86_64-pc-linux-gnu/src/init.cpp:1356:37 (sugarchaind+0x1403b1)
    #22 boost::detail::thread_data<AppInitMain(util::Ref const&, NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_6>::run() /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/share/../include/boost/thread/detail/thread.hpp:120:17 (sugarchaind+0x1403b1)
    #23 boost::(anonymous namespace)::thread_proxy(void*) <null> (sugarchaind+0x884d4e)

  Location is heap block of size 328928 at 0x7f224b9ae000 allocated by main thread:
    #0 operator new(unsigned long) <null> (sugarchaind+0x11548b)
    #1 std::__1::unique_ptr<CConnman, std::__1::default_delete<CConnman> > MakeUnique<CConnman, unsigned long, unsigned long, bool>(unsigned long&&, unsigned long&&, bool&&) /tmp/cirrus-ci-build/ci/scratch/build/sugarchain-x86_64-pc-linux-gnu/src/./util/memory.h:16:31 (sugarchaind+0x131d92)
    #2 AppInitMain(util::Ref const&, NodeContext&, interfaces::BlockAndHeaderTipInfo*) /tmp/cirrus-ci-build/ci/scratch/build/sugarchain-x86_64-pc-linux-gnu/src/init.cpp:1403:20 (sugarchaind+0x131d92)
    #3 AppInit(int, char**) /tmp/cirrus-ci-build/ci/scratch/build/sugarchain-x86_64-pc-linux-gnu/src/bitcoind.cpp:142:43 (sugarchaind+0x118428)
    #4 main /tmp/cirrus-ci-build/ci/scratch/build/sugarchain-x86_64-pc-linux-gnu/src/bitcoind.cpp:172:13 (sugarchaind+0x118428)

  Mutex M141 (0x5569800113b8) created at:
    #0 pthread_mutex_init <null> (sugarchaind+0x89afd)
    #1 std::__1::recursive_mutex::recursive_mutex() <null> (libc++.so.1+0x83583)
    #2 __libc_csu_init <null> (sugarchaind+0xb78eac)

  Thread T4 'b-scheduler' (tid=28785, running) created by main thread at:
    #0 pthread_create <null> (sugarchaind+0x8857b)
    #1 boost::thread::start_thread_noexcept() <null> (sugarchaind+0x884c4d)
    #2 boost::thread::thread<AppInitMain(util::Ref const&, NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_6&>(AppInitMain(util::Ref const&, NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_6&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/share/../include/boost/thread/detail/thread.hpp:269:13 (sugarchaind+0x131522)
    #3 boost::thread* boost::thread_group::create_thread<AppInitMain(util::Ref const&, NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_6>(AppInitMain(util::Ref const&, NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_6) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/share/../include/boost/thread/detail/thread_group.hpp:79:60 (sugarchaind+0x131522)
    #4 AppInitMain(util::Ref const&, NodeContext&, interfaces::BlockAndHeaderTipInfo*) /tmp/cirrus-ci-build/ci/scratch/build/sugarchain-x86_64-pc-linux-gnu/src/init.cpp:1356:17 (sugarchaind+0x131522)
    #5 AppInit(int, char**) /tmp/cirrus-ci-build/ci/scratch/build/sugarchain-x86_64-pc-linux-gnu/src/bitcoind.cpp:142:43 (sugarchaind+0x118428)
    #6 main /tmp/cirrus-ci-build/ci/scratch/build/sugarchain-x86_64-pc-linux-gnu/src/bitcoind.cpp:172:13 (sugarchaind+0x118428)

SUMMARY: ThreadSanitizer: data race /tmp/cirrus-ci-build/ci/scratch/build/sugarchain-x86_64-pc-linux-gnu/src/./net.h:229:35 in CConnman::Init(CConnman::Options const&)
==================
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������