test: WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=32090) #30764

issue maflcko openend this issue on August 30, 2024
  1. maflcko commented at 11:36 am on August 30, 2024: member

    To reproduce, use something like:

    0rm -rf ./bld-cmake/ && cmake -B ./bld-cmake -DAPPEND_CXXFLAGS='-std=c++23' -DCMAKE_C_COMPILER='clang' -DCMAKE_CXX_COMPILER='clang++' -DBUILD_GUI=ON -DBUILD_FUZZ_BINARY=ON -DBUILD_BENCH=ON -DWITH_ZMQ=ON -DWITH_ZMQ=ON -DBUILD_UTIL_CHAINSTATE=ON -DBUILD_KERNEL_LIB=ON -DSANITIZERS=thread        && cmake --build ./bld-cmake --parallel $( nproc ) -- 
    1TSAN_OPTIONS="suppressions=$(pwd)/test/sanitizer_suppressions/tsan:halt_on_error=1:second_deadlock_stack=1" ./bld-cmake/src/test/test_bitcoin -t wallet_tests -l test_suite
    
  2. maflcko added the label Bug on Aug 30, 2024
  3. maflcko added the label Wallet on Aug 30, 2024
  4. maflcko added the label Tests on Aug 30, 2024
  5. maflcko added the label CI failed on Aug 30, 2024
  6. maflcko added this to the milestone 28.0 on Aug 30, 2024
  7. maflcko removed this from the milestone 28.0 on Aug 30, 2024
  8. maflcko removed the label CI failed on Aug 30, 2024
  9. maflcko commented at 11:45 am on August 30, 2024: member
    Actually, the bisect was wrong. Let me do it again, starting from a fresh install of the OS.
  10. maflcko commented at 1:39 pm on August 30, 2024: member

    Ok, steps to reproduce, starting from a fresh install of Ubuntu 24.10:

    0    1  apt update && apt install -y git && apt install -y git ccache build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq libevent-dev libboost-dev qttools5-dev qttools5-dev-tools systemtap-sdt-dev libminiupnpc-dev libnatpmp-dev libqrencode-dev libzmq3-dev 
    1    2  git clone https://github.com/bitcoin/bitcoin --depth=1 ./bitcoin-core
    2    3  cd bitcoin-core
    3    4  ./autogen.sh
    4    5  apt install -y clang llvm libsqlite3-dev
    5    6  ./configure --with-sanitizers=thread CC=clang CXX="clang++" 
    6    7  make -j 19 
    7    8  TSAN_OPTIONS="suppressions=$(pwd)/test/sanitizer_suppressions/tsan:halt_on_error=1:second_deadlock_stack=1" ./src/test/test_bitcoin -t wallet_tests -l test_suite 
    
  11. maflcko commented at 1:45 pm on August 30, 2024: member

    For reference, the output is:

      0wallet/test/wallet_tests.cpp(47): Entering test suite "wallet_tests"
      1wallet/test/wallet_tests.cpp(74): Entering test case "scan_for_wallet_transactions"
      2wallet/test/wallet_tests.cpp(74): Leaving test case "scan_for_wallet_transactions"; testing time: 499472us
      3wallet/test/wallet_tests.cpp(197): Entering test case "importmulti_rescan"
      4wallet/test/wallet_tests.cpp(197): Leaving test case "importmulti_rescan"; testing time: 355160us
      5wallet/test/wallet_tests.cpp(262): Entering test case "importwallet_rescan"
      6wallet/test/wallet_tests.cpp(262): Leaving test case "importwallet_rescan"; testing time: 337828us
      7wallet/test/wallet_tests.cpp(338): Entering test case "coin_mark_dirty_immature_credit"
      8wallet/test/wallet_tests.cpp(338): Leaving test case "coin_mark_dirty_immature_credit"; testing time: 1083463us
      9wallet/test/wallet_tests.cpp(389): Entering test case "ComputeTimeSmart"
     10wallet/test/wallet_tests.cpp(389): Leaving test case "ComputeTimeSmart"; testing time: 152476us
     11wallet/test/wallet_tests.cpp(427): Entering test case "LoadReceiveRequests"
     12wallet/test/wallet_tests.cpp(427): Leaving test case "LoadReceiveRequests"; testing time: 176660us
     13wallet/test/wallet_tests.cpp(512): Entering test case "WatchOnlyPubKeys"
     14wallet/test/wallet_tests.cpp(512): Leaving test case "WatchOnlyPubKeys"; testing time: 147521us
     15wallet/test/wallet_tests.cpp(588): Entering test case "ListCoinsTest"
     16==================
     17WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=162444)
     18  Cycle in lock order graph: M0 (0x7fff0b14d678) => M1 (0x557cd516c358) => M0
     19
     20  Mutex M1 acquired here while holding mutex M0 in main thread:
     21    [#0](/bitcoin-bitcoin/0/) pthread_mutex_lock <null> (test_bitcoin+0x13e17e) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     22    [#1](/bitcoin-bitcoin/1/) __gthread_mutex_lock(pthread_mutex_t*) /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:762:12 (test_bitcoin+0x12792ac) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     23    [#2](/bitcoin-bitcoin/2/) __gthread_recursive_mutex_lock(pthread_mutex_t*) /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:824:10 (test_bitcoin+0x12792ac)
     24    [#3](/bitcoin-bitcoin/3/) std::recursive_mutex::lock() /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/mutex:125:17 (test_bitcoin+0x12792ac)
     25    [#4](/bitcoin-bitcoin/4/) std::unique_lock<std::recursive_mutex>::lock() /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_lock.h:147:17 (test_bitcoin+0x12792ac)
     26    [#5](/bitcoin-bitcoin/5/) UniqueLock<AnnotatedMixin<std::recursive_mutex>>::Enter(char const*, char const*, int) src/./sync.h:163:15 (test_bitcoin+0x12792ac)
     27    [#6](/bitcoin-bitcoin/6/) UniqueLock<AnnotatedMixin<std::recursive_mutex>>::UniqueLock(AnnotatedMixin<std::recursive_mutex>&, char const*, char const*, int, bool) src/./sync.h:182:13 (test_bitcoin+0x12792ac)
     28    [#7](/bitcoin-bitcoin/7/) node::(anonymous namespace)::ChainImpl::findBlock(uint256 const&, interfaces::FoundBlock const&) src/node/interfaces.cpp:592:9 (test_bitcoin+0x12792ac)
     29    [#8](/bitcoin-bitcoin/8/) wallet::CWallet::ComputeTimeSmart(wallet::CWalletTx const&, bool) const src/wallet/wallet.cpp:2839:21 (test_bitcoin+0xedbc9b) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     30    [#9](/bitcoin-bitcoin/9/) wallet::CWallet::AddToWallet(std::shared_ptr<CTransaction const>, std::variant<wallet::TxStateConfirmed, wallet::TxStateInMempool, wallet::TxStateBlockConflicted, wallet::TxStateInactive, wallet::TxStateUnrecognized> const&, std::function<bool (wallet::CWalletTx&, bool)> const&, bool, bool) src/wallet/wallet.cpp:1090:26 (test_bitcoin+0xeda36a) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     31    [#10](/bitcoin-bitcoin/10/) wallet::wallet_tests::AddTx(ChainstateManager&, wallet::CWallet&, unsigned int, long, long) src/wallet/test/wallet_tests.cpp:378:19 (test_bitcoin+0xc9a145) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     32    [#11](/bitcoin-bitcoin/11/) wallet::wallet_tests::ComputeTimeSmart::test_method() src/wallet/test/wallet_tests.cpp:392:5 (test_bitcoin+0xc98e3b) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     33    [#12](/bitcoin-bitcoin/12/) wallet::wallet_tests::ComputeTimeSmart_invoker() src/wallet/test/wallet_tests.cpp:389:1 (test_bitcoin+0xc9882d) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     34    [#13](/bitcoin-bitcoin/13/) boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) /usr/include/boost/function/function_template.hpp:117:11 (test_bitcoin+0x2f1cfd) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     35    [#14](/bitcoin-bitcoin/14/) boost::function0<void>::operator()() const /usr/include/boost/function/function_template.hpp:771:14 (test_bitcoin+0x259698) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     36    [#15](/bitcoin-bitcoin/15/) boost::detail::forward::operator()() /usr/include/boost/test/impl/execution_monitor.ipp:1395:32 (test_bitcoin+0x259698)
     37    [#16](/bitcoin-bitcoin/16/) boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) /usr/include/boost/function/function_template.hpp:137:18 (test_bitcoin+0x259698)
     38    [#17](/bitcoin-bitcoin/17/) boost::function0<int>::operator()() const /usr/include/boost/function/function_template.hpp:771:14 (test_bitcoin+0x1d7503) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     39    [#18](/bitcoin-bitcoin/18/) int boost::detail::do_invoke<boost::shared_ptr<boost::detail::translator_holder_base>, boost::function<int ()>>(boost::shared_ptr<boost::detail::translator_holder_base> const&, boost::function<int ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:308:30 (test_bitcoin+0x1d7503)
     40    [#19](/bitcoin-bitcoin/19/) boost::execution_monitor::catch_signals(boost::function<int ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:910:16 (test_bitcoin+0x1d7503)
     41    [#20](/bitcoin-bitcoin/20/) boost::execution_monitor::execute(boost::function<int ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:1308:16 (test_bitcoin+0x1d787a) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     42    [#21](/bitcoin-bitcoin/21/) boost::execution_monitor::vexecute(boost::function<void ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:1404:5 (test_bitcoin+0x1d3120) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     43    [#22](/bitcoin-bitcoin/22/) boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned long) /usr/include/boost/test/impl/unit_test_monitor.ipp:49:9 (test_bitcoin+0x1d3120)
     44    [#23](/bitcoin-bitcoin/23/) boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /usr/include/boost/test/impl/framework.ipp:815:44 (test_bitcoin+0x20c58e) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     45    [#24](/bitcoin-bitcoin/24/) boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /usr/include/boost/test/impl/framework.ipp:740:54 (test_bitcoin+0x20c77b) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     46    [#25](/bitcoin-bitcoin/25/) boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /usr/include/boost/test/impl/framework.ipp:740:54 (test_bitcoin+0x20c77b) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     47    [#26](/bitcoin-bitcoin/26/) boost::unit_test::framework::run(unsigned long, bool) /usr/include/boost/test/impl/framework.ipp:1722:29 (test_bitcoin+0x1d1deb) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     48    [#27](/bitcoin-bitcoin/27/) boost::unit_test::unit_test_main(boost::unit_test::test_suite* (*)(int, char**), int, char**) /usr/include/boost/test/impl/unit_test_main.ipp:250:9 (test_bitcoin+0x1ef01d) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     49    [#28](/bitcoin-bitcoin/28/) main /usr/include/boost/test/impl/unit_test_main.ipp:306:12 (test_bitcoin+0x1ef823) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     50
     51  Mutex M0 previously acquired by the same thread here:
     52    [#0](/bitcoin-bitcoin/0/) pthread_mutex_lock <null> (test_bitcoin+0x13e17e) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     53    [#1](/bitcoin-bitcoin/1/) __gthread_mutex_lock(pthread_mutex_t*) /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:762:12 (test_bitcoin+0xed9f25) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     54    [#2](/bitcoin-bitcoin/2/) __gthread_recursive_mutex_lock(pthread_mutex_t*) /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:824:10 (test_bitcoin+0xed9f25)
     55    [#3](/bitcoin-bitcoin/3/) std::recursive_mutex::lock() /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/mutex:125:17 (test_bitcoin+0xed9f25)
     56    [#4](/bitcoin-bitcoin/4/) std::unique_lock<std::recursive_mutex>::lock() /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_lock.h:147:17 (test_bitcoin+0xed9f25)
     57    [#5](/bitcoin-bitcoin/5/) UniqueLock<AnnotatedMixin<std::recursive_mutex>>::Enter(char const*, char const*, int) src/./sync.h:163:15 (test_bitcoin+0xed9f25)
     58    [#6](/bitcoin-bitcoin/6/) UniqueLock<AnnotatedMixin<std::recursive_mutex>>::UniqueLock(AnnotatedMixin<std::recursive_mutex>&, char const*, char const*, int, bool) src/./sync.h:182:13 (test_bitcoin+0xed9f25)
     59    [#7](/bitcoin-bitcoin/7/) wallet::CWallet::AddToWallet(std::shared_ptr<CTransaction const>, std::variant<wallet::TxStateConfirmed, wallet::TxStateInMempool, wallet::TxStateBlockConflicted, wallet::TxStateInactive, wallet::TxStateUnrecognized> const&, std::function<bool (wallet::CWalletTx&, bool)> const&, bool, bool) src/wallet/wallet.cpp:1063:5 (test_bitcoin+0xed9f25)
     60    [#8](/bitcoin-bitcoin/8/) wallet::wallet_tests::AddTx(ChainstateManager&, wallet::CWallet&, unsigned int, long, long) src/wallet/test/wallet_tests.cpp:378:19 (test_bitcoin+0xc9a145) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     61    [#9](/bitcoin-bitcoin/9/) wallet::wallet_tests::ComputeTimeSmart::test_method() src/wallet/test/wallet_tests.cpp:392:5 (test_bitcoin+0xc98e3b) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     62    [#10](/bitcoin-bitcoin/10/) wallet::wallet_tests::ComputeTimeSmart_invoker() src/wallet/test/wallet_tests.cpp:389:1 (test_bitcoin+0xc9882d) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     63    [#11](/bitcoin-bitcoin/11/) boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) /usr/include/boost/function/function_template.hpp:117:11 (test_bitcoin+0x2f1cfd) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     64    [#12](/bitcoin-bitcoin/12/) boost::function0<void>::operator()() const /usr/include/boost/function/function_template.hpp:771:14 (test_bitcoin+0x259698) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     65    [#13](/bitcoin-bitcoin/13/) boost::detail::forward::operator()() /usr/include/boost/test/impl/execution_monitor.ipp:1395:32 (test_bitcoin+0x259698)
     66    [#14](/bitcoin-bitcoin/14/) boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) /usr/include/boost/function/function_template.hpp:137:18 (test_bitcoin+0x259698)
     67    [#15](/bitcoin-bitcoin/15/) boost::function0<int>::operator()() const /usr/include/boost/function/function_template.hpp:771:14 (test_bitcoin+0x1d7503) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     68    [#16](/bitcoin-bitcoin/16/) int boost::detail::do_invoke<boost::shared_ptr<boost::detail::translator_holder_base>, boost::function<int ()>>(boost::shared_ptr<boost::detail::translator_holder_base> const&, boost::function<int ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:308:30 (test_bitcoin+0x1d7503)
     69    [#17](/bitcoin-bitcoin/17/) boost::execution_monitor::catch_signals(boost::function<int ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:910:16 (test_bitcoin+0x1d7503)
     70    [#18](/bitcoin-bitcoin/18/) boost::execution_monitor::execute(boost::function<int ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:1308:16 (test_bitcoin+0x1d787a) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     71    [#19](/bitcoin-bitcoin/19/) boost::execution_monitor::vexecute(boost::function<void ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:1404:5 (test_bitcoin+0x1d3120) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     72    [#20](/bitcoin-bitcoin/20/) boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned long) /usr/include/boost/test/impl/unit_test_monitor.ipp:49:9 (test_bitcoin+0x1d3120)
     73    [#21](/bitcoin-bitcoin/21/) boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /usr/include/boost/test/impl/framework.ipp:815:44 (test_bitcoin+0x20c58e) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     74    [#22](/bitcoin-bitcoin/22/) boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /usr/include/boost/test/impl/framework.ipp:740:54 (test_bitcoin+0x20c77b) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     75    [#23](/bitcoin-bitcoin/23/) boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /usr/include/boost/test/impl/framework.ipp:740:54 (test_bitcoin+0x20c77b) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     76    [#24](/bitcoin-bitcoin/24/) boost::unit_test::framework::run(unsigned long, bool) /usr/include/boost/test/impl/framework.ipp:1722:29 (test_bitcoin+0x1d1deb) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     77    [#25](/bitcoin-bitcoin/25/) boost::unit_test::unit_test_main(boost::unit_test::test_suite* (*)(int, char**), int, char**) /usr/include/boost/test/impl/unit_test_main.ipp:250:9 (test_bitcoin+0x1ef01d) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     78    [#26](/bitcoin-bitcoin/26/) main /usr/include/boost/test/impl/unit_test_main.ipp:306:12 (test_bitcoin+0x1ef823) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     79
     80  Mutex M0 acquired here while holding mutex M1 in main thread:
     81    [#0](/bitcoin-bitcoin/0/) pthread_mutex_lock <null> (test_bitcoin+0x13e17e) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     82    [#1](/bitcoin-bitcoin/1/) __gthread_mutex_lock(pthread_mutex_t*) /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:762:12 (test_bitcoin+0x1595962) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     83    [#2](/bitcoin-bitcoin/2/) __gthread_recursive_mutex_lock(pthread_mutex_t*) /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:824:10 (test_bitcoin+0x1595962)
     84    [#3](/bitcoin-bitcoin/3/) std::recursive_mutex::lock() /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/mutex:125:17 (test_bitcoin+0x1595962)
     85    [#4](/bitcoin-bitcoin/4/) std::unique_lock<std::recursive_mutex>::lock() /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_lock.h:147:17 (test_bitcoin+0x1595962)
     86    [#5](/bitcoin-bitcoin/5/) UniqueLock<AnnotatedMixin<std::recursive_mutex>>::Enter(char const*, char const*, int) src/./sync.h:163:15 (test_bitcoin+0x1595962)
     87    [#6](/bitcoin-bitcoin/6/) UniqueLock<AnnotatedMixin<std::recursive_mutex>>::UniqueLock(AnnotatedMixin<std::recursive_mutex>&, char const*, char const*, int, bool) src/./sync.h:182:13 (test_bitcoin+0x1595962)
     88    [#7](/bitcoin-bitcoin/7/) ArgsManager::GetDataDir(bool) const src/common/args.cpp:308:5 (test_bitcoin+0x1595962)
     89    [#8](/bitcoin-bitcoin/8/) ArgsManager::GetDataDirNet() const src/./common/args.h:232:45 (test_bitcoin+0xd6879d) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     90    [#9](/bitcoin-bitcoin/9/) ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_0::operator()() const src/test/util/setup_common.cpp:265:28 (test_bitcoin+0xd6879d)
     91    [#10](/bitcoin-bitcoin/10/) void std::__invoke_impl<void, ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_0&>(std::__invoke_other, ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_0&) /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/invoke.h:61:14 (test_bitcoin+0xd6879d)
     92    [#11](/bitcoin-bitcoin/11/) std::enable_if<is_invocable_r_v<void, ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_0&>, void>::type std::__invoke_r<void, ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_0&>(ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_0&) /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/invoke.h:111:2 (test_bitcoin+0xd6879d)
     93    [#12](/bitcoin-bitcoin/12/) std::_Function_handler<void (), ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_0>::_M_invoke(std::_Any_data const&) /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/std_function.h:290:9 (test_bitcoin+0xd6879d)
     94    [#13](/bitcoin-bitcoin/13/) std::function<void ()>::operator()() const /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/std_function.h:591:9 (test_bitcoin+0xd60281) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     95    [#14](/bitcoin-bitcoin/14/) ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts) src/test/util/setup_common.cpp:270:5 (test_bitcoin+0xd60281)
     96    [#15](/bitcoin-bitcoin/15/) TestingSetup::TestingSetup(ChainType, TestOpts) src/test/util/setup_common.cpp:317:7 (test_bitcoin+0xd610c3) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     97    [#16](/bitcoin-bitcoin/16/) TestChain100Setup::TestChain100Setup(ChainType, TestOpts) src/test/util/setup_common.cpp:353:7 (test_bitcoin+0xd61a2a) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     98    [#17](/bitcoin-bitcoin/17/) wallet::wallet_tests::ListCoinsTestingSetup::ListCoinsTestingSetup() src/wallet/test/wallet_tests.cpp:548:5 (test_bitcoin+0xcbe0c1) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
     99    [#18](/bitcoin-bitcoin/18/) wallet::wallet_tests::ListCoinsTest::ListCoinsTest() src/wallet/test/wallet_tests.cpp:588:1 (test_bitcoin+0xc9e6e5) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    100    [#19](/bitcoin-bitcoin/19/) wallet::wallet_tests::ListCoinsTest_invoker() src/wallet/test/wallet_tests.cpp:588:1 (test_bitcoin+0xc9e6e5)
    101    [#20](/bitcoin-bitcoin/20/) boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) /usr/include/boost/function/function_template.hpp:117:11 (test_bitcoin+0x2f1cfd) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    102    [#21](/bitcoin-bitcoin/21/) boost::function0<void>::operator()() const /usr/include/boost/function/function_template.hpp:771:14 (test_bitcoin+0x259698) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    103    [#22](/bitcoin-bitcoin/22/) boost::detail::forward::operator()() /usr/include/boost/test/impl/execution_monitor.ipp:1395:32 (test_bitcoin+0x259698)
    104    [#23](/bitcoin-bitcoin/23/) boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) /usr/include/boost/function/function_template.hpp:137:18 (test_bitcoin+0x259698)
    105    [#24](/bitcoin-bitcoin/24/) boost::function0<int>::operator()() const /usr/include/boost/function/function_template.hpp:771:14 (test_bitcoin+0x1d7503) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    106    [#25](/bitcoin-bitcoin/25/) int boost::detail::do_invoke<boost::shared_ptr<boost::detail::translator_holder_base>, boost::function<int ()>>(boost::shared_ptr<boost::detail::translator_holder_base> const&, boost::function<int ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:308:30 (test_bitcoin+0x1d7503)
    107    [#26](/bitcoin-bitcoin/26/) boost::execution_monitor::catch_signals(boost::function<int ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:910:16 (test_bitcoin+0x1d7503)
    108    [#27](/bitcoin-bitcoin/27/) boost::execution_monitor::execute(boost::function<int ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:1308:16 (test_bitcoin+0x1d787a) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    109    [#28](/bitcoin-bitcoin/28/) boost::execution_monitor::vexecute(boost::function<void ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:1404:5 (test_bitcoin+0x1d3120) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    110    [#29](/bitcoin-bitcoin/29/) boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned long) /usr/include/boost/test/impl/unit_test_monitor.ipp:49:9 (test_bitcoin+0x1d3120)
    111    [#30](/bitcoin-bitcoin/30/) boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /usr/include/boost/test/impl/framework.ipp:815:44 (test_bitcoin+0x20c58e) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    112    [#31](/bitcoin-bitcoin/31/) boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /usr/include/boost/test/impl/framework.ipp:740:54 (test_bitcoin+0x20c77b) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    113    [#32](/bitcoin-bitcoin/32/) boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /usr/include/boost/test/impl/framework.ipp:740:54 (test_bitcoin+0x20c77b) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    114    [#33](/bitcoin-bitcoin/33/) boost::unit_test::framework::run(unsigned long, bool) /usr/include/boost/test/impl/framework.ipp:1722:29 (test_bitcoin+0x1d1deb) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    115    [#34](/bitcoin-bitcoin/34/) boost::unit_test::unit_test_main(boost::unit_test::test_suite* (*)(int, char**), int, char**) /usr/include/boost/test/impl/unit_test_main.ipp:250:9 (test_bitcoin+0x1ef01d) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    116    [#35](/bitcoin-bitcoin/35/) main /usr/include/boost/test/impl/unit_test_main.ipp:306:12 (test_bitcoin+0x1ef823) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    117
    118  Mutex M1 previously acquired by the same thread here:
    119    [#0](/bitcoin-bitcoin/0/) pthread_mutex_lock <null> (test_bitcoin+0x13e17e) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    120    [#1](/bitcoin-bitcoin/1/) __gthread_mutex_lock(pthread_mutex_t*) /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:762:12 (test_bitcoin+0xd68783) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    121    [#2](/bitcoin-bitcoin/2/) __gthread_recursive_mutex_lock(pthread_mutex_t*) /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:824:10 (test_bitcoin+0xd68783)
    122    [#3](/bitcoin-bitcoin/3/) std::recursive_mutex::lock() /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/mutex:125:17 (test_bitcoin+0xd68783)
    123    [#4](/bitcoin-bitcoin/4/) std::unique_lock<std::recursive_mutex>::lock() /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/unique_lock.h:147:17 (test_bitcoin+0xd68783)
    124    [#5](/bitcoin-bitcoin/5/) UniqueLock<AnnotatedMixin<std::recursive_mutex>>::Enter(char const*, char const*, int) src/./sync.h:163:15 (test_bitcoin+0xd68783)
    125    [#6](/bitcoin-bitcoin/6/) UniqueLock<AnnotatedMixin<std::recursive_mutex>>::UniqueLock(AnnotatedMixin<std::recursive_mutex>&, char const*, char const*, int, bool) src/./sync.h:182:13 (test_bitcoin+0xd68783)
    126    [#7](/bitcoin-bitcoin/7/) ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_0::operator()() const src/test/util/setup_common.cpp:263:9 (test_bitcoin+0xd68783)
    127    [#8](/bitcoin-bitcoin/8/) void std::__invoke_impl<void, ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_0&>(std::__invoke_other, ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_0&) /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/invoke.h:61:14 (test_bitcoin+0xd68783)
    128    [#9](/bitcoin-bitcoin/9/) std::enable_if<is_invocable_r_v<void, ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_0&>, void>::type std::__invoke_r<void, ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_0&>(ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_0&) /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/invoke.h:111:2 (test_bitcoin+0xd68783)
    129    [#10](/bitcoin-bitcoin/10/) std::_Function_handler<void (), ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts)::$_0>::_M_invoke(std::_Any_data const&) /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/std_function.h:290:9 (test_bitcoin+0xd68783)
    130    [#11](/bitcoin-bitcoin/11/) std::function<void ()>::operator()() const /usr/bin/../lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/std_function.h:591:9 (test_bitcoin+0xd60281) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    131    [#12](/bitcoin-bitcoin/12/) ChainTestingSetup::ChainTestingSetup(ChainType, TestOpts) src/test/util/setup_common.cpp:270:5 (test_bitcoin+0xd60281)
    132    [#13](/bitcoin-bitcoin/13/) TestingSetup::TestingSetup(ChainType, TestOpts) src/test/util/setup_common.cpp:317:7 (test_bitcoin+0xd610c3) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    133    [#14](/bitcoin-bitcoin/14/) TestChain100Setup::TestChain100Setup(ChainType, TestOpts) src/test/util/setup_common.cpp:353:7 (test_bitcoin+0xd61a2a) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    134    [#15](/bitcoin-bitcoin/15/) wallet::wallet_tests::ListCoinsTestingSetup::ListCoinsTestingSetup() src/wallet/test/wallet_tests.cpp:548:5 (test_bitcoin+0xcbe0c1) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    135    [#16](/bitcoin-bitcoin/16/) wallet::wallet_tests::ListCoinsTest::ListCoinsTest() src/wallet/test/wallet_tests.cpp:588:1 (test_bitcoin+0xc9e6e5) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    136    [#17](/bitcoin-bitcoin/17/) wallet::wallet_tests::ListCoinsTest_invoker() src/wallet/test/wallet_tests.cpp:588:1 (test_bitcoin+0xc9e6e5)
    137    [#18](/bitcoin-bitcoin/18/) boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) /usr/include/boost/function/function_template.hpp:117:11 (test_bitcoin+0x2f1cfd) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    138    [#19](/bitcoin-bitcoin/19/) boost::function0<void>::operator()() const /usr/include/boost/function/function_template.hpp:771:14 (test_bitcoin+0x259698) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    139    [#20](/bitcoin-bitcoin/20/) boost::detail::forward::operator()() /usr/include/boost/test/impl/execution_monitor.ipp:1395:32 (test_bitcoin+0x259698)
    140    [#21](/bitcoin-bitcoin/21/) boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) /usr/include/boost/function/function_template.hpp:137:18 (test_bitcoin+0x259698)
    141    [#22](/bitcoin-bitcoin/22/) boost::function0<int>::operator()() const /usr/include/boost/function/function_template.hpp:771:14 (test_bitcoin+0x1d7503) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    142    [#23](/bitcoin-bitcoin/23/) int boost::detail::do_invoke<boost::shared_ptr<boost::detail::translator_holder_base>, boost::function<int ()>>(boost::shared_ptr<boost::detail::translator_holder_base> const&, boost::function<int ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:308:30 (test_bitcoin+0x1d7503)
    143    [#24](/bitcoin-bitcoin/24/) boost::execution_monitor::catch_signals(boost::function<int ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:910:16 (test_bitcoin+0x1d7503)
    144    [#25](/bitcoin-bitcoin/25/) boost::execution_monitor::execute(boost::function<int ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:1308:16 (test_bitcoin+0x1d787a) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    145    [#26](/bitcoin-bitcoin/26/) boost::execution_monitor::vexecute(boost::function<void ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:1404:5 (test_bitcoin+0x1d3120) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    146    [#27](/bitcoin-bitcoin/27/) boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned long) /usr/include/boost/test/impl/unit_test_monitor.ipp:49:9 (test_bitcoin+0x1d3120)
    147    [#28](/bitcoin-bitcoin/28/) boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /usr/include/boost/test/impl/framework.ipp:815:44 (test_bitcoin+0x20c58e) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    148    [#29](/bitcoin-bitcoin/29/) boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /usr/include/boost/test/impl/framework.ipp:740:54 (test_bitcoin+0x20c77b) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    149    [#30](/bitcoin-bitcoin/30/) boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /usr/include/boost/test/impl/framework.ipp:740:54 (test_bitcoin+0x20c77b) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    150    [#31](/bitcoin-bitcoin/31/) boost::unit_test::framework::run(unsigned long, bool) /usr/include/boost/test/impl/framework.ipp:1722:29 (test_bitcoin+0x1d1deb) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    151    [#32](/bitcoin-bitcoin/32/) boost::unit_test::unit_test_main(boost::unit_test::test_suite* (*)(int, char**), int, char**) /usr/include/boost/test/impl/unit_test_main.ipp:250:9 (test_bitcoin+0x1ef01d) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    152    [#33](/bitcoin-bitcoin/33/) main /usr/include/boost/test/impl/unit_test_main.ipp:306:12 (test_bitcoin+0x1ef823) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d)
    153
    154SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) (/bitcoin-core/src/test/test_bitcoin+0x13e17e) (BuildId: 55ce10099d6fabd327557ca5145f6ca8331c3a5d) in pthread_mutex_lock
    155==================
    
  12. maflcko commented at 1:48 pm on August 30, 2024: member
    It happens since fa386642b4dfd88f74488c288c7886494d69f4ed, which added a missing lock on cs_main.
  13. maflcko renamed this:
    wallet: WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=32090)
    test: WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=32090)
    on Aug 30, 2024
  14. nanlour commented at 10:57 am on September 17, 2024: contributor
    This looks like a false positive. ThreadSanitizer incorrectly counts cs_wallet and cs_args as the same lock because they are mapped to the same memory address. I tried adding padding to distribute the memory mapping, as done in commit c551ea17c93f59abb2df2f8a66e381973291a5e3, and it successfully silenced the warning.

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-03 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me