Skip to content

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Jun 28, 2023

Seems odd to use different timeouts.

Fix this by using the same timeout for all syncs.

May also fix #27355 or at least make it less frequent?

@DrahtBot
Copy link
Contributor

DrahtBot commented Jun 28, 2023

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK mzumsande
Approach ACK jonatack

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #26966 (index: blockfilter initial sync speedup, parallelize process by furszy)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@maflcko maflcko force-pushed the 2306-test-index-sync- branch from fac9a99 to fa08624 Compare June 28, 2023 10:45
@fanquake
Copy link
Member

Not sure what is happening here, but when testing this commit (rebased on master), on aarch64, make check just "dies" in the wallet tests? https://gist.github.com/fanquake/087fdff84b0d5379d94859de47a0e797

@maflcko
Copy link
Member Author

maflcko commented Jun 28, 2023

Ah, sorry that's a bug. Can you check log_path=${BASE_SCRATCH_DIR}/sanitizer-output/tsan?

@maflcko
Copy link
Member Author

maflcko commented Jun 28, 2023

Anyway, I'd guess it's the bdb upstream data race, so maybe for now try without bdb?

@fanquake
Copy link
Member

Ah, sorry that's a bug. Can you check log_path=${BASE_SCRATCH_DIR}/sanitizer-output/tsan?

