./src/test/test_bitcoin fails with TSan on x86_64 #18823

issue hebasto openend this issue on April 30, 2020
  1. hebasto commented at 3:46 am on April 30, 2020: member

    Building master (36c0abd8f61ba859d53b1e59014720282c97c143) on Linux Mint 19.3 (x86_64):

    0$ ./configure --with-sanitizers=thread --disable-asm CC=clang-8 CXX=clang++-8
    1$ make clean && make
    2$ ./src/test/test_bitcoin
    3...
    4*** 1 failure is detected in the test module "Bitcoin Core Test Suite"
    5ThreadSanitizer: reported 3011 warnings
    

    Related to #17540.

  2. hebasto added the label Bug on Apr 30, 2020
  3. MarcoFalke commented at 12:03 pm on April 30, 2020: member
    What are the warnings and failures? Without them there is nothing we can fix or troubleshoot.
  4. practicalswift commented at 2:48 pm on April 30, 2020: contributor
    @hebasto Thanks for reporting. We test with --with-sanitizers=thread in the Travis ci/test/00_setup_env_native_tsan.sh job, so if this turns out to be a general issue then it would be interesting to know why the ThreadSanitizer Travis job didn’t fail :)
  5. hebasto commented at 6:41 pm on April 30, 2020: member

    What are the warnings and failures? Without them there is nothing we can fix or troubleshoot.

    Sorry. Initially, the GH failed to upload the whole log.

    Here is a typical excerpt from the log:

     0==================
     1WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=11525)
     2  Cycle in lock order graph: M506513391043629040 (0x000000000000) => M1053137795832139960 (0x000000000000) => M1044975021507526992 (0x000000000000) => M1022457023370664312 (0x000000000000) => M1028930947835011848 (0x000000000000) => M506513391043629040
     3
     4  Mutex M1053137795832139960 acquired here while holding mutex M506513391043629040 in main thread:
     5    [#0](/bitcoin-bitcoin/0/) pthread_rwlock_wrlock <null> (test_bitcoin+0xc5d0e)
     6    [#1](/bitcoin-bitcoin/1/) __db_pthread_mutex_lock <null> (libdb_cxx-4.8.so+0x3d2a5)
     7    [#2](/bitcoin-bitcoin/2/) bool WalletBatch::WriteIC<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, CPubKey>, std::pair<std::vector<unsigned char, secure_allocator<unsigned char> >, uint256> >(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, CPubKey> const&, std::pair<std::vector<unsigned char, secure_allocator<unsigned char> >, uint256> const&, bool) /home/hebasto/GitHub/bitcoin/src/./wallet/walletdb.h:187:22 (test_bitcoin+0xe4c78e)
     8    [#3](/bitcoin-bitcoin/3/) WalletBatch::WriteKey(CPubKey const&, std::vector<unsigned char, secure_allocator<unsigned char> > const&, CKeyMetadata const&) /home/hebasto/GitHub/bitcoin/src/wallet/walletdb.cpp:107 (test_bitcoin+0xe4c78e)
     9    [#4](/bitcoin-bitcoin/4/) LegacyScriptPubKeyMan::AddKeyPubKeyWithDB(WalletBatch&, CKey const&, CPubKey const&) /home/hebasto/GitHub/bitcoin/src/wallet/scriptpubkeyman.cpp:657:22 (test_bitcoin+0xdd669d)
    10    [#5](/bitcoin-bitcoin/5/) LegacyScriptPubKeyMan::GenerateNewKey(WalletBatch&, bool) /home/hebasto/GitHub/bitcoin/src/wallet/scriptpubkeyman.cpp:955:10 (test_bitcoin+0xdd9554)
    11    [#6](/bitcoin-bitcoin/6/) LegacyScriptPubKeyMan::TopUp(unsigned int) /home/hebasto/GitHub/bitcoin/src/wallet/scriptpubkeyman.cpp:1170:28 (test_bitcoin+0xddcb11)
    12    [#7](/bitcoin-bitcoin/7/) CWallet::GetNewDestination(OutputType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<CNoDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessUnknown>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) /home/hebasto/GitHub/bitcoin/src/wallet/wallet.cpp:3236:18 (test_bitcoin+0xe24b70)
    13    [#8](/bitcoin-bitcoin/8/) coinselector_tests::add_coin(CWallet&, long const&, int, bool, int, bool) /home/hebasto/GitHub/bitcoin/src/wallet/test/coinselector_tests.cpp:69:9 (test_bitcoin+0x824687)
    14    [#9](/bitcoin-bitcoin/9/) coinselector_tests::bnb_search_test::test_method() /home/hebasto/GitHub/bitcoin/src/wallet/test/coinselector_tests.cpp:296:9 (test_bitcoin+0x820de5)
    15    [#10](/bitcoin-bitcoin/10/) coinselector_tests::bnb_search_test_invoker() /home/hebasto/GitHub/bitcoin/src/wallet/test/coinselector_tests.cpp:135:1 (test_bitcoin+0x81a9bb)
    16    [#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:118:11 (test_bitcoin+0x1a51f9)
    17    [#12](/bitcoin-bitcoin/12/) boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) <null> (libboost_unit_test_framework.so.1.65.1+0x4b2cd)
    18    [#13](/bitcoin-bitcoin/13/) __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310 (libc.so.6+0x21b96)
    19
    20    Hint: use TSAN_OPTIONS=second_deadlock_stack=1 to get more informative warning message
    21
    22  Mutex M1044975021507526992 acquired here while holding mutex M1053137795832139960 in main thread:
    23    [#0](/bitcoin-bitcoin/0/) pthread_rwlock_wrlock <null> (test_bitcoin+0xc5d0e)
    24    [#1](/bitcoin-bitcoin/1/) __db_pthread_mutex_lock <null> (libdb_cxx-4.8.so+0x3d2a5)
    25    [#2](/bitcoin-bitcoin/2/) bool WalletBatch::WriteIC<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, CPubKey>, std::pair<std::vector<unsigned char, secure_allocator<unsigned char> >, uint256> >(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, CPubKey> const&, std::pair<std::vector<unsigned char, secure_allocator<unsigned char> >, uint256> const&, bool) /home/hebasto/GitHub/bitcoin/src/./wallet/walletdb.h:187:22 (test_bitcoin+0xe4c78e)
    26    [#3](/bitcoin-bitcoin/3/) WalletBatch::WriteKey(CPubKey const&, std::vector<unsigned char, secure_allocator<unsigned char> > const&, CKeyMetadata const&) /home/hebasto/GitHub/bitcoin/src/wallet/walletdb.cpp:107 (test_bitcoin+0xe4c78e)
    27    [#4](/bitcoin-bitcoin/4/) LegacyScriptPubKeyMan::AddKeyPubKeyWithDB(WalletBatch&, CKey const&, CPubKey const&) /home/hebasto/GitHub/bitcoin/src/wallet/scriptpubkeyman.cpp:657:22 (test_bitcoin+0xdd669d)
    28    [#5](/bitcoin-bitcoin/5/) LegacyScriptPubKeyMan::GenerateNewKey(WalletBatch&, bool) /home/hebasto/GitHub/bitcoin/src/wallet/scriptpubkeyman.cpp:955:10 (test_bitcoin+0xdd9554)
    29    [#6](/bitcoin-bitcoin/6/) LegacyScriptPubKeyMan::TopUp(unsigned int) /home/hebasto/GitHub/bitcoin/src/wallet/scriptpubkeyman.cpp:1170:28 (test_bitcoin+0xddcb11)
    30    [#7](/bitcoin-bitcoin/7/) CWallet::GetNewDestination(OutputType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<CNoDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessUnknown>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) /home/hebasto/GitHub/bitcoin/src/wallet/wallet.cpp:3236:18 (test_bitcoin+0xe24b70)
    31    [#8](/bitcoin-bitcoin/8/) coinselector_tests::add_coin(CWallet&, long const&, int, bool, int, bool) /home/hebasto/GitHub/bitcoin/src/wallet/test/coinselector_tests.cpp:69:9 (test_bitcoin+0x824687)
    32    [#9](/bitcoin-bitcoin/9/) coinselector_tests::bnb_search_test::test_method() /home/hebasto/GitHub/bitcoin/src/wallet/test/coinselector_tests.cpp:296:9 (test_bitcoin+0x820de5)
    33    [#10](/bitcoin-bitcoin/10/) coinselector_tests::bnb_search_test_invoker() /home/hebasto/GitHub/bitcoin/src/wallet/test/coinselector_tests.cpp:135:1 (test_bitcoin+0x81a9bb)
    34    [#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:118:11 (test_bitcoin+0x1a51f9)
    35    [#12](/bitcoin-bitcoin/12/) boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) <null> (libboost_unit_test_framework.so.1.65.1+0x4b2cd)
    36    [#13](/bitcoin-bitcoin/13/) __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310 (libc.so.6+0x21b96)
    37
    38  Mutex M1022457023370664312 acquired here while holding mutex M1044975021507526992 in main thread:
    39    [#0](/bitcoin-bitcoin/0/) pthread_rwlock_wrlock <null> (test_bitcoin+0xc5d0e)
    40    [#1](/bitcoin-bitcoin/1/) __db_pthread_mutex_lock <null> (libdb_cxx-4.8.so+0x3d2a5)
    41    [#2](/bitcoin-bitcoin/2/) bool WalletBatch::WriteIC<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, CPubKey>, std::pair<std::vector<unsigned char, secure_allocator<unsigned char> >, uint256> >(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, CPubKey> const&, std::pair<std::vector<unsigned char, secure_allocator<unsigned char> >, uint256> const&, bool) /home/hebasto/GitHub/bitcoin/src/./wallet/walletdb.h:187:22 (test_bitcoin+0xe4c78e)
    42    [#3](/bitcoin-bitcoin/3/) WalletBatch::WriteKey(CPubKey const&, std::vector<unsigned char, secure_allocator<unsigned char> > const&, CKeyMetadata const&) /home/hebasto/GitHub/bitcoin/src/wallet/walletdb.cpp:107 (test_bitcoin+0xe4c78e)
    43    [#4](/bitcoin-bitcoin/4/) LegacyScriptPubKeyMan::AddKeyPubKeyWithDB(WalletBatch&, CKey const&, CPubKey const&) /home/hebasto/GitHub/bitcoin/src/wallet/scriptpubkeyman.cpp:657:22 (test_bitcoin+0xdd669d)
    44    [#5](/bitcoin-bitcoin/5/) LegacyScriptPubKeyMan::GenerateNewKey(WalletBatch&, bool) /home/hebasto/GitHub/bitcoin/src/wallet/scriptpubkeyman.cpp:955:10 (test_bitcoin+0xdd9554)
    45    [#6](/bitcoin-bitcoin/6/) LegacyScriptPubKeyMan::TopUp(unsigned int) /home/hebasto/GitHub/bitcoin/src/wallet/scriptpubkeyman.cpp:1170:28 (test_bitcoin+0xddcb11)
    46    [#7](/bitcoin-bitcoin/7/) CWallet::GetNewDestination(OutputType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<CNoDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessUnknown>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) /home/hebasto/GitHub/bitcoin/src/wallet/wallet.cpp:3236:18 (test_bitcoin+0xe24b70)
    47    [#8](/bitcoin-bitcoin/8/) coinselector_tests::add_coin(CWallet&, long const&, int, bool, int, bool) /home/hebasto/GitHub/bitcoin/src/wallet/test/coinselector_tests.cpp:69:9 (test_bitcoin+0x824687)
    48    [#9](/bitcoin-bitcoin/9/) coinselector_tests::bnb_search_test::test_method() /home/hebasto/GitHub/bitcoin/src/wallet/test/coinselector_tests.cpp:296:9 (test_bitcoin+0x820de5)
    49    [#10](/bitcoin-bitcoin/10/) coinselector_tests::bnb_search_test_invoker() /home/hebasto/GitHub/bitcoin/src/wallet/test/coinselector_tests.cpp:135:1 (test_bitcoin+0x81a9bb)
    50    [#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:118:11 (test_bitcoin+0x1a51f9)
    51    [#12](/bitcoin-bitcoin/12/) boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) <null> (libboost_unit_test_framework.so.1.65.1+0x4b2cd)
    52    [#13](/bitcoin-bitcoin/13/) __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310 (libc.so.6+0x21b96)
    53
    54  Mutex M1028930947835011848 acquired here while holding mutex M1022457023370664312 in main thread:
    55    [#0](/bitcoin-bitcoin/0/) pthread_rwlock_wrlock <null> (test_bitcoin+0xc5d0e)
    56    [#1](/bitcoin-bitcoin/1/) __db_pthread_mutex_lock <null> (libdb_cxx-4.8.so+0x3d2a5)
    57    [#2](/bitcoin-bitcoin/2/) bool WalletBatch::WriteIC<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, CPubKey>, std::pair<std::vector<unsigned char, secure_allocator<unsigned char> >, uint256> >(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, CPubKey> const&, std::pair<std::vector<unsigned char, secure_allocator<unsigned char> >, uint256> const&, bool) /home/hebasto/GitHub/bitcoin/src/./wallet/walletdb.h:187:22 (test_bitcoin+0xe4c78e)
    58    [#3](/bitcoin-bitcoin/3/) WalletBatch::WriteKey(CPubKey const&, std::vector<unsigned char, secure_allocator<unsigned char> > const&, CKeyMetadata const&) /home/hebasto/GitHub/bitcoin/src/wallet/walletdb.cpp:107 (test_bitcoin+0xe4c78e)
    59    [#4](/bitcoin-bitcoin/4/) LegacyScriptPubKeyMan::AddKeyPubKeyWithDB(WalletBatch&, CKey const&, CPubKey const&) /home/hebasto/GitHub/bitcoin/src/wallet/scriptpubkeyman.cpp:657:22 (test_bitcoin+0xdd669d)
    60    [#5](/bitcoin-bitcoin/5/) LegacyScriptPubKeyMan::GenerateNewKey(WalletBatch&, bool) /home/hebasto/GitHub/bitcoin/src/wallet/scriptpubkeyman.cpp:955:10 (test_bitcoin+0xdd9554)
    61    [#6](/bitcoin-bitcoin/6/) LegacyScriptPubKeyMan::TopUp(unsigned int) /home/hebasto/GitHub/bitcoin/src/wallet/scriptpubkeyman.cpp:1170:28 (test_bitcoin+0xddcb11)
    62    [#7](/bitcoin-bitcoin/7/) CWallet::GetNewDestination(OutputType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<CNoDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessUnknown>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) /home/hebasto/GitHub/bitcoin/src/wallet/wallet.cpp:3236:18 (test_bitcoin+0xe24b70)
    63    [#8](/bitcoin-bitcoin/8/) coinselector_tests::add_coin(CWallet&, long const&, int, bool, int, bool) /home/hebasto/GitHub/bitcoin/src/wallet/test/coinselector_tests.cpp:69:9 (test_bitcoin+0x824687)
    64    [#9](/bitcoin-bitcoin/9/) coinselector_tests::bnb_search_test::test_method() /home/hebasto/GitHub/bitcoin/src/wallet/test/coinselector_tests.cpp:296:9 (test_bitcoin+0x820de5)
    65    [#10](/bitcoin-bitcoin/10/) coinselector_tests::bnb_search_test_invoker() /home/hebasto/GitHub/bitcoin/src/wallet/test/coinselector_tests.cpp:135:1 (test_bitcoin+0x81a9bb)
    66    [#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:118:11 (test_bitcoin+0x1a51f9)
    67    [#12](/bitcoin-bitcoin/12/) boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) <null> (libboost_unit_test_framework.so.1.65.1+0x4b2cd)
    68    [#13](/bitcoin-bitcoin/13/) __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310 (libc.so.6+0x21b96)
    69
    70  Mutex M506513391043629040 acquired here while holding mutex M1028930947835011848 in main thread:
    71    [#0](/bitcoin-bitcoin/0/) pthread_rwlock_rdlock <null> (test_bitcoin+0xc591e)
    72    [#1](/bitcoin-bitcoin/1/) __db_pthread_mutex_readlock <null> (libdb_cxx-4.8.so+0x3d505)
    73    [#2](/bitcoin-bitcoin/2/) bool WalletBatch::WriteIC<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, CPubKey>, std::pair<std::vector<unsigned char, secure_allocator<unsigned char> >, uint256> >(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, CPubKey> const&, std::pair<std::vector<unsigned char, secure_allocator<unsigned char> >, uint256> const&, bool) /home/hebasto/GitHub/bitcoin/src/./wallet/walletdb.h:187:22 (test_bitcoin+0xe4c78e)
    74    [#3](/bitcoin-bitcoin/3/) WalletBatch::WriteKey(CPubKey const&, std::vector<unsigned char, secure_allocator<unsigned char> > const&, CKeyMetadata const&) /home/hebasto/GitHub/bitcoin/src/wallet/walletdb.cpp:107 (test_bitcoin+0xe4c78e)
    75    [#4](/bitcoin-bitcoin/4/) LegacyScriptPubKeyMan::AddKeyPubKeyWithDB(WalletBatch&, CKey const&, CPubKey const&) /home/hebasto/GitHub/bitcoin/src/wallet/scriptpubkeyman.cpp:657:22 (test_bitcoin+0xdd669d)
    76    [#5](/bitcoin-bitcoin/5/) LegacyScriptPubKeyMan::GenerateNewKey(WalletBatch&, bool) /home/hebasto/GitHub/bitcoin/src/wallet/scriptpubkeyman.cpp:955:10 (test_bitcoin+0xdd9554)
    77    [#6](/bitcoin-bitcoin/6/) LegacyScriptPubKeyMan::TopUp(unsigned int) /home/hebasto/GitHub/bitcoin/src/wallet/scriptpubkeyman.cpp:1170:28 (test_bitcoin+0xddcb11)
    78    [#7](/bitcoin-bitcoin/7/) CWallet::GetNewDestination(OutputType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<CNoDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessUnknown>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) /home/hebasto/GitHub/bitcoin/src/wallet/wallet.cpp:3236:18 (test_bitcoin+0xe24b70)
    79    [#8](/bitcoin-bitcoin/8/) coinselector_tests::add_coin(CWallet&, long const&, int, bool, int, bool) /home/hebasto/GitHub/bitcoin/src/wallet/test/coinselector_tests.cpp:69:9 (test_bitcoin+0x824687)
    80    [#9](/bitcoin-bitcoin/9/) coinselector_tests::bnb_search_test::test_method() /home/hebasto/GitHub/bitcoin/src/wallet/test/coinselector_tests.cpp:296:9 (test_bitcoin+0x820de5)
    81    [#10](/bitcoin-bitcoin/10/) coinselector_tests::bnb_search_test_invoker() /home/hebasto/GitHub/bitcoin/src/wallet/test/coinselector_tests.cpp:135:1 (test_bitcoin+0x81a9bb)
    82    [#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:118:11 (test_bitcoin+0x1a51f9)
    83    [#12](/bitcoin-bitcoin/12/) boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) <null> (libboost_unit_test_framework.so.1.65.1+0x4b2cd)
    84    [#13](/bitcoin-bitcoin/13/) __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310 (libc.so.6+0x21b96)
    85
    86SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) (/home/hebasto/GitHub/bitcoin/src/test/test_bitcoin+0xc5d0e) in __interceptor_pthread_rwlock_wrlock
    87==================
    
  6. hebasto commented at 7:01 pm on April 30, 2020: member

    @hebasto Thanks for reporting. We test with --with-sanitizers=thread in the Travis ci/test/00_setup_env_native_tsan.sh job, so if this turns out to be a general issue then it would be interesting to know why the ThreadSanitizer Travis job didn’t fail :)

    After adding --disable-wallet to the configure options all of the libdb-related warnings gone. Do we have documented it somewhere?

    The remaining warnings are only from the sync_tests:

     0$ ./configure --disable-wallet --with-sanitizers=thread --disable-asm CC=clang-8 CXX=clang++-8
     1$ make clean && make
     2$ ./src/test/test_bitcoin --run_test=sync_tests
     3Running 1 test case...
     4==================
     5WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=22149)
     6  Cycle in lock order graph: M131473 (0x7ffedb5970e8) => M131474 (0x7ffedb5970c0) => M131473
     7
     8  Mutex M131474 acquired here while holding mutex M131473 in main thread:
     9    [#0](/bitcoin-bitcoin/0/) pthread_mutex_lock <null> (test_bitcoin+0xcdfde)
    10    [#1](/bitcoin-bitcoin/1/) __gthread_mutex_lock(pthread_mutex_t*) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8/bits/gthr-default.h:748:12 (test_bitcoin+0x636c75)
    11    [#2](/bitcoin-bitcoin/2/) __gthread_recursive_mutex_lock(pthread_mutex_t*) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8/bits/gthr-default.h:810 (test_bitcoin+0x636c75)
    12    [#3](/bitcoin-bitcoin/3/) std::recursive_mutex::lock() /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/mutex:107 (test_bitcoin+0x636c75)
    13    [#4](/bitcoin-bitcoin/4/) std::unique_lock<std::recursive_mutex>::lock() /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/std_mutex.h:267 (test_bitcoin+0x636c75)
    14    [#5](/bitcoin-bitcoin/5/) UniqueLock<AnnotatedMixin<std::recursive_mutex>, std::unique_lock<std::recursive_mutex> >::Enter(char const*, char const*, int) /home/hebasto/GitHub/bitcoin/src/./sync.h:131 (test_bitcoin+0x636c75)
    15    [#6](/bitcoin-bitcoin/6/) UniqueLock<AnnotatedMixin<std::recursive_mutex>, std::unique_lock<std::recursive_mutex> >::UniqueLock(AnnotatedMixin<std::recursive_mutex>&, char const*, char const*, int, bool) /home/hebasto/GitHub/bitcoin/src/./sync.h:152 (test_bitcoin+0x636c75)
    16    [#7](/bitcoin-bitcoin/7/) void (anonymous namespace)::TestPotentialDeadLockDetected<AnnotatedMixin<std::recursive_mutex> >(AnnotatedMixin<std::recursive_mutex>&, AnnotatedMixin<std::recursive_mutex>&) /home/hebasto/GitHub/bitcoin/src/test/sync_tests.cpp:15 (test_bitcoin+0x636c75)
    17    [#8](/bitcoin-bitcoin/8/) sync_tests::potential_deadlock_detected::test_method() /home/hebasto/GitHub/bitcoin/src/test/sync_tests.cpp:42 (test_bitcoin+0x636c75)
    18    [#9](/bitcoin-bitcoin/9/) sync_tests::potential_deadlock_detected_invoker() /home/hebasto/GitHub/bitcoin/src/test/sync_tests.cpp:34:1 (test_bitcoin+0x636467)
    19    [#10](/bitcoin-bitcoin/10/) boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) /usr/include/boost/function/function_template.hpp:118:11 (test_bitcoin+0x17ec99)
    20    [#11](/bitcoin-bitcoin/11/) boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) <null> (libboost_unit_test_framework.so.1.65.1+0x4b2cd)
    21    [#12](/bitcoin-bitcoin/12/) __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310 (libc.so.6+0x21b96)
    22
    23    Hint: use TSAN_OPTIONS=second_deadlock_stack=1 to get more informative warning message
    24
    25  Mutex M131473 acquired here while holding mutex M131474 in main thread:
    26    [#0](/bitcoin-bitcoin/0/) pthread_mutex_lock <null> (test_bitcoin+0xcdfde)
    27    [#1](/bitcoin-bitcoin/1/) __gthread_mutex_lock(pthread_mutex_t*) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8/bits/gthr-default.h:748:12 (test_bitcoin+0x636ccb)
    28    [#2](/bitcoin-bitcoin/2/) __gthread_recursive_mutex_lock(pthread_mutex_t*) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8/bits/gthr-default.h:810 (test_bitcoin+0x636ccb)
    29    [#3](/bitcoin-bitcoin/3/) std::recursive_mutex::lock() /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/mutex:107 (test_bitcoin+0x636ccb)
    30    [#4](/bitcoin-bitcoin/4/) std::unique_lock<std::recursive_mutex>::lock() /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/std_mutex.h:267 (test_bitcoin+0x636ccb)
    31    [#5](/bitcoin-bitcoin/5/) UniqueLock<AnnotatedMixin<std::recursive_mutex>, std::unique_lock<std::recursive_mutex> >::Enter(char const*, char const*, int) /home/hebasto/GitHub/bitcoin/src/./sync.h:131 (test_bitcoin+0x636ccb)
    32    [#6](/bitcoin-bitcoin/6/) UniqueLock<AnnotatedMixin<std::recursive_mutex>, std::unique_lock<std::recursive_mutex> >::UniqueLock(AnnotatedMixin<std::recursive_mutex>&, char const*, char const*, int, bool) /home/hebasto/GitHub/bitcoin/src/./sync.h:152 (test_bitcoin+0x636ccb)
    33    [#7](/bitcoin-bitcoin/7/) void (anonymous namespace)::TestPotentialDeadLockDetected<AnnotatedMixin<std::recursive_mutex> >(AnnotatedMixin<std::recursive_mutex>&, AnnotatedMixin<std::recursive_mutex>&) /home/hebasto/GitHub/bitcoin/src/test/sync_tests.cpp:19 (test_bitcoin+0x636ccb)
    34    [#8](/bitcoin-bitcoin/8/) sync_tests::potential_deadlock_detected::test_method() /home/hebasto/GitHub/bitcoin/src/test/sync_tests.cpp:42 (test_bitcoin+0x636ccb)
    35    [#9](/bitcoin-bitcoin/9/) sync_tests::potential_deadlock_detected_invoker() /home/hebasto/GitHub/bitcoin/src/test/sync_tests.cpp:34:1 (test_bitcoin+0x636467)
    36    [#10](/bitcoin-bitcoin/10/) boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) /usr/include/boost/function/function_template.hpp:118:11 (test_bitcoin+0x17ec99)
    37    [#11](/bitcoin-bitcoin/11/) boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) <null> (libboost_unit_test_framework.so.1.65.1+0x4b2cd)
    38    [#12](/bitcoin-bitcoin/12/) __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310 (libc.so.6+0x21b96)
    39
    40SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) (/home/hebasto/GitHub/bitcoin/src/test/test_bitcoin+0xcdfde) in __interceptor_pthread_mutex_lock
    41==================
    42==================
    43WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=22149)
    44  Cycle in lock order graph: M131476 (0x7ffedb597098) => M131477 (0x7ffedb597070) => M131476
    45
    46  Mutex M131477 acquired here while holding mutex M131476 in main thread:
    47    [#0](/bitcoin-bitcoin/0/) pthread_mutex_lock <null> (test_bitcoin+0xcdfde)
    48    [#1](/bitcoin-bitcoin/1/) __gthread_mutex_lock(pthread_mutex_t*) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8/bits/gthr-default.h:748:12 (test_bitcoin+0x636f18)
    49    [#2](/bitcoin-bitcoin/2/) std::mutex::lock() /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/std_mutex.h:103 (test_bitcoin+0x636f18)
    50    [#3](/bitcoin-bitcoin/3/) std::unique_lock<std::mutex>::lock() /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/std_mutex.h:267 (test_bitcoin+0x636f18)
    51    [#4](/bitcoin-bitcoin/4/) UniqueLock<AnnotatedMixin<std::mutex>, std::unique_lock<std::mutex> >::Enter(char const*, char const*, int) /home/hebasto/GitHub/bitcoin/src/./sync.h:131 (test_bitcoin+0x636f18)
    52    [#5](/bitcoin-bitcoin/5/) UniqueLock<AnnotatedMixin<std::mutex>, std::unique_lock<std::mutex> >::UniqueLock(AnnotatedMixin<std::mutex>&, char const*, char const*, int, bool) /home/hebasto/GitHub/bitcoin/src/./sync.h:152 (test_bitcoin+0x636f18)
    53    [#6](/bitcoin-bitcoin/6/) void (anonymous namespace)::TestPotentialDeadLockDetected<AnnotatedMixin<std::mutex> >(AnnotatedMixin<std::mutex>&, AnnotatedMixin<std::mutex>&) /home/hebasto/GitHub/bitcoin/src/test/sync_tests.cpp:15 (test_bitcoin+0x636f18)
    54    [#7](/bitcoin-bitcoin/7/) sync_tests::potential_deadlock_detected::test_method() /home/hebasto/GitHub/bitcoin/src/test/sync_tests.cpp:45 (test_bitcoin+0x636f18)
    55    [#8](/bitcoin-bitcoin/8/) sync_tests::potential_deadlock_detected_invoker() /home/hebasto/GitHub/bitcoin/src/test/sync_tests.cpp:34:1 (test_bitcoin+0x636467)
    56    [#9](/bitcoin-bitcoin/9/) boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) /usr/include/boost/function/function_template.hpp:118:11 (test_bitcoin+0x17ec99)
    57    [#10](/bitcoin-bitcoin/10/) boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) <null> (libboost_unit_test_framework.so.1.65.1+0x4b2cd)
    58    [#11](/bitcoin-bitcoin/11/) __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310 (libc.so.6+0x21b96)
    59
    60    Hint: use TSAN_OPTIONS=second_deadlock_stack=1 to get more informative warning message
    61
    62  Mutex M131476 acquired here while holding mutex M131477 in main thread:
    63    [#0](/bitcoin-bitcoin/0/) pthread_mutex_lock <null> (test_bitcoin+0xcdfde)
    64    [#1](/bitcoin-bitcoin/1/) __gthread_mutex_lock(pthread_mutex_t*) /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8/bits/gthr-default.h:748:12 (test_bitcoin+0x636f65)
    65    [#2](/bitcoin-bitcoin/2/) std::mutex::lock() /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/std_mutex.h:103 (test_bitcoin+0x636f65)
    66    [#3](/bitcoin-bitcoin/3/) std::unique_lock<std::mutex>::lock() /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/std_mutex.h:267 (test_bitcoin+0x636f65)
    67    [#4](/bitcoin-bitcoin/4/) UniqueLock<AnnotatedMixin<std::mutex>, std::unique_lock<std::mutex> >::Enter(char const*, char const*, int) /home/hebasto/GitHub/bitcoin/src/./sync.h:131 (test_bitcoin+0x636f65)
    68    [#5](/bitcoin-bitcoin/5/) UniqueLock<AnnotatedMixin<std::mutex>, std::unique_lock<std::mutex> >::UniqueLock(AnnotatedMixin<std::mutex>&, char const*, char const*, int, bool) /home/hebasto/GitHub/bitcoin/src/./sync.h:152 (test_bitcoin+0x636f65)
    69    [#6](/bitcoin-bitcoin/6/) void (anonymous namespace)::TestPotentialDeadLockDetected<AnnotatedMixin<std::mutex> >(AnnotatedMixin<std::mutex>&, AnnotatedMixin<std::mutex>&) /home/hebasto/GitHub/bitcoin/src/test/sync_tests.cpp:19 (test_bitcoin+0x636f65)
    70    [#7](/bitcoin-bitcoin/7/) sync_tests::potential_deadlock_detected::test_method() /home/hebasto/GitHub/bitcoin/src/test/sync_tests.cpp:45 (test_bitcoin+0x636f65)
    71    [#8](/bitcoin-bitcoin/8/) sync_tests::potential_deadlock_detected_invoker() /home/hebasto/GitHub/bitcoin/src/test/sync_tests.cpp:34:1 (test_bitcoin+0x636467)
    72    [#9](/bitcoin-bitcoin/9/) boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) /usr/include/boost/function/function_template.hpp:118:11 (test_bitcoin+0x17ec99)
    73    [#10](/bitcoin-bitcoin/10/) boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) <null> (libboost_unit_test_framework.so.1.65.1+0x4b2cd)
    74    [#11](/bitcoin-bitcoin/11/) __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310 (libc.so.6+0x21b96)
    75
    76SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) (/home/hebasto/GitHub/bitcoin/src/test/test_bitcoin+0xcdfde) in __interceptor_pthread_mutex_lock
    77==================
    78
    79*** No errors detected
    80ThreadSanitizer: reported 2 warnings
    
  7. MarcoFalke commented at 11:53 pm on May 8, 2020: member

    I don’t think it is possible to run tsan on BDB.

    Have you seen the suppressions in ./test/sanitizer_suppressions/tsan?

  8. hebasto commented at 6:53 am on May 22, 2020: member
    Closing in favor of #19047 which has cleaner problem description.
  9. hebasto closed this on May 22, 2020

  10. DrahtBot locked this on Feb 15, 2022

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-11-17 15:12 UTC

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