# cat tsan.25230
==================
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=25230)
  Cycle in lock order graph: M0 (0xffff75666608) => M1 (0xffff7566a868) => M2 (0xffff7566aa18) => M0

  Mutex M1 acquired here while holding mutex M0 in main thread:
    #0 pthread_rwlock_wrlock <null> (test_bitcoin+0x1537a0) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #1 __db_pthread_mutex_lock <null> (test_bitcoin+0x12b09ec) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #2 wallet::BerkeleyBatch::BerkeleyBatch(wallet::BerkeleyDatabase&, bool, bool) src/wallet/bdb.cpp:325:14 (test_bitcoin+0xbc4cd4) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #3 std::__1::__unique_if<wallet::BerkeleyBatch>::__unique_single std::__1::make_unique[abi:v160000]<wallet::BerkeleyBatch, wallet::BerkeleyDatabase&, bool, bool&>(wallet::BerkeleyDatabase&, bool&&, bool&) /usr/lib/llvm-16/bin/../include/c++/v1/__memory/unique_ptr.h:686:30 (test_bitcoin+0xbcb4d0) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #4 wallet::BerkeleyDatabase::MakeBatch(bool) src/wallet/bdb.cpp:882:12 (test_bitcoin+0xbcb4d0)
    #5 wallet::WalletBatch::WalletBatch(wallet::WalletDatabase&, bool) src/./wallet/walletdb.h:222:26 (test_bitcoin+0xb586b0) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #6 wallet::CWallet::LoadWallet() src/wallet/wallet.cpp:2359:31 (test_bitcoin+0xb586b0)
    #7 wallet::CWallet::Create(wallet::WalletContext&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::unique_ptr<wallet::WalletDatabase, std::__1::default_delete<wallet::WalletDatabase>>, unsigned long, bilingual_str&, std::__1::vector<bilingual_str, std::__1::allocator<bilingual_str>>&) src/wallet/wallet.cpp:2923:47 (test_bitcoin+0xb3f774) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #8 wallet::TestLoadWallet(std::__1::unique_ptr<wallet::WalletDatabase, std::__1::default_delete<wallet::WalletDatabase>>, wallet::WalletContext&, unsigned long) src/wallet/test/util.cpp:53:19 (test_bitcoin+0xa3f760) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #9 wallet::TestLoadWallet(wallet::WalletContext&) src/wallet/test/util.cpp:69:12 (test_bitcoin+0xa3fa3c) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #10 wallet::wallet_tests::CreateWalletWithoutChain::test_method() src/wallet/test/wallet_tests.cpp:886:19 (test_bitcoin+0x9a7370) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #11 wallet::wallet_tests::CreateWalletWithoutChain_invoker() src/wallet/test/wallet_tests.cpp:882:1 (test_bitcoin+0x9a6ddc) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #12 boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:117:11 (test_bitcoin+0x2d7324) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #13 boost::function0<void>::operator()() const /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:763:14 (test_bitcoin+0x26795c) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #14 boost::detail::forward::operator()() /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1388:32 (test_bitcoin+0x26795c)
    #15 boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:137:18 (test_bitcoin+0x26795c)
    #16 boost::function0<int>::operator()() const /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:763:14 (test_bitcoin+0x1fb984) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #17 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&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:301:30 (test_bitcoin+0x1fb984)
    #18 boost::execution_monitor::catch_signals(boost::function<int ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:903:16 (test_bitcoin+0x1fb984)
    #19 boost::execution_monitor::execute(boost::function<int ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1301:16 (test_bitcoin+0x1fbc7c) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #20 boost::execution_monitor::vexecute(boost::function<void ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1397:5 (test_bitcoin+0x1f54c0) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #21 boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned long) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/unit_test_monitor.ipp:49:9 (test_bitcoin+0x1f54c0)
    #22 boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:815:44 (test_bitcoin+0x2253fc) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #23 boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:784:58 (test_bitcoin+0x225728) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #24 boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:784:58 (test_bitcoin+0x225728) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #25 boost::unit_test::framework::run(unsigned long, bool) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:1722:29 (test_bitcoin+0x1f4464) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #26 boost::unit_test::unit_test_main(boost::unit_test::test_suite* (*)(int, char**), int, char**) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/unit_test_main.ipp:250:9 (test_bitcoin+0x20ddc8) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #27 main /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/unit_test_main.ipp:306:12 (test_bitcoin+0x20e374) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)

    Hint: use TSAN_OPTIONS=second_deadlock_stack=1 to get more informative warning message

  Mutex M2 acquired here while holding mutex M1 in main thread:
    #0 pthread_rwlock_wrlock <null> (test_bitcoin+0x1537a0) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #1 __db_pthread_mutex_lock <null> (test_bitcoin+0x12b09ec) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #2 wallet::BerkeleyBatch::BerkeleyBatch(wallet::BerkeleyDatabase&, bool, bool) src/wallet/bdb.cpp:325:14 (test_bitcoin+0xbc4cd4) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #3 std::__1::__unique_if<wallet::BerkeleyBatch>::__unique_single std::__1::make_unique[abi:v160000]<wallet::BerkeleyBatch, wallet::BerkeleyDatabase&, bool, bool&>(wallet::BerkeleyDatabase&, bool&&, bool&) /usr/lib/llvm-16/bin/../include/c++/v1/__memory/unique_ptr.h:686:30 (test_bitcoin+0xbcb4d0) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #4 wallet::BerkeleyDatabase::MakeBatch(bool) src/wallet/bdb.cpp:882:12 (test_bitcoin+0xbcb4d0)
    #5 wallet::WalletBatch::WalletBatch(wallet::WalletDatabase&, bool) src/./wallet/walletdb.h:222:26 (test_bitcoin+0xb586b0) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #6 wallet::CWallet::LoadWallet() src/wallet/wallet.cpp:2359:31 (test_bitcoin+0xb586b0)
    #7 wallet::CWallet::Create(wallet::WalletContext&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::unique_ptr<wallet::WalletDatabase, std::__1::default_delete<wallet::WalletDatabase>>, unsigned long, bilingual_str&, std::__1::vector<bilingual_str, std::__1::allocator<bilingual_str>>&) src/wallet/wallet.cpp:2923:47 (test_bitcoin+0xb3f774) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #8 wallet::TestLoadWallet(std::__1::unique_ptr<wallet::WalletDatabase, std::__1::default_delete<wallet::WalletDatabase>>, wallet::WalletContext&, unsigned long) src/wallet/test/util.cpp:53:19 (test_bitcoin+0xa3f760) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #9 wallet::TestLoadWallet(wallet::WalletContext&) src/wallet/test/util.cpp:69:12 (test_bitcoin+0xa3fa3c) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #10 wallet::wallet_tests::CreateWalletWithoutChain::test_method() src/wallet/test/wallet_tests.cpp:886:19 (test_bitcoin+0x9a7370) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #11 wallet::wallet_tests::CreateWalletWithoutChain_invoker() src/wallet/test/wallet_tests.cpp:882:1 (test_bitcoin+0x9a6ddc) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #12 boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:117:11 (test_bitcoin+0x2d7324) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #13 boost::function0<void>::operator()() const /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:763:14 (test_bitcoin+0x26795c) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #14 boost::detail::forward::operator()() /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1388:32 (test_bitcoin+0x26795c)
    #15 boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:137:18 (test_bitcoin+0x26795c)
    #16 boost::function0<int>::operator()() const /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:763:14 (test_bitcoin+0x1fb984) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #17 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&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:301:30 (test_bitcoin+0x1fb984)
    #18 boost::execution_monitor::catch_signals(boost::function<int ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:903:16 (test_bitcoin+0x1fb984)
    #19 boost::execution_monitor::execute(boost::function<int ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1301:16 (test_bitcoin+0x1fbc7c) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #20 boost::execution_monitor::vexecute(boost::function<void ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1397:5 (test_bitcoin+0x1f54c0) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #21 boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned long) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/unit_test_monitor.ipp:49:9 (test_bitcoin+0x1f54c0)
    #22 boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:815:44 (test_bitcoin+0x2253fc) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #23 boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:784:58 (test_bitcoin+0x225728) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #24 boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:784:58 (test_bitcoin+0x225728) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #25 boost::unit_test::framework::run(unsigned long, bool) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:1722:29 (test_bitcoin+0x1f4464) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #26 boost::unit_test::unit_test_main(boost::unit_test::test_suite* (*)(int, char**), int, char**) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/unit_test_main.ipp:250:9 (test_bitcoin+0x20ddc8) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #27 main /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/unit_test_main.ipp:306:12 (test_bitcoin+0x20e374) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)

  Mutex M0 acquired here while holding mutex M2 in main thread:
    #0 pthread_rwlock_rdlock <null> (test_bitcoin+0x153234) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #1 __db_pthread_mutex_readlock <null> (test_bitcoin+0x12b0c80) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #2 wallet::BerkeleyBatch::BerkeleyBatch(wallet::BerkeleyDatabase&, bool, bool) src/wallet/bdb.cpp:325:14 (test_bitcoin+0xbc4cd4) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #3 std::__1::__unique_if<wallet::BerkeleyBatch>::__unique_single std::__1::make_unique[abi:v160000]<wallet::BerkeleyBatch, wallet::BerkeleyDatabase&, bool, bool&>(wallet::BerkeleyDatabase&, bool&&, bool&) /usr/lib/llvm-16/bin/../include/c++/v1/__memory/unique_ptr.h:686:30 (test_bitcoin+0xbcb4d0) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #4 wallet::BerkeleyDatabase::MakeBatch(bool) src/wallet/bdb.cpp:882:12 (test_bitcoin+0xbcb4d0)
    #5 wallet::WalletBatch::WalletBatch(wallet::WalletDatabase&, bool) src/./wallet/walletdb.h:222:26 (test_bitcoin+0xb586b0) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #6 wallet::CWallet::LoadWallet() src/wallet/wallet.cpp:2359:31 (test_bitcoin+0xb586b0)
    #7 wallet::CWallet::Create(wallet::WalletContext&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::unique_ptr<wallet::WalletDatabase, std::__1::default_delete<wallet::WalletDatabase>>, unsigned long, bilingual_str&, std::__1::vector<bilingual_str, std::__1::allocator<bilingual_str>>&) src/wallet/wallet.cpp:2923:47 (test_bitcoin+0xb3f774) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #8 wallet::TestLoadWallet(std::__1::unique_ptr<wallet::WalletDatabase, std::__1::default_delete<wallet::WalletDatabase>>, wallet::WalletContext&, unsigned long) src/wallet/test/util.cpp:53:19 (test_bitcoin+0xa3f760) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #9 wallet::TestLoadWallet(wallet::WalletContext&) src/wallet/test/util.cpp:69:12 (test_bitcoin+0xa3fa3c) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #10 wallet::wallet_tests::CreateWalletWithoutChain::test_method() src/wallet/test/wallet_tests.cpp:886:19 (test_bitcoin+0x9a7370) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #11 wallet::wallet_tests::CreateWalletWithoutChain_invoker() src/wallet/test/wallet_tests.cpp:882:1 (test_bitcoin+0x9a6ddc) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #12 boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:117:11 (test_bitcoin+0x2d7324) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #13 boost::function0<void>::operator()() const /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:763:14 (test_bitcoin+0x26795c) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #14 boost::detail::forward::operator()() /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1388:32 (test_bitcoin+0x26795c)
    #15 boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:137:18 (test_bitcoin+0x26795c)
    #16 boost::function0<int>::operator()() const /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:763:14 (test_bitcoin+0x1fb984) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #17 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&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:301:30 (test_bitcoin+0x1fb984)
    #18 boost::execution_monitor::catch_signals(boost::function<int ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:903:16 (test_bitcoin+0x1fb984)
    #19 boost::execution_monitor::execute(boost::function<int ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1301:16 (test_bitcoin+0x1fbc7c) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #20 boost::execution_monitor::vexecute(boost::function<void ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1397:5 (test_bitcoin+0x1f54c0) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #21 boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned long) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/unit_test_monitor.ipp:49:9 (test_bitcoin+0x1f54c0)
    #22 boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:815:44 (test_bitcoin+0x2253fc) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #23 boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:784:58 (test_bitcoin+0x225728) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #24 boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:784:58 (test_bitcoin+0x225728) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #25 boost::unit_test::framework::run(unsigned long, bool) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:1722:29 (test_bitcoin+0x1f4464) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #26 boost::unit_test::unit_test_main(boost::unit_test::test_suite* (*)(int, char**), int, char**) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/unit_test_main.ipp:250:9 (test_bitcoin+0x20ddc8) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #27 main /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/unit_test_main.ipp:306:12 (test_bitcoin+0x20e374) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)

SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) (/home/fedora/ci_scratch/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/src/test/test_bitcoin+0x1537a0) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8) in pthread_rwlock_wrlock
==================
# cat tsan.25253
==================
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=25253)
  Cycle in lock order graph: M0 (0xffffabe64208) => M1 (0xffffabe6a868) => M2 (0xffffabe6aa18) => M0

  Mutex M1 acquired here while holding mutex M0 in main thread:
    #0 pthread_rwlock_wrlock <null> (test_bitcoin+0x1537a0) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #1 __db_pthread_mutex_lock <null> (test_bitcoin+0x12b09ec) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #2 wallet::BerkeleyBatch::BerkeleyBatch(wallet::BerkeleyDatabase&, bool, bool) src/wallet/bdb.cpp:325:14 (test_bitcoin+0xbc4cd4) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #3 std::__1::__unique_if<wallet::BerkeleyBatch>::__unique_single std::__1::make_unique[abi:v160000]<wallet::BerkeleyBatch, wallet::BerkeleyDatabase&, bool, bool&>(wallet::BerkeleyDatabase&, bool&&, bool&) /usr/lib/llvm-16/bin/../include/c++/v1/__memory/unique_ptr.h:686:30 (test_bitcoin+0xbcb4d0) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #4 wallet::BerkeleyDatabase::MakeBatch(bool) src/wallet/bdb.cpp:882:12 (test_bitcoin+0xbcb4d0)
    #5 wallet::WalletBatch::WalletBatch(wallet::WalletDatabase&, bool) src/./wallet/walletdb.h:222:26 (test_bitcoin+0xaf2bf4) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #6 wallet::LegacyScriptPubKeyMan::AddKeyPubKey(CKey const&, CPubKey const&) src/wallet/scriptpubkeyman.cpp:725:17 (test_bitcoin+0xaf2bf4)
    #7 wallet::LegacyScriptPubKeyMan::DeriveNewSeed(CKey const&) src/wallet/scriptpubkeyman.cpp:1209:14 (test_bitcoin+0xaf8930) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #8 wallet::LegacyScriptPubKeyMan::GenerateNewSeed() src/wallet/scriptpubkeyman.cpp:1185:12 (test_bitcoin+0xaefa40) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #9 wallet::LegacyScriptPubKeyMan::SetupGeneration(bool) src/wallet/scriptpubkeyman.cpp:436:15 (test_bitcoin+0xaef550) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #10 wallet::walletdb_tests::walletdb_read_write_deadlock::test_method() src/wallet/test/walletdb_tests.cpp:50:9 (test_bitcoin+0x9b9300) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #11 wallet::walletdb_tests::walletdb_read_write_deadlock_invoker() src/wallet/test/walletdb_tests.cpp:32:1 (test_bitcoin+0x9b8808) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #12 boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:117:11 (test_bitcoin+0x2d7324) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #13 boost::function0<void>::operator()() const /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:763:14 (test_bitcoin+0x26795c) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #14 boost::detail::forward::operator()() /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1388:32 (test_bitcoin+0x26795c)
    #15 boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:137:18 (test_bitcoin+0x26795c)
    #16 boost::function0<int>::operator()() const /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:763:14 (test_bitcoin+0x1fb984) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #17 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&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:301:30 (test_bitcoin+0x1fb984)
    #18 boost::execution_monitor::catch_signals(boost::function<int ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:903:16 (test_bitcoin+0x1fb984)
    #19 boost::execution_monitor::execute(boost::function<int ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1301:16 (test_bitcoin+0x1fbc7c) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #20 boost::execution_monitor::vexecute(boost::function<void ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1397:5 (test_bitcoin+0x1f54c0) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #21 boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned long) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/unit_test_monitor.ipp:49:9 (test_bitcoin+0x1f54c0)
    #22 boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:815:44 (test_bitcoin+0x2253fc) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #23 boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:784:58 (test_bitcoin+0x225728) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #24 boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:784:58 (test_bitcoin+0x225728) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #25 boost::unit_test::framework::run(unsigned long, bool) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:1722:29 (test_bitcoin+0x1f4464) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #26 boost::unit_test::unit_test_main(boost::unit_test::test_suite* (*)(int, char**), int, char**) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/unit_test_main.ipp:250:9 (test_bitcoin+0x20ddc8) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #27 main /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/unit_test_main.ipp:306:12 (test_bitcoin+0x20e374) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)

    Hint: use TSAN_OPTIONS=second_deadlock_stack=1 to get more informative warning message

  Mutex M2 acquired here while holding mutex M1 in main thread:
    #0 pthread_rwlock_wrlock <null> (test_bitcoin+0x1537a0) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #1 __db_pthread_mutex_lock <null> (test_bitcoin+0x12b09ec) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #2 wallet::BerkeleyBatch::BerkeleyBatch(wallet::BerkeleyDatabase&, bool, bool) src/wallet/bdb.cpp:325:14 (test_bitcoin+0xbc4cd4) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #3 std::__1::__unique_if<wallet::BerkeleyBatch>::__unique_single std::__1::make_unique[abi:v160000]<wallet::BerkeleyBatch, wallet::BerkeleyDatabase&, bool, bool&>(wallet::BerkeleyDatabase&, bool&&, bool&) /usr/lib/llvm-16/bin/../include/c++/v1/__memory/unique_ptr.h:686:30 (test_bitcoin+0xbcb4d0) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #4 wallet::BerkeleyDatabase::MakeBatch(bool) src/wallet/bdb.cpp:882:12 (test_bitcoin+0xbcb4d0)
    #5 wallet::WalletBatch::WalletBatch(wallet::WalletDatabase&, bool) src/./wallet/walletdb.h:222:26 (test_bitcoin+0xaf2bf4) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #6 wallet::LegacyScriptPubKeyMan::AddKeyPubKey(CKey const&, CPubKey const&) src/wallet/scriptpubkeyman.cpp:725:17 (test_bitcoin+0xaf2bf4)
    #7 wallet::LegacyScriptPubKeyMan::DeriveNewSeed(CKey const&) src/wallet/scriptpubkeyman.cpp:1209:14 (test_bitcoin+0xaf8930) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #8 wallet::LegacyScriptPubKeyMan::GenerateNewSeed() src/wallet/scriptpubkeyman.cpp:1185:12 (test_bitcoin+0xaefa40) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #9 wallet::LegacyScriptPubKeyMan::SetupGeneration(bool) src/wallet/scriptpubkeyman.cpp:436:15 (test_bitcoin+0xaef550) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #10 wallet::walletdb_tests::walletdb_read_write_deadlock::test_method() src/wallet/test/walletdb_tests.cpp:50:9 (test_bitcoin+0x9b9300) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #11 wallet::walletdb_tests::walletdb_read_write_deadlock_invoker() src/wallet/test/walletdb_tests.cpp:32:1 (test_bitcoin+0x9b8808) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #12 boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:117:11 (test_bitcoin+0x2d7324) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #13 boost::function0<void>::operator()() const /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:763:14 (test_bitcoin+0x26795c) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #14 boost::detail::forward::operator()() /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1388:32 (test_bitcoin+0x26795c)
    #15 boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:137:18 (test_bitcoin+0x26795c)
    #16 boost::function0<int>::operator()() const /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:763:14 (test_bitcoin+0x1fb984) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #17 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&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:301:30 (test_bitcoin+0x1fb984)
    #18 boost::execution_monitor::catch_signals(boost::function<int ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:903:16 (test_bitcoin+0x1fb984)
    #19 boost::execution_monitor::execute(boost::function<int ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1301:16 (test_bitcoin+0x1fbc7c) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #20 boost::execution_monitor::vexecute(boost::function<void ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1397:5 (test_bitcoin+0x1f54c0) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #21 boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned long) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/unit_test_monitor.ipp:49:9 (test_bitcoin+0x1f54c0)
    #22 boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:815:44 (test_bitcoin+0x2253fc) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #23 boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:784:58 (test_bitcoin+0x225728) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #24 boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:784:58 (test_bitcoin+0x225728) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #25 boost::unit_test::framework::run(unsigned long, bool) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:1722:29 (test_bitcoin+0x1f4464) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #26 boost::unit_test::unit_test_main(boost::unit_test::test_suite* (*)(int, char**), int, char**) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/unit_test_main.ipp:250:9 (test_bitcoin+0x20ddc8) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #27 main /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/unit_test_main.ipp:306:12 (test_bitcoin+0x20e374) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)

  Mutex M0 acquired here while holding mutex M2 in main thread:
    #0 pthread_rwlock_rdlock <null> (test_bitcoin+0x153234) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #1 __db_pthread_mutex_readlock <null> (test_bitcoin+0x12b0c80) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #2 wallet::BerkeleyBatch::BerkeleyBatch(wallet::BerkeleyDatabase&, bool, bool) src/wallet/bdb.cpp:325:14 (test_bitcoin+0xbc4cd4) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #3 std::__1::__unique_if<wallet::BerkeleyBatch>::__unique_single std::__1::make_unique[abi:v160000]<wallet::BerkeleyBatch, wallet::BerkeleyDatabase&, bool, bool&>(wallet::BerkeleyDatabase&, bool&&, bool&) /usr/lib/llvm-16/bin/../include/c++/v1/__memory/unique_ptr.h:686:30 (test_bitcoin+0xbcb4d0) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #4 wallet::BerkeleyDatabase::MakeBatch(bool) src/wallet/bdb.cpp:882:12 (test_bitcoin+0xbcb4d0)
    #5 wallet::WalletBatch::WalletBatch(wallet::WalletDatabase&, bool) src/./wallet/walletdb.h:222:26 (test_bitcoin+0xaf2bf4) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #6 wallet::LegacyScriptPubKeyMan::AddKeyPubKey(CKey const&, CPubKey const&) src/wallet/scriptpubkeyman.cpp:725:17 (test_bitcoin+0xaf2bf4)
    #7 wallet::LegacyScriptPubKeyMan::DeriveNewSeed(CKey const&) src/wallet/scriptpubkeyman.cpp:1209:14 (test_bitcoin+0xaf8930) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #8 wallet::LegacyScriptPubKeyMan::GenerateNewSeed() src/wallet/scriptpubkeyman.cpp:1185:12 (test_bitcoin+0xaefa40) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #9 wallet::LegacyScriptPubKeyMan::SetupGeneration(bool) src/wallet/scriptpubkeyman.cpp:436:15 (test_bitcoin+0xaef550) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #10 wallet::walletdb_tests::walletdb_read_write_deadlock::test_method() src/wallet/test/walletdb_tests.cpp:50:9 (test_bitcoin+0x9b9300) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #11 wallet::walletdb_tests::walletdb_read_write_deadlock_invoker() src/wallet/test/walletdb_tests.cpp:32:1 (test_bitcoin+0x9b8808) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #12 boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:117:11 (test_bitcoin+0x2d7324) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #13 boost::function0<void>::operator()() const /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:763:14 (test_bitcoin+0x26795c) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #14 boost::detail::forward::operator()() /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1388:32 (test_bitcoin+0x26795c)
    #15 boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:137:18 (test_bitcoin+0x26795c)
    #16 boost::function0<int>::operator()() const /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/function/function_template.hpp:763:14 (test_bitcoin+0x1fb984) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #17 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&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:301:30 (test_bitcoin+0x1fb984)
    #18 boost::execution_monitor::catch_signals(boost::function<int ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:903:16 (test_bitcoin+0x1fb984)
    #19 boost::execution_monitor::execute(boost::function<int ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1301:16 (test_bitcoin+0x1fbc7c) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #20 boost::execution_monitor::vexecute(boost::function<void ()> const&) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1397:5 (test_bitcoin+0x1f54c0) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #21 boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned long) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/unit_test_monitor.ipp:49:9 (test_bitcoin+0x1f54c0)
    #22 boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:815:44 (test_bitcoin+0x2253fc) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #23 boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:784:58 (test_bitcoin+0x225728) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #24 boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:784:58 (test_bitcoin+0x225728) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #25 boost::unit_test::framework::run(unsigned long, bool) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/framework.ipp:1722:29 (test_bitcoin+0x1f4464) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #26 boost::unit_test::unit_test_main(boost::unit_test::test_suite* (*)(int, char**), int, char**) /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/unit_test_main.ipp:250:9 (test_bitcoin+0x20ddc8) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)
    #27 main /home/fedora/ci_scratch/depends/aarch64-unknown-linux-gnu/include/boost/test/impl/unit_test_main.ipp:306:12 (test_bitcoin+0x20e374) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8)

SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) (/home/fedora/ci_scratch/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/src/test/test_bitcoin+0x1537a0) (BuildId: 501b437270597fa9a7a48cb4f66b32eca15a18b8) in pthread_rwlock_wrlock
==================

@maflcko
Copy link
Member Author

maflcko commented Jun 28, 2023

Yeah, tsan+bdb+aarch64 is impossible to run. You'll have to disable bdb.

Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approach ACK

(review beg for #27425 doing a ~similar test util extraction change)

class BaseIndex;

/** Block until the index is synced to the current chain */
void IndexWaitSynced(BaseIndex& index);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps call it WaitUntilIndexSynced

and s/Block/Wait/, or drop the Doxygen comment if the naming is clear enough

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to leave as-is for now, because the function pre-existing and is only moved, not created in this pull.

#include <util/check.h>
#include <util/time.h>

void IndexWaitSynced(BaseIndex& index)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and in the function declaration

Suggested change
void IndexWaitSynced(BaseIndex& index)
void IndexWaitSynced(const BaseIndex& index)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, may do if I have to re-touch, to not invalidate the previous tests and comments.

@fanquake
Copy link
Member

Yeah, tsan+bdb+aarch64 is impossible to run. You'll have to disable bdb.

Yea, this branch rebased on master + NO_BDB=1 works as expected.

Copy link
Contributor

@mzumsande mzumsande left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code review ACK fa08624

Bumping the timeout for txindex and blockfilterindex should hopefully fix the intermittent CI fails.

@fanquake fanquake merged commit 47ab006 into bitcoin:master Jun 30, 2023
@maflcko maflcko deleted the 2306-test-index-sync- branch June 30, 2023 10:58
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jun 30, 2023
fa08624 test: Use same timeout for all index sync (MarcoFalke)

Pull request description:

  Seems odd to use different timeouts.

  Fix this by using the same timeout for all syncs.

  May also fix bitcoin#27355 or at least make it less frequent?

ACKs for top commit:
  mzumsande:
    code review ACK fa08624

Tree-SHA512: a61619247c97f3a88dd19eb3f200adedd120e6da8c4e4f2cf83621545b8c289dbad77e16f13cf7973a090f7b2c3391cb0297f09b0cc95fe4f55de21ae247670f
@mzumsande
Copy link
Contributor

now the previously unaffected coinstatsindex_tests fails intermittently:
https://github.com/bitcoin/bitcoin/pull/27746/checks?check_run_id=14710590806
(doesn't seem to be related to the PR)

72023-07-02T07:40:59.796756Z (mocktime: 2020-08-31T15:34:test/util/index.cpp:15 IndexWaitSynced: Assertion `timeout > SteadyClock::now()' failed.

@maflcko
Copy link
Member Author

maflcko commented Jul 3, 2023

Yeah, should be caused by an upstream CI change. I guess there should be no risk in changing 120s to 300s, even potentially fixing the issue you see.

@mzumsande
Copy link
Contributor

mzumsande commented Jul 3, 2023

Yeah, should be caused by an upstream CI change. I guess there should be no risk in changing 120s to 300s, even potentially fixing the issue you see.

Saw it on master now too: https://github.com/bitcoin/bitcoin/runs/14733904119

I think the reason why this didn't fail before is that coinstatsindex_unclean_shutdown used GetTime / NodeClock instead of SteadyClock before this PR. So since mocktime was used (which doesn't change after the 100 blocks are mined), the timeout was actually infinite before .

Copy link
Member

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made #28026 to abolish the timeout issues.

maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request Jul 6, 2023
The timeout was unlimited before, so just restore that value for now:
bitcoin#27988 (comment)
fanquake added a commit to bitcoin-core/gui that referenced this pull request Jul 7, 2023
…WaitSynced

fabed7e test: Restore unlimited timeout in IndexWaitSynced (MarcoFalke)

Pull request description:

  The timeout was unlimited before, so just restore that value for now: bitcoin/bitcoin#27988 (comment) .

  (Strictly speaking, this is a behavior change for the blockfilterindex and txindex tests, because it only restores the coinstatsindex behavior.)

ACKs for top commit:
  ajtowns:
    utACK fabed7e
  mzumsande:
    ACK fabed7e
  furszy:
    ACK fabed7e

Tree-SHA512: 66a878be58bbe53ad8e0c23f05569dd42df688be747551fbd202ada22d20a8285714e58fa2a71664deadb070ddf86cfad88c01042ff95ed26f6b40e4a10cec0a
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jul 7, 2023
fabed7e test: Restore unlimited timeout in IndexWaitSynced (MarcoFalke)

Pull request description:

  The timeout was unlimited before, so just restore that value for now: bitcoin#27988 (comment) .

  (Strictly speaking, this is a behavior change for the blockfilterindex and txindex tests, because it only restores the coinstatsindex behavior.)

ACKs for top commit:
  ajtowns:
    utACK fabed7e
  mzumsande:
    ACK fabed7e
  furszy:
    ACK fabed7e

Tree-SHA512: 66a878be58bbe53ad8e0c23f05569dd42df688be747551fbd202ada22d20a8285714e58fa2a71664deadb070ddf86cfad88c01042ff95ed26f6b40e4a10cec0a
kwvg added a commit to kwvg/dash that referenced this pull request Jul 19, 2023
kwvg added a commit to kwvg/dash that referenced this pull request Jul 19, 2023
kwvg added a commit to kwvg/dash that referenced this pull request Jul 23, 2023
kwvg added a commit to kwvg/dash that referenced this pull request Jul 23, 2023
kwvg added a commit to kwvg/dash that referenced this pull request Jul 24, 2023
kwvg added a commit to kwvg/dash that referenced this pull request Jul 28, 2023
kwvg added a commit to kwvg/dash that referenced this pull request Jul 28, 2023
kwvg added a commit to kwvg/dash that referenced this pull request Jul 30, 2023
knst pushed a commit to knst/dash that referenced this pull request Aug 1, 2023
knst pushed a commit to knst/dash that referenced this pull request Aug 1, 2023
kwvg added a commit to kwvg/dash that referenced this pull request Aug 1, 2023
kwvg added a commit to kwvg/dash that referenced this pull request Aug 1, 2023
kwvg added a commit to kwvg/dash that referenced this pull request Aug 1, 2023
PastaPastaPasta pushed a commit to kwvg/dash that referenced this pull request Aug 2, 2023
janus pushed a commit to BitgesellOfficial/bitgesell that referenced this pull request Sep 11, 2023
The timeout was unlimited before, so just restore that value for now:
bitcoin/bitcoin#27988 (comment)
@bitcoin bitcoin locked and limited conversation to collaborators Jul 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

index: ThreadSanitizer: data race on vptr
6 participants