Skip to content

Conversation

@arnabsen1729
Copy link

@arnabsen1729 arnabsen1729 commented Aug 16, 2021

This PR adds tracepoints (including documentation).

If you are new to USDTs you are requested to go through this to get some context.

It was proposed in bitcoin#20981 (comment) some useful tracepoints that can be added. On the basis of that, this PR adds the following tracepoints:

<-- create a table -->

flush:coins_flush

Traces every time caches and indexes are flushed.

  • int64 time (in microseconds)
  • uint32 flush mode
  • uint64 coins flushed
  • uint64 coins memory usage

utxo:coins_added

Traces every time a new coin is added to the cache

  • int32 height
  • int64 value
  • uint32 if the coin is coinbase
  • uint64 coins usage

utxo:coins_spent

Traces every time a coin is spent

  • int32 height
  • int64 value
  • uint32 if the coin is coinbase
  • uint64 coins usage

utxo:coins_uncached

Traces every time a UTXO with the given outpoint is removed from the cache

  • int32 height
  • int64 value
  • uint32 if the coin is coinbase
  • uint64 coins usage

@arnabsen1729 arnabsen1729 changed the title tracing: Tracepoints for coins flush tracing: Adding more tracepoints Aug 18, 2021
Copy link
Owner

@0xB10C 0xB10C left a comment

Choose a reason for hiding this comment

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

first round of review

some general notes:

@0xB10C
Copy link
Owner

0xB10C commented Aug 21, 2021

I think we should pass information about the outpoint (txid and output index) for UTXO set operations too. For passing the txid see arguments 1 and 7 of the validation:block_connected tracepoint.

An outpoint is a reference to a previous output. It consists of a txid (called hash in COutPoint) and the output index of the transaction (called n in COutPoint). See COutPoint.

I saw you added the hash aka txid of the outpoint as a C string. It would be good to pass the txid as bytes too. That could be done in the 7th argument (not accessible by bpftrace, and that is fine as bpftrace currently can't handle bytes arrays properly anyway) similar as we do in the validation:block_connected tracepoint. Additionally, we'd need the pass the output index (n) too.

Would be good to log the outpoints in the bcc and bpftrace scripts too. Often outpoints are formatted as <txid>:<index>. And they should be documented.

@arnabsen1729
Copy link
Author

@0xB10C I have used the bool datatype in the BCC script log_coins_flushed.py using ctype f43febb.

Also, updated the tracepoints context and names and added the txid as bytes to add, spent and uncache tracepoints.

Copy link
Owner

@0xB10C 0xB10C left a comment

Choose a reason for hiding this comment

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

Good work! I left a few more comments worth addressing. Also, some of the previous comments (e.g. https://github.com/0xB10C/bitcoin/pull/1/files#r692351276) are still open.

u32 index;
char hash[MAX_HASH_SIZE];
long value;
u32 isCoinBase;
Copy link
Owner

Choose a reason for hiding this comment

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

should be bool too

Copy link
Author

Choose a reason for hiding this comment

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

Did you mean to isCoinBase?

Cause, index refers to the COutPoint::n here

class COutPoint
{
public:
uint256 hash;
uint32_t n;

For the isCoinBase which refers to Coin::fCoinBase it is of unsigned int type.

bitcoin/src/coins.h

Lines 30 to 37 in 7be143a

class Coin
{
public:
//! unspent transaction output
CTxOut out;
//! whether containing transaction was a coinbase
unsigned int fCoinBase : 1;

Copy link
Owner

Choose a reason for hiding this comment

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

yes, sorry if that was unclear. For me the comment is on the isCoinbase line.

image

Copy link
Owner

Choose a reason for hiding this comment

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

You could use Coin::IsCoinBase() which returns a bool

Copy link
Owner

Choose a reason for hiding this comment

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

@arnabsen1729 arnabsen1729 changed the title tracing: Adding more tracepoints tracing: add utxocache tracepoints Sep 1, 2021
@0xB10C
Copy link
Owner

0xB10C commented Sep 6, 2021

closing this in favor of bitcoin#22902 :)

@0xB10C 0xB10C closed this Sep 6, 2021
0xB10C pushed a commit that referenced this pull request Sep 15, 2021
…rflow:addrman.cpp

facb534 test: Add missing suppression signed-integer-overflow:addrman.cpp (MarcoFalke)

Pull request description:

  Steps to reproduce:

  [crash-d5f88bd8d0d460ffbab217b856b8582600c00503.log](https://github.com/bitcoin/bitcoin/files/7130854/crash-d5f88bd8d0d460ffbab217b856b8582600c00503.log)

  ```
  $ FUZZ=addrman ./src/test/fuzz/fuzz ./crash-d5f88bd8d0d460ffbab217b856b8582600c00503.log
  INFO: Running with entropic power schedule (0xFF, 100).
  INFO: Seed: 1257085025
  INFO: Loaded 1 modules   (379531 inline 8-bit counters): 379531 [0x562577b768a8, 0x562577bd3333),
  INFO: Loaded 1 PC tables (379531 PCs): 379531 [0x562577bd3338,0x56257819dbe8),
  ./src/test/fuzz/fuzz: Running 1 inputs 1 time(s) each.
  Running: ./crash-d5f88bd8d0d460ffbab217b856b8582600c00503.log
  addrman.cpp:80:14: runtime error: signed integer overflow: 2105390 - -9223372036854775808 cannot be represented in type 'long'
      #0 0x5625752f0179 in CAddrInfo::IsTerrible(long) const addrman.cpp:80:14
      #1 0x56257531917d in CAddrMan::GetAddr_(std::vector<CAddress, std::allocator<CAddress> >&, unsigned long, unsigned long, std::optional<Network>) const addrman.cpp:874:16
      #2 0x562574f0251b in CAddrMan::GetAddr(unsigned long, unsigned long, std::optional<Network>) const ./addrman.h:259:9
      #3 0x562574eff7ad in addrman_fuzz_target(Span<unsigned char const>) test/fuzz/addrman.cpp:295:26

  SUMMARY: UndefinedBehaviorSanitizer: signed-integer-overflow addrman.cpp:80:14 in

ACKs for top commit:
  practicalswift:
    cr ACK facb534

Tree-SHA512: 6368c48be8762c793f760d86caaf37a10caffa08f6903f3667dd08f7f67fade10f385fbffc451ddcbeeecc9fd02526ed97ab9de13398a75fffa55976a99af6b9
0xB10C pushed a commit that referenced this pull request Jan 9, 2022
This is needed to turn globals into member variables. Otherwise, this
will lead to issues:

runtime error: reference binding to null pointer of type 'CBlockFileInfo'
    #0 in std::vector<CBlockFileInfo, std::allocator<CBlockFileInfo> >::operator[](unsigned long) /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_vector.h:1046:2
    #1 in BlockManager::FlushBlockFile(bool, bool) src/node/blockstorage.cpp:540:47
    #2 in CChainState::FlushStateToDisk(BlockValidationState&, FlushStateMode, int) src/validation.cpp:2262:28
    #3 in CChainState::ResizeCoinsCaches(unsigned long, unsigned long) src/validation.cpp:4414:15
    #4 in validation_chainstate_tests::validation_chainstate_resize_caches::test_method() src/test/validation_chainstate_tests.cpp:66:12
0xB10C pushed a commit that referenced this pull request Feb 15, 2022
This change fixes "Hunk #1 succeeded at 307 (offset -1 lines)."
0xB10C pushed a commit that referenced this pull request Feb 15, 2022
fa45597 util: Add missing unlinkat to syscall sandbox (MarcoFalke)

Pull request description:

  This will be needed for g++-12 (after libstdc++6 12-20220206).

  Steps to reproduce:

  ```
  gdb --args ./src/bitcoind -sandbox=log-and-abort -regtest
  ./src/bitcoin-cli -regtest -named createwallet wallet_name=a descriptors=false
  ./src/bitcoin-cli -regtest stop
  ```

  BT:

  ```
  Thread 1 "b-shutoff" received signal SIGSYS, Bad system call.
  0x00007ffff79564f7 in unlinkat () from /lib/x86_64-linux-gnu/libc.so.6
  (gdb) bt
  #0  0x00007ffff79564f7 in unlinkat () from /lib/x86_64-linux-gnu/libc.so.6
  #1  0x00007ffff7cc7335 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
  #2  0x00007ffff7cc94e3 in std::filesystem::remove_all(std::filesystem::__cxx11::path const&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
  #3  0x00005555559d4918 in wallet::BerkeleyEnvironment::Flush (this=0x7fffc4005160, fShutdown=<optimized out>) at /usr/include/c++/12/bits/fs_path.h:595
  #4  0x000055555592c058 in wallet::StopWallets (context=...) at /usr/include/c++/12/bits/shared_ptr_base.h:1665
  #5  0x00005555556617ca in Shutdown (node=...) at ./src/init.cpp:293
  #6  0x000055555563ada6 in AppInit (argv=<optimized out>, argc=<optimized out>, node=...) at ./src/bitcoind.cpp:249
  #7  main (argc=<optimized out>, argv=<optimized out>) at ./src/bitcoind.cpp:273

ACKs for top commit:
  laanwj:
    Code review ACK fa45597

Tree-SHA512: e80a38828f8656040954c9befa2d1c9d5170e204dc09c61031633349897f51ccd85cc5c99a089c4726d7f5237875cd9ed3fa8ef864cd6c1c8a2b8250b392d57f
0xB10C pushed a commit that referenced this pull request Feb 23, 2022
fa7e147 test: Fix intermittent Tsan issue (MarcoFalke)

Pull request description:

  Fix https://cirrus-ci.com/task/5176769937408000?logs=ci#L5161

  ```
  WARNING: ThreadSanitizer: data race (pid=22965)
    Write of size 8 at 0x7f74d5e21f50 by main thread:
      #0 std::__1::ios_base::precision(long) /usr/lib/llvm-13/bin/../include/c++/v1/ios:513:18 (test_bitcoin+0x1a8366)
      #1 boost::io::ios_base_all_saver::restore() /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/io/ios_state.hpp:341:17 (test_bitcoin+0x1a8366)
      #2 boost::unit_test::unit_test_log_t::operator<<(boost::unit_test::log::begin const&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/unit_test_log.ipp:336:55 (test_bitcoin+0x1a8366)
      #3 boost::test_tools::tt_detail::report_assertion(boost::test_tools::assertion_result const&, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned long, ...) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/test_tools.ipp:359:19 (test_bitcoin+0x1b3b9b)
      #4 txindex_tests::txindex_initial_sync::test_method() src/test/txindex_tests.cpp:31:5 (test_bitcoin+0x78aebc)
      #5 txindex_tests::txindex_initial_sync_invoker() src/test/txindex_tests.cpp:16:1 (test_bitcoin+0x78a384)
      #6 boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:117:11 (test_bitcoin+0x2bf30d)
      #7 boost::function0<void>::operator()() const /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:763:14 (test_bitcoin+0x224027)
      #8 boost::detail::forward::operator()() /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1368:32 (test_bitcoin+0x224027)
      #9 boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:137:18 (test_bitcoin+0x224027)
      #10 boost::function0<int>::operator()() const /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:763:14 (test_bitcoin+0x1ac66c)
      #11 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&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:290:30 (test_bitcoin+0x1ac66c)
      #12 boost::execution_monitor::catch_signals(boost::function<int ()> const&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:879:16 (test_bitcoin+0x1ac66c)
      #13 boost::execution_monitor::execute(boost::function<int ()> const&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1277:16 (test_bitcoin+0x1ac980)
      #14 boost::execution_monitor::vexecute(boost::function<void ()> const&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1377:5 (test_bitcoin+0x1a7f9b)
      #15 boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned long) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/unit_test_monitor.ipp:49:9 (test_bitcoin+0x1a7f9b)
      bitcoin#16 boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:823:44 (test_bitcoin+0x1e0d5c)
      bitcoin#17 boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:792:58 (test_bitcoin+0x1e14a6)
      bitcoin#18 boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:792:58 (test_bitcoin+0x1e14a6)
      bitcoin#19 boost::unit_test::framework::run(unsigned long, bool) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:1696:29 (test_bitcoin+0x1a6bfb)
      bitcoin#20 boost::unit_test::unit_test_main(boost::unit_test::test_suite* (*)(int, char**), int, char**) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/unit_test_main.ipp:248:9 (test_bitcoin+0x1c4ed6)
      bitcoin#21 main /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/unit_test_main.ipp:304:12 (test_bitcoin+0x1c5506)
    Previous write of size 8 at 0x7f74d5e21f50 by thread T4:
      [failed to restore the stack]
    Location is global 'std::__1::cout' of size 160 at 0x7f74d5e21f30 (libc++.so.1+0x0000000cdf50)
    Thread T4 'b-txindex' (tid=22989, running) created by main thread at:
      #0 pthread_create <null> (test_bitcoin+0x1184cd)
      #1 std::__1::__libcpp_thread_create(unsigned long*, void* (*)(void*), void*) /usr/lib/llvm-13/bin/../include/c++/v1/__threading_support:514:10 (test_bitcoin+0xa23f1b)
      #2 std::__1::thread::thread<void (*)(char const*, std::__1::function<void ()>), char const*, BaseIndex::Start(CChainState&)::$_0, void>(void (*&&)(char const*, std::__1::function<void ()>), char const*&&, BaseIndex::Start(CChainState&)::$_0&&) /usr/lib/llvm-13/bin/../include/c++/v1/thread:307:16 (test_bitcoin+0xa23f1b)
      #3 BaseIndex::Start(CChainState&) src/index/base.cpp:363:21 (test_bitcoin+0xa23f1b)
      #4 txindex_tests::txindex_initial_sync::test_method() src/test/txindex_tests.cpp:31:5 (test_bitcoin+0x78adfa)
      #5 txindex_tests::txindex_initial_sync_invoker() src/test/txindex_tests.cpp:16:1 (test_bitcoin+0x78a384)
      #6 boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:117:11 (test_bitcoin+0x2bf30d)
      #7 boost::function0<void>::operator()() const /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:763:14 (test_bitcoin+0x224027)
      #8 boost::detail::forward::operator()() /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1368:32 (test_bitcoin+0x224027)
      #9 boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:137:18 (test_bitcoin+0x224027)
      #10 boost::function0<int>::operator()() const /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:763:14 (test_bitcoin+0x1ac66c)
      #11 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&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:290:30 (test_bitcoin+0x1ac66c)
      #12 boost::execution_monitor::catch_signals(boost::function<int ()> const&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:879:16 (test_bitcoin+0x1ac66c)
      #13 boost::execution_monitor::execute(boost::function<int ()> const&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1277:16 (test_bitcoin+0x1ac980)
      #14 boost::execution_monitor::vexecute(boost::function<void ()> const&) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1377:5 (test_bitcoin+0x1a7f9b)
      #15 boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned long) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/unit_test_monitor.ipp:49:9 (test_bitcoin+0x1a7f9b)
      bitcoin#16 boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:823:44 (test_bitcoin+0x1e0d5c)
      bitcoin#17 boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:792:58 (test_bitcoin+0x1e14a6)
      bitcoin#18 boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:792:58 (test_bitcoin+0x1e14a6)
      bitcoin#19 boost::unit_test::framework::run(unsigned long, bool) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:1696:29 (test_bitcoin+0x1a6bfb)
      bitcoin#20 boost::unit_test::unit_test_main(boost::unit_test::test_suite* (*)(int, char**), int, char**) /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/unit_test_main.ipp:248:9 (test_bitcoin+0x1c4ed6)
      bitcoin#21 main /tmp/cirrus-ci-build/depends/x86_64-pc-linux-gnu/include/boost/test/impl/unit_test_main.ipp:304:12 (test_bitcoin+0x1c5506)
  SUMMARY: ThreadSanitizer: data race /usr/lib/llvm-13/bin/../include/c++/v1/ios:513:18 in std::__1::ios_base::precision(long)
  ==================
  Exit status: 2

ACKs for top commit:
  fanquake:
    CI ignored ACK fa7e147

Tree-SHA512: 5194e026410b96ad3c8addeecce0a55ee0271c3cfac9fa0715345b1a50d59925549cee0a3e415e5837ae6d2f214a7b622c73cfc7fdf41d5e55c24fb87fddb9d1
0xB10C pushed a commit that referenced this pull request Sep 12, 2022
fac04cb refactor: Add lock annotations to Active* methods (MacroFake)
fac15ff Fix logical race in rest_getutxos (MacroFake)
fa97a52 Fix UB/data-race in RPCNotifyBlockChange (MacroFake)
fa530bc Add ChainstateManager::GetMutex(), an alias for ::cs_main (MacroFake)

Pull request description:

  This fixes two issues:

  * A data race in `ActiveChain`, which returns a reference to the chain (a `std::vector`), which is not thread safe. See also below traceback.
  * A corrupt rest response, which returns a blockheight and blockhash, which are unrelated to each other and to the result, as the chain might advance between each call without cs_main held.

  The issues are fixed by taking cs_main and holding it for the required time.

  ```
  ==================
  WARNING: ThreadSanitizer: data race (pid=32335)
    Write of size 8 at 0x7b3c000008f0 by thread T22 (mutexes: write M131626, write M151, write M131553):
      #0 std::__1::enable_if<(is_move_constructible<CBlockIndex**>::value) && (is_move_assignable<CBlockIndex**>::value), void>::type std::__1::swap<CBlockIndex**>(CBlockIndex**&, CBlockIndex**&) /usr/lib/llvm-13/bin/../include/c++/v1/__utility/swap.h:39:7 (bitcoind+0x501239)
      #1 std::__1::vector<CBlockIndex*, std::__1::allocator<CBlockIndex*> >::__swap_out_circular_buffer(std::__1::__split_buffer<CBlockIndex*, std::__1::allocator<CBlockIndex*>&>&) /usr/lib/llvm-13/bin/../include/c++/v1/vector:977:5 (bitcoind+0x501239)
      #2 std::__1::vector<CBlockIndex*, std::__1::allocator<CBlockIndex*> >::__append(unsigned long) /usr/lib/llvm-13/bin/../include/c++/v1/vector:1117:9 (bitcoind+0x501239)
      #3 std::__1::vector<CBlockIndex*, std::__1::allocator<CBlockIndex*> >::resize(unsigned long) /usr/lib/llvm-13/bin/../include/c++/v1/vector:2046:15 (bitcoind+0x4ffe29)
      #4 CChain::SetTip(CBlockIndex*) src/chain.cpp:19:12 (bitcoind+0x4ffe29)
      #5 CChainState::ConnectTip(BlockValidationState&, CBlockIndex*, std::__1::shared_ptr<CBlock const> const&, ConnectTrace&, DisconnectedBlockTransactions&) src/validation.cpp:2748:13 (bitcoind+0x475d00)
      #6 CChainState::ActivateBestChainStep(BlockValidationState&, CBlockIndex*, std::__1::shared_ptr<CBlock const> const&, bool&, ConnectTrace&) src/validation.cpp:2884:18 (bitcoind+0x47739e)
      #7 CChainState::ActivateBestChain(BlockValidationState&, std::__1::shared_ptr<CBlock const>) src/validation.cpp:3011:22 (bitcoind+0x477baf)
      #8 node::ThreadImport(ChainstateManager&, std::__1::vector<fs::path, std::__1::allocator<fs::path> >, ArgsManager const&) src/node/blockstorage.cpp:883:30 (bitcoind+0x23cd74)
      #9 AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7::operator()() const src/init.cpp:1657:9 (bitcoind+0x15863e)
      #10 decltype(static_cast<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&>(fp)()) std::__1::__invoke<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&>(AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&) /usr/lib/llvm-13/bin/../include/c++/v1/type_traits:3918:1 (bitcoind+0x15863e)
      #11 void std::__1::__invoke_void_return_wrapper<void, true>::__call<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&>(AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&) /usr/lib/llvm-13/bin/../include/c++/v1/__functional/invoke.h:61:9 (bitcoind+0x15863e)
      #12 std::__1::__function::__alloc_func<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7, std::__1::allocator<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7>, void ()>::operator()() /usr/lib/llvm-13/bin/../include/c++/v1/__functional/function.h:171:16 (bitcoind+0x15863e)
      #13 std::__1::__function::__func<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7, std::__1::allocator<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7>, void ()>::operator()() /usr/lib/llvm-13/bin/../include/c++/v1/__functional/function.h:345:12 (bitcoind+0x15863e)
      #14 std::__1::__function::__value_func<void ()>::operator()() const /usr/lib/llvm-13/bin/../include/c++/v1/__functional/function.h:498:16 (bitcoind+0x88891f)
      #15 std::__1::function<void ()>::operator()() const /usr/lib/llvm-13/bin/../include/c++/v1/__functional/function.h:1175:12 (bitcoind+0x88891f)
      bitcoin#16 util::TraceThread(char const*, std::__1::function<void ()>) src/util/thread.cpp:18:9 (bitcoind+0x88891f)
      bitcoin#17 decltype(static_cast<void (*>(fp)(static_cast<char const*>(fp0), static_cast<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7>(fp0))) std::__1::__invoke<void (*)(char const*, std::__1::function<void ()>), char const*, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7>(void (*&&)(char const*, std::__1::function<void ()>), char const*&&, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&&) /usr/lib/llvm-13/bin/../include/c++/v1/type_traits:3918:1 (bitcoind+0x157e6a)
      bitcoin#18 void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(char const*, std::__1::function<void ()>), char const*, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7, 2ul, 3ul>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(char const*, std::__1::function<void ()>), char const*, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7>&, std::__1::__tuple_indices<2ul, 3ul>) /usr/lib/llvm-13/bin/../include/c++/v1/thread:280:5 (bitcoind+0x157e6a)
      bitcoin#19 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(char const*, std::__1::function<void ()>), char const*, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7> >(void*) /usr/lib/llvm-13/bin/../include/c++/v1/thread:291:5 (bitcoind+0x157e6a)
    Previous read of size 8 at 0x7b3c000008f0 by main thread:
      #0 std::__1::vector<CBlockIndex*, std::__1::allocator<CBlockIndex*> >::size() const /usr/lib/llvm-13/bin/../include/c++/v1/vector:680:61 (bitcoind+0x15179d)
      #1 CChain::Tip() const src/./chain.h:449:23 (bitcoind+0x15179d)
      #2 ChainstateManager::ActiveTip() const src/./validation.h:927:59 (bitcoind+0x15179d)
      #3 AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*) src/init.cpp:1841:35 (bitcoind+0x15179d)
      #4 AppInit(node::NodeContext&, int, char**) src/bitcoind.cpp:231:43 (bitcoind+0x133fd2)
      #5 main src/bitcoind.cpp:275:13 (bitcoind+0x133fd2)
    Location is heap block of size 232 at 0x7b3c00000870 allocated by main thread:
      #0 operator new(unsigned long) <null> (bitcoind+0x132668)
      #1 ChainstateManager::InitializeChainstate(CTxMemPool*, std::__1::optional<uint256> const&) src/validation.cpp:4851:21 (bitcoind+0x48e26b)
      #2 node::LoadChainstate(bool, ChainstateManager&, CTxMemPool*, bool, Consensus::Params const&, bool, long, long, long, bool, bool, std::__1::function<bool ()>, std::__1::function<void ()>) src/node/chainstate.cpp:31:14 (bitcoind+0x24de07)
      #3 AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*) src/init.cpp:1438:32 (bitcoind+0x14e994)
      #4 AppInit(node::NodeContext&, int, char**) src/bitcoind.cpp:231:43 (bitcoind+0x133fd2)
      #5 main src/bitcoind.cpp:275:13 (bitcoind+0x133fd2)
    Mutex M131626 (0x7b3c00000898) created at:
      #0 pthread_mutex_lock <null> (bitcoind+0xda898)
      #1 std::__1::mutex::lock() <null> (libc++.so.1+0x49f35)
      #2 node::ThreadImport(ChainstateManager&, std::__1::vector<fs::path, std::__1::allocator<fs::path> >, ArgsManager const&) src/node/blockstorage.cpp:883:30 (bitcoind+0x23cd74)
      #3 AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7::operator()() const src/init.cpp:1657:9 (bitcoind+0x15863e)
      #4 decltype(static_cast<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&>(fp)()) std::__1::__invoke<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&>(AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&) /usr/lib/llvm-13/bin/../include/c++/v1/type_traits:3918:1 (bitcoind+0x15863e)
      #5 void std::__1::__invoke_void_return_wrapper<void, true>::__call<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&>(AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&) /usr/lib/llvm-13/bin/../include/c++/v1/__functional/invoke.h:61:9 (bitcoind+0x15863e)
      #6 std::__1::__function::__alloc_func<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7, std::__1::allocator<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7>, void ()>::operator()() /usr/lib/llvm-13/bin/../include/c++/v1/__functional/function.h:171:16 (bitcoind+0x15863e)
      #7 std::__1::__function::__func<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7, std::__1::allocator<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7>, void ()>::operator()() /usr/lib/llvm-13/bin/../include/c++/v1/__functional/function.h:345:12 (bitcoind+0x15863e)
      #8 std::__1::__function::__value_func<void ()>::operator()() const /usr/lib/llvm-13/bin/../include/c++/v1/__functional/function.h:498:16 (bitcoind+0x88891f)
      #9 std::__1::function<void ()>::operator()() const /usr/lib/llvm-13/bin/../include/c++/v1/__functional/function.h:1175:12 (bitcoind+0x88891f)
      #10 util::TraceThread(char const*, std::__1::function<void ()>) src/util/thread.cpp:18:9 (bitcoind+0x88891f)
      #11 decltype(static_cast<void (*>(fp)(static_cast<char const*>(fp0), static_cast<AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7>(fp0))) std::__1::__invoke<void (*)(char const*, std::__1::function<void ()>), char const*, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7>(void (*&&)(char const*, std::__1::function<void ()>), char const*&&, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&&) /usr/lib/llvm-13/bin/../include/c++/v1/type_traits:3918:1 (bitcoind+0x157e6a)
      #12 void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(char const*, std::__1::function<void ()>), char const*, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7, 2ul, 3ul>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(char const*, std::__1::function<void ()>), char const*, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7>&, std::__1::__tuple_indices<2ul, 3ul>) /usr/lib/llvm-13/bin/../include/c++/v1/thread:280:5 (bitcoind+0x157e6a)
      #13 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(char const*, std::__1::function<void ()>), char const*, AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7> >(void*) /usr/lib/llvm-13/bin/../include/c++/v1/thread:291:5 (bitcoind+0x157e6a)
    Mutex M151 (0x55aacb8ea030) created at:
      #0 pthread_mutex_init <null> (bitcoind+0xbed2f)
      #1 std::__1::recursive_mutex::recursive_mutex() <null> (libc++.so.1+0x49fb3)
      #2 __libc_start_main <null> (libc.so.6+0x29eba)
    Mutex M131553 (0x7b4c000042e0) created at:
      #0 pthread_mutex_init <null> (bitcoind+0xbed2f)
      #1 std::__1::recursive_mutex::recursive_mutex() <null> (libc++.so.1+0x49fb3)
      #2 std::__1::__unique_if<CTxMemPool>::__unique_single std::__1::make_unique<CTxMemPool, CBlockPolicyEstimator*, int const&>(CBlockPolicyEstimator*&&, int const&) /usr/lib/llvm-13/bin/../include/c++/v1/__memory/unique_ptr.h:728:32 (bitcoind+0x15c81d)
      #3 AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*) src/init.cpp:1426:24 (bitcoind+0x14e7b4)
      #4 AppInit(node::NodeContext&, int, char**) src/bitcoind.cpp:231:43 (bitcoind+0x133fd2)
      #5 main src/bitcoind.cpp:275:13 (bitcoind+0x133fd2)
    Thread T22 'b-loadblk' (tid=32370, running) created by main thread at:
      #0 pthread_create <null> (bitcoind+0xbd5bd)
      #1 std::__1::__libcpp_thread_create(unsigned long*, void* (*)(void*), void*) /usr/lib/llvm-13/bin/../include/c++/v1/__threading_support:443:10 (bitcoind+0x155e06)
      #2 std::__1::thread::thread<void (*)(char const*, std::__1::function<void ()>), char const (&) [8], AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7, void>(void (*&&)(char const*, std::__1::function<void ()>), char const (&) [8], AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*)::$_7&&) /usr/lib/llvm-13/bin/../include/c++/v1/thread:307:16 (bitcoind+0x155e06)
      #3 AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*) src/init.cpp:1656:29 (bitcoind+0x150164)
      #4 AppInit(node::NodeContext&, int, char**) src/bitcoind.cpp:231:43 (bitcoind+0x133fd2)
      #5 main src/bitcoind.cpp:275:13 (bitcoind+0x133fd2)
  SUMMARY: ThreadSanitizer: data race /usr/lib/llvm-13/bin/../include/c++/v1/__utility/swap.h:39:7 in std::__1::enable_if<(is_move_constructible<CBlockIndex**>::value) && (is_move_assignable<CBlockIndex**>::value), void>::type std::__1::swap<CBlockIndex**>(CBlockIndex**&, CBlockIndex**&)
  ==================
  ```

  From https://cirrus-ci.com/task/5612886578954240?logs=ci#L4868

ACKs for top commit:
  achow101:
    re-ACK fac04cb
  theStack:
    Code-review ACK fac04cb

Tree-SHA512: 9d619f99ff6373874c7ffe1db20674575605646b4b54b692fb54515a4a49f110a770026d7320ed6dfeaa7976be4cd89e93f821acdbf22c7662bd1c5be0cedcd2
0xB10C pushed a commit that referenced this pull request Dec 20, 2022
e4be0e9 test: add -maxtipage test for the maximum allowable value (James O'Beirne)
a451e83 fix: validation: cast now() to seconds for maxtipage comparison (James O'Beirne)

Pull request description:

  Since bitcoin@faf4487, the maxtipage comparison in IsInitialBlockDownload() has been broken, since the NodeClock::now() time_point is in the system's native denomination (nanoseconds).

  Without this patch, specifying the maximum allowable -maxtipage (9223372036854775807) results in a SIGABRT crash:

  ```
  % gdb --args ./src/bitcoind -maxtipage=9223372036854775207 -minimumchainwork=0x00 -stopatheight=30000
  ...
  2022-11-09T15:55:17Z [dnsseed] dnsseed thread exit
  [Thread 0x7fff937fe640 (LWP 69883) exited]

  Thread 29 "b-msghand" received signal SIGABRT, Aborted.
  [Switching to Thread 0x7fff91ffb640 (LWP 69886)]
  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
  44      ./nptl/pthread_kill.c: No such file or directory.
  (gdb) bt
  #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
  #1  0x00007ffff768989f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
  #2  0x00007ffff763da52 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
  #3  0x00007ffff7628469 in __GI_abort () at ./stdlib/abort.c:79
  #4  0x00007ffff7cf79a4 in __mulvdi3 () from /lib/x86_64-linux-gnu/libgcc_s.so.1
  #5  0x00005555558d13ab in std::chrono::__duration_cast_impl<std::chrono::duration<long, std::ratio<1l, 1000000000l> >, std::ratio<1000000000l, 1l>, long, false, true>::__cast<long, std::ratio<1l, 1l> > (__d=...) at /usr/include/c++/12/bits/chrono.h:521
  #6  std::chrono::duration_cast<std::chrono::duration<long, std::ratio<1l, 1000000000l> >, long, std::ratio<1l, 1l> > (__d=...)
      at /usr/include/c++/12/bits/chrono.h:260
  #7  std::chrono::duration<long, std::ratio<1l, 1000000000l> >::duration<long, std::ratio<1l, 1l>, void> (__d=..., this=<optimized out>)
      at /usr/include/c++/12/bits/chrono.h:514
  #8  std::chrono::operator-<long, std::ratio<1l, 1000000000l>, long, std::ratio<1l, 1l> > (__rhs=..., __lhs=...)
      at /usr/include/c++/12/bits/chrono.h:650
  #9  std::chrono::operator-<NodeClock, std::chrono::duration<long, std::ratio<1l, 1000000000l> >, long, std::ratio<1l, 1l> > (__rhs=...,
      __lhs=...) at /usr/include/c++/12/bits/chrono.h:1020
  #10 Chainstate::IsInitialBlockDownload (this=0x555556071940) at ./src/validation.cpp:1545
  #11 0x00005555556efd1e in operator() (__closure=<optimized out>) at ./src/net_processing.cpp:3369
  #12 (anonymous namespace)::PeerManagerImpl::ProcessMessage (this=0x555556219be0, pfrom=..., msg_type=..., vRecv=..., time_received=...,
      interruptMsgProc=...) at ./src/net_processing.cpp:3369
  #13 0x00005555556f75cc in (anonymous namespace)::PeerManagerImpl::ProcessMessages (this=0x555556219be0, pfrom=<optimized out>,
      interruptMsgProc=std::atomic<bool> = { false }) at ./src/net_processing.cpp:4985
  #14 0x00005555556a83c9 in CConnman::ThreadMessageHandler (this=0x5555560ebc70) at ./src/net.cpp:2014
  #15 0x0000555555c4d5d6 in std::function<void ()>::operator()() const (this=0x7fff91ffadb0) at /usr/include/c++/12/bits/std_function.h:591
  bitcoin#16 util::TraceThread(std::basic_string_view<char, std::char_traits<char> >, std::function<void ()>) (
      thread_name="0\255\377\221\377\177\000\000\v\000\000\000\000\000\000\000TraceThread\000\000\000\000\000P\255\377\221\377\177\000\000\017\000\000\000\000\000\000\000util/thread.cpp\000\000\000\000\000\000\000\000\000\000ihB鵿6\000\000\000\000\000\000\000\000\260\255\377\221\377\177\000\000\277\211\321UUU\000\000p\324\304UUU\000\000\002\000\000\000\000\000\000\000\240xh\367\377\177\000\000\000\000\000\000\000\000\000\000]\340iUUU\000\000p\274\016VUU\000\000\000\000\000\000\000\000\000\000\300\303iUUU\000\000p\206jUUU", '\000' <repeats 11 times>, "ihB鵿6\200\251!VUU\000\000"..., thread_func=...) at util/thread.cpp:21
  bitcoin#17 0x000055555569e05d in std::__invoke_impl<void, void (*)(std::basic_string_view<char>, std::function<void()>), char const*, CConnman::Start(CScheduler&, const Options&)::<lambda()> > (__f=<optimized out>) at /usr/include/c++/12/bits/invoke.h:61
  bitcoin#18 std::__invoke<void (*)(std::basic_string_view<char>, std::function<void()>), char const*, CConnman::Start(CScheduler&, const Options&)::<lambda()> > (__fn=<optimized out>) at /usr/include/c++/12/bits/invoke.h:96
  bitcoin#19 std::thread::_Invoker<std::tuple<void (*)(std::basic_string_view<char, std::char_traits<char> >, std::function<void()>), char const*, CConnman::Start(CScheduler&, const Options&)::<lambda()> > >::_M_invoke<0, 1, 2> (this=<optimized out>) at /usr/include/c++/12/bits/std_thread.h:252
  bitcoin#20 std::thread::_Invoker<std::tuple<void (*)(std::basic_string_view<char, std::char_traits<char> >, std::function<void()>), char const*, CConnman::Start(CScheduler&, const Options&)::<lambda()> > >::operator() (this=<optimized out>) at /usr/include/c++/12/bits/std_thread.h:259
  bitcoin#21 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)(std::basic_string_view<char, std::char_traits<char> >, std::function<void()>), char const*, CConnman::Start(CScheduler&, const Options&)::<lambda()> > > >::_M_run(void) (this=<optimized out>)
      at /usr/include/c++/12/bits/std_thread.h:210
  bitcoin#22 0x00007ffff7ad43d3 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
  bitcoin#23 0x00007ffff7687b27 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:435
  bitcoin#24 0x00007ffff770a78c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  (gdb)
  ```

ACKs for top commit:
  MarcoFalke:
    review ACK e4be0e9 🏽

Tree-SHA512: d892d6264a284d952a68a8631a6301277373b8df939dafd9e2652f2f22ab60712cde63b90c27c67ea2d05f02443452e3e4e1b9f25479bfaca00d4c4de13b9fbd
0xB10C pushed a commit that referenced this pull request Mar 14, 2023
05eeba2 [test] Add manual prune startup test case (dergoegge)
4517419 [util] Avoid integer overflow in CheckDiskSpace (dergoegge)

Pull request description:

  Starting a fresh node with `-prune=1` causes an integer overflow to happen in `CheckDiskSpace` ([here](https://github.com/bitcoin/bitcoin/blob/f7bdcfc83f5753349018be3b5a663c8923d1a5eb/src/init.cpp#L1633-L1648)) because `nPruneTarget` is to the max `uint64_t` value.
  ```
   node1 stderr util/system.cpp:138:51: runtime error: unsigned integer overflow: 52428800 + 18446744073709551615 cannot be represented in type 'unsigned long'
      #0 0x564a482b5088 in CheckDiskSpace(fs::path const&, unsigned long) src/./src/util/system.cpp:138:51
      #1 0x564a4728dc59 in AppInitMain(node::NodeContext&, interfaces::BlockAndHeaderTipInfo*) src/./src/init.cpp:1639:14
      #2 0x564a47256e6a in AppInit(node::NodeContext&, int, char**) src/./src/bitcoind.cpp:221:43
      #3 0x564a47256087 in main src/./src/bitcoind.cpp:265:13
      #4 0x7fcb7cbffd8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: 69389d485a9793dbe873f0ea2c93e02efaa9aa3d)
      #5 0x7fcb7cbffe3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f) (BuildId: 69389d485a9793dbe873f0ea2c93e02efaa9aa3d)
      #6 0x564a471957f4 in _start (/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/bitcoind+0xca07f4) (BuildId: 035cb22302d37317a630900a15a26ecb326d395c)
  SUMMARY: UndefinedBehaviorSanitizer: unsigned-integer-overflow util/system.cpp:138:51 in
  ```

  I think side stepping the overflow for this specific case, is better than adding an exception to the UB suppresions file.

ACKs for top commit:
  MarcoFalke:
    ACK 05eeba2 🥝
  john-moffett:
    ACK 05eeba2

Tree-SHA512: 1d8e6bcb49818139f04b5ab2cbef7f9b422bf0c38a804cd532b6bd0ba4c4fd07f959ba977e59896343f213086c8ecc48180f50d006638dc84649c66ec379d58a
0xB10C pushed a commit that referenced this pull request May 2, 2023
f952e67 ci: remove usage of untrusted bpfcc-tools (fanquake)
1232c2f ci: use LLVM/clang-16 in native_asan job (fanquake)

Pull request description:

  Similar to bitcoin#27298. Working for me on `x86_64` and solves the issue I currently see with TSAN on `aarch64` with master (6882828):
  ```bash
  crc32c/src/crc32c_arm64.cc:101:26: runtime error: load of misaligned address 0xffff84400406 for type 'uint64_t' (aka 'unsigned long'), which requires 8 byte alignment
  0xffff84400406: note: pointer points here
   b9 c5 22 00 01 01  1a 6c 65 76 65 6c 64 62  2e 42 79 74 65 77 69 73  65 43 6f 6d 70 61 72 61  74 6f
               ^
      #0 0xaaaaaddaf0b4 in crc32c::ExtendArm64(unsigned int, unsigned char const*, unsigned long) src/./src/crc32c/src/crc32c_arm64.cc:101:26
      #1 0xaaaaadd2c838 in leveldb::crc32c::Value(char const*, unsigned long) src/./leveldb/util/crc32c.h:20:60
      #2 0xaaaaadd2c838 in leveldb::log::Reader::ReadPhysicalRecord(leveldb::Slice*) src/./src/leveldb/db/log_reader.cc:246:29
      #3 0xaaaaadd2ba9c in leveldb::log::Reader::ReadRecord(leveldb::Slice*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) src/./src/leveldb/db/log_reader.cc:72:38
      #4 0xaaaaadd41710 in leveldb::VersionSet::Recover(bool*) src/./src/leveldb/db/version_set.cc:910:19
      #5 0xaaaaadcf9fec in leveldb::DBImpl::Recover(leveldb::VersionEdit*, bool*) src/./src/leveldb/db/db_impl.cc:320:18
      #6 0xaaaaadd12068 in leveldb::DB::Open(leveldb::Options const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, leveldb::DB**) src/./src/leveldb/db/db_impl.cc:1487:20
      #7 0xaaaaad314e80 in CDBWrapper::CDBWrapper(DBParams const&) src/./src/dbwrapper.cpp:156:30
      #8 0xaaaaace94880 in CBlockTreeDB::CBlockTreeDB(DBParams const&) src/./txdb.h:89:23
      #9 0xaaaaace94880 in std::_MakeUniq<CBlockTreeDB>::__single_object std::make_unique<CBlockTreeDB, DBParams>(DBParams&&) /usr/bin/../lib/gcc/aarch64-linux-gnu/11/../../../../include/c++/11/bits/unique_ptr.h:962:34
      #10 0xaaaaace94880 in ChainTestingSetup::ChainTestingSetup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<char const*, std::allocator<char const*> > const&) src/./src/test/util/setup_common.cpp:188:51
      #11 0xaaaaace95da0 in TestingSetup::TestingSetup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<char const*, std::allocator<char const*> > const&, bool, bool) src/./src/test/util/setup_common.cpp:243:7
      #12 0xaaaaace96730 in TestChain100Setup::TestChain100Setup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<char const*, std::allocator<char const*> > const&, bool, bool) src/./src/test/util/setup_common.cpp:274:7
      #13 0xaaaaac1ddbc8 in blockfilter_index_tests::BuildChainTestingSetup::BuildChainTestingSetup() src/./src/test/blockfilter_index_tests.cpp:26:8
      #14 0xaaaaac1ddbc8 in blockfilter_index_tests::blockfilter_index_initial_sync::blockfilter_index_initial_sync() src/./src/test/blockfilter_index_tests.cpp:112:1
      #15 0xaaaaac1ddbc8 in blockfilter_index_tests::blockfilter_index_initial_sync_invoker() src/./src/test/blockfilter_index_tests.cpp:112:1
      bitcoin#16 0xaaaaabf08f7c in boost::function0<void>::operator()() const /usr/include/boost/function/function_template.hpp:763:14
      bitcoin#17 0xaaaaabf95468 in boost::detail::forward::operator()() /usr/include/boost/test/impl/execution_monitor.ipp:1388:32
      bitcoin#18 0xaaaaabf95468 in 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
      bitcoin#19 0xaaaaabf8e12c in boost::function0<int>::operator()() const /usr/include/boost/function/function_template.hpp:763:14
      bitcoin#20 0xaaaaabe7be14 in boost::execution_monitor::catch_signals(boost::function<int ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:903:16
      bitcoin#21 0xaaaaabe7c1c0 in boost::execution_monitor::execute(boost::function<int ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:1301:16
      bitcoin#22 0xaaaaabe6f47c in boost::execution_monitor::vexecute(boost::function<void ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:1397:5
      bitcoin#23 0xaaaaabe75124 in 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
      bitcoin#24 0xaaaaabed19fc in 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
      bitcoin#25 0xaaaaabed0f6c in 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:784:58
      bitcoin#26 0xaaaaabed0f6c in 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:784:58
      bitcoin#27 0xaaaaabe73878 in boost::unit_test::framework::run(unsigned long, bool) /usr/include/boost/test/impl/framework.ipp:1721:29
      bitcoin#28 0xaaaaabe9d244 in 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
      bitcoin#29 0xffff8f0773f8  (/lib/aarch64-linux-gnu/libc.so.6+0x273f8) (BuildId: f37f3aa07c797e333fd106472898d361f71798f5)
      bitcoin#30 0xffff8f0774c8 in __libc_start_main (/lib/aarch64-linux-gnu/libc.so.6+0x274c8) (BuildId: f37f3aa07c797e333fd106472898d361f71798f5)
      bitcoin#31 0xaaaaabda55ac in _start (/home/fedora/ci_scratch/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/src/test/test_bitcoin+0x10e55ac) (BuildId: b7909adaefd9db6cd6a7c4d3d40207cf6bdaf4b3)

  SUMMARY: UndefinedBehaviorSanitizer: misaligned-pointer-use crc32c/src/crc32c_arm64.cc:101:26 in
  ```

ACKs for top commit:
  dergoegge:
    utACK f952e67
  MarcoFalke:
    lgtm ACK f952e67

Tree-SHA512: 9dee2abf73d3f23bb9979bfb453b48e39f0b7a5f58d43824ecf053a53e9800ed413b915382b274d1a84baf2999683e3b485463e377e0455b3f0ead65ed1d1916
0xB10C pushed a commit that referenced this pull request Sep 8, 2023
…/fees fuzz target

faa05d1 fuzz: Fix implicit-integer-sign-change in wallet/fees fuzz target (MarcoFalke)

Pull request description:

  This fixes a bug in the fuzz target.

  ```
  echo 'OiAAAPr//wAAAAAAAAA=' | base64  --decode > /tmp/a
  UBSAN_OPTIONS="suppressions=$(pwd)/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1" FUZZ=wallet_fees ./src/test/fuzz/fuzz  /tmp/a
  ```

  ```
  wallet/fees.cpp:58:58: runtime error: implicit conversion from type 'unsigned int' of value 4294574080 (32-bit, unsigned) to type 'int' changed the value to -393216 (32-bit, signed)
      #0 0x5625ef46a094 in wallet::GetMinimumFeeRate(wallet::CWallet const&, wallet::CCoinControl const&, FeeCalculation*) src/wallet/fees.cpp:58:58
      #1 0x5625eedd467f in wallet::(anonymous namespace)::wallet_fees_fuzz_target(Span<unsigned char const>) src/wallet/test/fuzz/fees.cpp:64:11
  ...

  SUMMARY: UndefinedBehaviorSanitizer: implicit-integer-sign-change wallet/fees.cpp:58:58 in

ACKs for top commit:
  dergoegge:
    tACK faa05d1
  brunoerg:
    ACK faa05d1

Tree-SHA512: 66a4020d6a4153a92c7023e9f94ec6279862566db7236ce3cf6951b7fbee616dc88a56fe9502de4099d74f9840439b20a984b0733fb432e43129e774bcc2a6e6
0xB10C pushed a commit that referenced this pull request Sep 8, 2023
682274a ci: install llvm-symbolizer in MSAN jobs (fanquake)
96527cd ci: use LLVM 16.0.6 in MSAN jobs (fanquake)

Pull request description:

  Fixes: bitcoin#27737 (comment).

  Tested (locally) with bitcoin#27495 that it produces a symbolized backtrace:
  ```bash
  2023-06-20T17:5Uninitialized bytes in __interceptor_strlen at offset 113 inside [0x719000006908, 114)
  ==35429==WARNING: MemorySanitizer: use-of-uninitialized-value
      #0 0x56060fae8c4b in sqlite3Strlen30 /home/ubuntu/ci_scratch/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-f816a3e2d52/sqlite3.c:32670:28
      #1 0x56060fb0fcf4 in sqlite3PagerOpen /home/ubuntu/ci_scratch/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-f816a3e2d52/sqlite3.c:57953:17
      #2 0x56060fb0f48b in sqlite3BtreeOpen /home/ubuntu/ci_scratch/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-f816a3e2d52/sqlite3.c:68679:10
      #3 0x56060fb01384 in openDatabase /home/ubuntu/ci_scratch/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-f816a3e2d52/sqlite3.c:171911:8
      #4 0x56060fb016ca in sqlite3_open_v2 /home/ubuntu/ci_scratch/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-f816a3e2d52/sqlite3.c:172034:10
      #5 0x56060e8a94db in wallet::SQLiteDatabase::Open() src/wallet/sqlite.cpp:250:19
      #6 0x56060e8a30fd in wallet::SQLiteDatabase::SQLiteDatabase(fs::path const&, fs::path const&, wallet::DatabaseOptions const&, bool) src/wallet/sqlite.cpp:133:9
      #7 0x56060e8b78f5 in std::__1::__unique_if<wallet::SQLiteDatabase>::__unique_single std::__1::make_unique[abi:v160006]<wallet::SQLiteDatabase, std::__1::__fs::filesystem::path, fs::path&, wallet::DatabaseOptions const&>(std::__1::__fs::filesystem::path&&, fs::path&, wallet::DatabaseOptions const&) /home/ubuntu/ci_scratch/ci/scratch/msan/cxx_build/include/c++/v1/__memory/unique_ptr.h:686:30
      #8 0x56060e8b5240 in wallet::MakeSQLiteDatabase(fs::path const&, wallet::DatabaseOptions const&, wallet::DatabaseStatus&, bilingual_str&) src/wallet/sqlite.cpp:641:19
      #9 0x56060e83560b in wallet::MakeDatabase(fs::path const&, wallet::DatabaseOptions const&, wallet::DatabaseStatus&, bilingual_str&) src/wallet/walletdb.cpp:1261:16
      #10 0x56060e7546e9 in wallet::MakeWalletDatabase(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, wallet::DatabaseOptions const&, wallet::DatabaseStatus&, bilingual_str&) src/wallet/wallet.cpp:2905:12
      #11 0x56060e4bc03f in wallet::TestLoadWallet(wallet::WalletContext&) src/wallet/test/util.cpp:68:21
      #12 0x56060e349ad4 in wallet::wallet_tests::ZapSelectTx::test_method() src/wallet/test/wallet_tests.cpp:897:19
      #13 0x56060e348598 in wallet::wallet_tests::ZapSelectTx_invoker() src/wallet/test/wallet_tests.cpp:891:1
      #14 0x56060cfec325 in boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) /home/ubuntu/ci_scratch/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:117:11
      #15 0x56060ced3a7e in boost::function0<void>::operator()() const /home/ubuntu/ci_scratch/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:763:14
      bitcoin#16 0x56060ced3a7e in boost::detail::forward::operator()() /home/ubuntu/ci_scratch/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1388:32
      bitcoin#17 0x56060ced3a7e in boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) /home/ubuntu/ci_scratch/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:137:18
      bitcoin#18 0x56060cda71c2 in boost::function0<int>::operator()() const /home/ubuntu/ci_scratch/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:763:14
      bitcoin#19 0x56060cda71c2 in 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/ubuntu/ci_scratch/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:301:30
      bitcoin#20 0x56060cda71c2 in boost::execution_monitor::catch_signals(boost::function<int ()> const&) /home/ubuntu/ci_scratch/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:903:16
      bitcoin#21 0x56060cda784a in boost::execution_monitor::execute(boost::function<int ()> const&) /home/ubuntu/ci_scratch/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1301:16
      bitcoin#22 0x56060cd9ec3a in boost::execution_monitor::vexecute(boost::function<void ()> const&) /home/ubuntu/ci_scratch/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1397:5
      bitcoin#23 0x56060cd9ec3a in boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned long) /home/ubuntu/ci_scratch/depends/x86_64-pc-linux-gnu/include/boost/test/impl/unit_test_monitor.ipp:49:9
      bitcoin#24 0x56060ce1a07b in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/ubuntu/ci_scratch/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:815:44
      bitcoin#25 0x56060ce1ad8b in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/ubuntu/ci_scratch/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:784:58
      bitcoin#26 0x56060ce1ad8b in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /home/ubuntu/ci_scratch/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:784:58
      bitcoin#27 0x56060cd9b8de in boost::unit_test::framework::run(unsigned long, bool) /home/ubuntu/ci_scratch/depends/x86_64-pc-linux-gnu/include/boost/test/impl/framework.ipp:1722:29
      bitcoin#28 0x56060cdd4fac in boost::unit_test::unit_test_main(boost::unit_test::test_suite* (*)(int, char**), int, char**) /home/ubuntu/ci_scratch/depends/x86_64-pc-linux-gnu/include/boost/test/impl/unit_test_main.ipp:250:9
      bitcoin#29 0x56060cdd6094 in main /home/ubuntu/ci_scratch/depends/x86_64-pc-linux-gnu/include/boost/test/impl/unit_test_main.ipp:306:12
      bitcoin#30 0x7f7379691d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) (BuildId: 69389d485a9793dbe873f0ea2c93e02efaa9aa3d)
      bitcoin#31 0x7f7379691e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f) (BuildId: 69389d485a9793dbe873f0ea2c93e02efaa9aa3d)
      bitcoin#32 0x56060cce2e24 in _start (/home/ubuntu/ci_scratch/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/test_bitcoin+0x188e24)

    Uninitialized value was created by a heap allocation
      #0 0x56060cd163f2 in malloc /ci_base_install/ci/scratch/msan/llvm-project/compiler-rt/lib/msan/msan_interceptors.cpp:934:3
      #1 0x56060fc10069 in sqlite3MemMalloc /home/ubuntu/ci_scratch/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-f816a3e2d52/sqlite3.c:25163:7
      #2 0x56060fb063bc in mallocWithAlarm /home/ubuntu/ci_scratch/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-f816a3e2d52/sqlite3.c:28846:7
      #3 0x56060fae4eb9 in sqlite3Malloc /home/ubuntu/ci_scratch/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-f816a3e2d52/sqlite3.c:28876:5
      #4 0x56060faf9e19 in sqlite3DbMallocRaw /home/ubuntu/ci_scratch/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-f816a3e2d52/sqlite3.c:29176:7
      #5 0x56060fb0fc67 in sqlite3PagerOpen /home/ubuntu/ci_scratch/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-f816a3e2d52/sqlite3.c:57938:17
      #6 0x56060fb0f48b in sqlite3BtreeOpen /home/ubuntu/ci_scratch/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-f816a3e2d52/sqlite3.c:68679:10
      #7 0x56060fb01384 in openDatabase /home/ubuntu/ci_scratch/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-f816a3e2d52/sqlite3.c:171911:8
      #8 0x56060fb016ca in sqlite3_open_v2 /home/ubuntu/ci_scratch/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-f816a3e2d52/sqlite3.c:172034:10
      #9 0x56060e8a94db in wallet::SQLiteDatabase::Open() src/wallet/sqlite.cpp:250:19
      #10 0x56060e8a30fd in wallet::SQLiteDatabase::SQLiteDatabase(fs::path const&, fs::path const&, wallet::DatabaseOptions const&, bool) src/wallet/sqlite.cpp:133:9
      #11 0x56060e8b78f5 in std::__1::__unique_if<wallet::SQLiteDatabase>::__unique_single std::__1::make_unique[abi:v160006]<wallet::SQLiteDatabase, std::__1::__fs::filesystem::path, fs::path&, wallet::DatabaseOptions const&>(std::__1::__fs::filesystem::path&&, fs::path&, wallet::DatabaseOptions const&) /home/ubuntu/ci_scratch/ci/scratch/msan/cxx_build/include/c++/v1/__memory/unique_ptr.h:686:30
      #12 0x56060e8b5240 in wallet::MakeSQLiteDatabase(fs::path const&, wallet::DatabaseOptions const&, wallet::DatabaseStatus&, bilingual_str&) src/wallet/sqlite.cpp:641:19
      #13 0x56060e83560b in wallet::MakeDatabase(fs::path const&, wallet::DatabaseOptions const&, wallet::DatabaseStatus&, bilingual_str&) src/wallet/walletdb.cpp:1261:16
      #14 0x56060e7546e9 in wallet::MakeWalletDatabase(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, wallet::DatabaseOptions const&, wallet::DatabaseStatus&, bilingual_str&) src/wallet/wallet.cpp:2905:12
      #15 0x56060e4bc03f in wallet::TestLoadWallet(wallet::WalletContext&) src/wallet/test/util.cpp:68:21
      bitcoin#16 0x56060e349ad4 in wallet::wallet_tests::ZapSelectTx::test_method() src/wallet/test/wallet_tests.cpp:897:19
      bitcoin#17 0x56060e348598 in wallet::wallet_tests::ZapSelectTx_invoker() src/wallet/test/wallet_tests.cpp:891:1
      bitcoin#18 0x56060cfec325 in boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) /home/ubuntu/ci_scratch/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:117:11
      bitcoin#19 0x56060ced3a7e in boost::function0<void>::operator()() const /home/ubuntu/ci_scratch/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:763:14
      bitcoin#20 0x56060ced3a7e in boost::detail::forward::operator()() /home/ubuntu/ci_scratch/depends/x86_64-pc-linux-gnu/include/boost/test/impl/execution_monitor.ipp:1388:32
      bitcoin#21 0x56060ced3a7e in boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) /home/ubuntu/ci_scratch/depends/x86_64-pc-linux-gnu/include/boost/function/function_template.hpp:137:18

  SUMMARY: MemorySanitizer: use-of-uninitialized-value /home/ubuntu/ci_scratch/depends/work/build/x86_64-pc-linux-gnu/sqlite/3380500-f816a3e2d52/sqlite3.c:32670:28 in sqlite3Strlen30
  ```

  as opposed to unsymbolized: https://cirrus-ci.com/task/6005512018329600?logs=ci#L3245.

ACKs for top commit:
  MarcoFalke:
    lgtm ACK 682274a

Tree-SHA512: 8f3e7636761c956537a472989bf07529f5afbd988c5e7e1f07ece8b2599608fa4fe9e1efdc6e302cf0f7f44dec3cf9a3c1e68b758af81a8a8b476a43d3220807
0xB10C pushed a commit that referenced this pull request Oct 31, 2023
… proxy

5cf4d26 [test] Test i2p private key constraints (Vasil Dimov)
cf70a8d [net] Check i2p private key constraints (dergoegge)

Pull request description:

  Not sanity checking can lead to crashes or worse:

  ```
  ==1715589==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6140000055c2 at pc 0x5622ed66e7ad bp 0x7ffee547a2c0 sp 0x7ffee547a2b8
  READ of size 2 at 0x6140000055c2 thread T0 (b-test)
      #0 0x5622ed66e7ac in memcpy include/bits/string_fortified.h:29:10
      #1 0x5622ed66e7ac in i2p::sam::Session::MyDestination() const src/i2p.cpp:362:5
      #2 0x5622ed662e46 in i2p::sam::Session::CreateIfNotCreatedAlready() src/i2p.cpp:414:40
      #3 0x5622ed6619f2 in i2p::sam::Session::Listen(i2p::Connection&) src/i2p.cpp:143:9
  ```

ACKs for top commit:
  maflcko:
    code lgtm ACK 5cf4d26
  stickies-v:
    re-ACK 5cf4d26
  vasild:
    ACK 5cf4d26

Tree-SHA512: 3de3bd396538fa619de67957b9c8a58011ab911f0f51097c387e730c13908278b7322aa3357051fb245a20b15bef34b0e9fadcb1eff8ad751139d2aa634c78ad
0xB10C pushed a commit that referenced this pull request Dec 5, 2023
…BlockTx suppression

fa9dc92 test: Add missing CBlockPolicyEstimator::processBlockTx suppression (MarcoFalke)

Pull request description:

  Fixes bitcoin#28865 (comment)

  ```
  # FUZZ=policy_estimator UBSAN_OPTIONS="suppressions=/root/fuzz_dir/scratch/fuzz_gen/code/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1" ./src/test/fuzz/fuzz /tmp/crash-154b42214e70781a9c1ad72d3f2693913dcf8c06

  ...

  policy/fees.cpp:632:27: runtime error: implicit conversion from type 'unsigned int' of value 4294574080 (32-bit, unsigned) to type 'int' changed the value to -393216 (32-bit, signed)
      #0 0x55cbbe10daee in CBlockPolicyEstimator::processBlockTx(unsigned int, CTxMemPoolEntry const*) src/policy/fees.cpp:632:27
      #1 0x55cbbe10e361 in CBlockPolicyEstimator::processBlock(unsigned int, std::vector<CTxMemPoolEntry const*, std::allocator<CTxMemPoolEntry const*>>&) src/policy/fees.cpp:680:13
      #2 0x55cbbd84af48 in policy_estimator_fuzz_target(Span<unsigned char const>)::$_1::operator()() const src/test/fuzz/policy_estimator.cpp:69:40
      #3 0x55cbbd84af48 in unsigned long CallOneOf<policy_estimator_fuzz_target(Span<unsigned char const>)::$_0, policy_estimator_fuzz_target(Span<unsigned char const>)::$_1, policy_estimator_fuzz_target(Span<unsigned char const>)::$_2, policy_estimator_fuzz_target(Span<unsigned char const>)::$_3>(FuzzedDataProvider&, policy_estimator_fuzz_target(Span<unsigned char const>)::$_0, policy_estimator_fuzz_target(Span<unsigned char const>)::$_1, policy_estimator_fuzz_target(Span<unsigned char const>)::$_2, policy_estimator_fuzz_target(Span<unsigned char const>)::$_3) src/./test/fuzz/util.h:43:27
      #4 0x55cbbd84af48 in policy_estimator_fuzz_target(Span<unsigned char const>) src/test/fuzz/policy_estimator.cpp:38:9
      #5 0x55cbbda1cc18 in std::function<void (Span<unsigned char const>)>::operator()(Span<unsigned char const>) const /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:591:9
      #6 0x55cbbda1cc18 in LLVMFuzzerTestOneInput src/test/fuzz/fuzz.cpp:178:5
      #7 0x55cbbd26a944 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) (/root/fuzz_dir/scratch/fuzz_gen/code/src/test/fuzz/fuzz+0x190e944) (BuildId: ffb89e0b86c093ca3bdeae6f85537737a4e3b42d)
      #8 0x55cbbd253916 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) (/root/fuzz_dir/scratch/fuzz_gen/code/src/test/fuzz/fuzz+0x18f7916) (BuildId: ffb89e0b86c093ca3bdeae6f85537737a4e3b42d)
      #9 0x55cbbd25945a in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) (/root/fuzz_dir/scratch/fuzz_gen/code/src/test/fuzz/fuzz+0x18fd45a) (BuildId: ffb89e0b86c093ca3bdeae6f85537737a4e3b42d)
      #10 0x55cbbd284026 in main (/root/fuzz_dir/scratch/fuzz_gen/code/src/test/fuzz/fuzz+0x1928026) (BuildId: ffb89e0b86c093ca3bdeae6f85537737a4e3b42d)
      #11 0x7fe4aa8280cf  (/lib/x86_64-linux-gnu/libc.so.6+0x280cf) (BuildId: 96ab1a8f3b2c9a2ed37c7388615e6a726d037e89)
      #12 0x7fe4aa828188 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28188) (BuildId: 96ab1a8f3b2c9a2ed37c7388615e6a726d037e89)
      #13 0x55cbbd24e494 in _start (/root/fuzz_dir/scratch/fuzz_gen/code/src/test/fuzz/fuzz+0x18f2494) (BuildId: ffb89e0b86c093ca3bdeae6f85537737a4e3b42d)

  SUMMARY: UndefinedBehaviorSanitizer: implicit-integer-sign-change policy/fees.cpp:632:27 in
  ```

  ```
  # base64 /tmp/crash-154b42214e70781a9c1ad72d3f2693913dcf8c06
  AQEAAAAAADkFlVwAAQEAAAAAADkFlZVcACTDSSsP3746IAZrH48khwMAAQEB/QEALQAACwAAAAAA
  FgAAAAAAAQAABgAAAAAAAAAAAAAAAAAAACcQAAAAAAAAAAAAAAAAAAAAAAD6AAAAOQWVXAABAQAA
  AAAAOQWVlVwAIMNJKw/fvjogBmsfjySHAwABAQH9AQAtAAALAAAAAAAAAAABAAAGAAAAAAAAAAAA
  AAAAAAAAJxAAAAAAAAAAAAAAAAAAAAAAAPr/AAAAAAAAAAAAAAQAAAAA/wAAAAAAAAAAAAAEAAAA
  AAEBAeAIAVwBXAAA/jbSBvwBKABSKBwBYgEB2wAEkvXInHYAAAAAAAAAvgAAAAAA/9//6v8e/xIk
  MgAlAiUAOw==

ACKs for top commit:
  fanquake:
    ACK fa9dc92
  dergoegge:
    utACK fa9dc92

Tree-SHA512: 3898c17c928ecc2bcc8c7086359e9ae00da2197b4d8e10c7bf6d12415326c9bca3ef6e1d8d3b83172ccfa604ce7e7371415262ba705225f9ea4da8b1a7eb0306
0xB10C pushed a commit that referenced this pull request Dec 5, 2023
…tifications fuzz target

fab164f fuzz: Avoid signed-integer-overflow in wallet_notifications fuzz target (MarcoFalke)

Pull request description:

  Should avoid

  ```
  policy/feerate.cpp:29:63: runtime error: signed integer overflow: 77600710321911316 * 149 cannot be represented in type 'int64_t' (aka 'long')
      #0 0x563a1775ed66 in CFeeRate::GetFee(unsigned int) const src/policy/feerate.cpp:29:63
      #1 0x563a15913a69 in wallet::COutput::COutput(COutPoint const&, CTxOut const&, int, int, bool, bool, bool, long, bool, std::optional<CFeeRate>) src/./wallet/coinselection.h:91:57
      #2 0x563a16fa6a6d in wallet::FetchSelectedInputs(wallet::CWallet const&, wallet::CCoinControl const&, wallet::CoinSelectionParams const&) src/wallet/spend.cpp:297:17
      #3 0x563a16fc4512 in wallet::CreateTransactionInternal(wallet::CWallet&, std::vector<wallet::CRecipient, std::allocator<wallet::CRecipient>> const&, int, wallet::CCoinControl const&, bool) src/wallet/spend.cpp:1105:33
      #4 0x563a16fbec74 in wallet::CreateTransaction(wallet::CWallet&, std::vector<wallet::CRecipient, std::allocator<wallet::CRecipient>> const&, int, wallet::CCoinControl const&, bool) src/wallet/spend.cpp:1291:16
      #5 0x563a16fcf6df in wallet::FundTransaction(wallet::CWallet&, CMutableTransaction&, long&, int&, bilingual_str&, bool, std::set<int, std::less<int>, std::allocator<int>> const&, wallet::CCoinControl) src/wallet/spend.cpp:1361:16
      #6 0x563a1597b7b9 in wallet::(anonymous namespace)::FuzzedWallet::FundTx(FuzzedDataProvider&, CMutableTransaction) src/wallet/test/fuzz/notifications.cpp:162:15
      #7 0x563a15958240 in wallet::(anonymous namespace)::wallet_notifications_fuzz_target(Span<unsigned char const>)::$_0::operator()() const src/wallet/test/fuzz/notifications.cpp:228:23
      #8 0x563a15958240 in unsigned long CallOneOf<wallet::(anonymous namespace)::wallet_notifications_fuzz_target(Span<unsigned char const>)::$_0, wallet::(anonymous namespace)::wallet_notifications_fuzz_target(Span<unsigned char const>)::$_1>(FuzzedDataProvider&, wallet::(anonymous namespace)::wallet_notifications_fuzz_target(Span<unsigned char const>)::$_0, wallet::(anonymous namespace)::wallet_notifications_fuzz_target(Span<unsigned char const>)::$_1) src/./test/fuzz/util.h:43:27
      #9 0x563a15958240 in wallet::(anonymous namespace)::wallet_notifications_fuzz_target(Span<unsigned char const>) src/wallet/test/fuzz/notifications.cpp:196:9
      #10 0x563a15fdef0c in std::function<void (Span<unsigned char const>)>::operator()(Span<unsigned char const>) const /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:591:9
      #11 0x563a15fdef0c in LLVMFuzzerTestOneInput src/test/fuzz/fuzz.cpp:178:5
      #12 0x563a158032a4 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) (/ci_container_base/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/fuzz/fuzz+0x19822a4) (BuildId: 8acb42ad599d7f6d25b6f93e18fd564d80df7c06)
      #13 0x563a15802999 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) (/ci_container_base/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/fuzz/fuzz+0x1981999) (BuildId: 8acb42ad599d7f6d25b6f93e18fd564d80df7c06)
      #14 0x563a15804586 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::vector<fuzzer::SizedFile, std::allocator<fuzzer::SizedFile>>&) (/ci_container_base/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/fuzz/fuzz+0x1983586) (BuildId: 8acb42ad599d7f6d25b6f93e18fd564d80df7c06)
      #15 0x563a15804aa7 in fuzzer::Fuzzer::Loop(std::vector<fuzzer::SizedFile, std::allocator<fuzzer::SizedFile>>&) (/ci_container_base/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/fuzz/fuzz+0x1983aa7) (BuildId: 8acb42ad599d7f6d25b6f93e18fd564d80df7c06)
      bitcoin#16 0x563a157f21fb in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) (/ci_container_base/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/fuzz/fuzz+0x19711fb) (BuildId: 8acb42ad599d7f6d25b6f93e18fd564d80df7c06)
      bitcoin#17 0x563a1581c766 in main (/ci_container_base/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/fuzz/fuzz+0x199b766) (BuildId: 8acb42ad599d7f6d25b6f93e18fd564d80df7c06)
      bitcoin#18 0x7f499e17b0cf  (/lib/x86_64-linux-gnu/libc.so.6+0x280cf) (BuildId: 96ab1a8f3b2c9a2ed37c7388615e6a726d037e89)
      bitcoin#19 0x7f499e17b188 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28188) (BuildId: 96ab1a8f3b2c9a2ed37c7388615e6a726d037e89)
      bitcoin#20 0x563a157e70c4 in _start (/ci_container_base/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/fuzz/fuzz+0x19660c4) (BuildId: 8acb42ad599d7f6d25b6f93e18fd564d80df7c06)

  SUMMARY: UndefinedBehaviorSanitizer: signed-integer-overflow policy/feerate.cpp:29:63 in
  MS: 0 ; base unit: 0000000000000000000000000000000000000000
  0x3f,0x0,0x2f,0x5f,0x5f,0x5f,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0xff,0xff,0xff,0xff,0xff,0x53,0xff,0xff,0xff,0xff,0xff,0x0,0x0,0x0,0x0,0x0,0x0,0x13,0x5e,0x5f,0x5f,0x8,0x25,0x0,0x5f,0x5f,0x5f,0x5f,0x5f,0x5f,0x8,0x25,0xca,0x7f,0x5f,0x5f,0x5f,0x13,0x13,0x5f,0x5f,0x5f,0x2,0xdb,0xca,0x0,0x0,0xe7,0xe6,0x66,0x65,0x0,0x0,0x0,0x0,0x44,0x3f,0xa,0xa,0xff,0xff,0xff,0xff,0xff,0x61,0x76,0x6f,0x69,0x0,0xb5,0x15,
  ?\000/___}}}}}}}}}}}}}}}}}}}}\377\377\377\377\377S\377\377\377\377\377\000\000\000\000\000\000\023^__\010%\000______\010%\312\177___\023\023___\002\333\312\000\000\347\346fe\000\000\000\000D?\012\012\377\377\377\377\377avoi\000\265\025
  artifact_prefix='./'; Test unit written to ./crash-4d3bac8a64d4e58b2f0943e6d28e6e1f16328d7d
  Base64: PwAvX19ffX19fX19fX19fX19fX19fX19fX3//////1P//////wAAAAAAABNeX18IJQBfX19fX18IJcp/X19fExNfX18C28oAAOfmZmUAAAAARD8KCv//////YXZvaQC1FQ==

ACKs for top commit:
  dergoegge:
    ACK fab164f
  brunoerg:
    ACK fab164f

Tree-SHA512: f416828f4394aa7303ee437f141e9bbd23c0e0f1b830e4ef3932338858249ba68a811b9837c5b7ad8c6ab871b6354996434183597c1a910a8d8e8d829693e4b2
0xB10C pushed a commit that referenced this pull request Aug 5, 2024
The previous commit added a test which would fail the
unsigned-integer-overflow sanitizer. The warning is harmless and can be
triggered on any commit, since the code was introduced.

For reference, the warning would happen when the separator `-` was not
present.

For example:

  GET /rest/getutxos/6a297bfa5cb8dd976ab0207a767d6cbfaa5e876f30081127ec8674c8c52b16c0_+1.json

would result in:

rest.cpp:792:77: runtime error: unsigned integer overflow: 18446744073709551615 + 1 cannot be represented in type 'size_type' (aka 'unsigned long')
    #0 0x55ad42c16931 in rest_getutxos(std::any const&, HTTPRequest*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) src/rest.cpp:792:77
    #1 0x55ad4319e3c0 in std::function<bool (HTTPRequest*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)>::operator()(HTTPRequest*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:591:9
    #2 0x55ad4319e3c0 in HTTPWorkItem::operator()() src/httpserver.cpp:59:9
    #3 0x55ad431a3eea in WorkQueue<HTTPClosure>::Run() src/httpserver.cpp:114:13
    #4 0x55ad4318f961 in HTTPWorkQueueRun(WorkQueue<HTTPClosure>*, int) src/httpserver.cpp:403:12
    #5 0x7f078ebcbbb3  (/lib/x86_64-linux-gnu/libstdc++.so.6+0xeabb3) (BuildId: 40b9b0d17fdeebfb57331304da2b7f85e1396ef2)
    #6 0x55ad4277e01c in asan_thread_start(void*) asan_interceptors.cpp.o
    #7 0x7f078e840a93  (/lib/x86_64-linux-gnu/libc.so.6+0x9ca93) (BuildId: 08134323d00289185684a4cd177d202f39c2a5f3)
    #8 0x7f078e8cdc3b  (/lib/x86_64-linux-gnu/libc.so.6+0x129c3b) (BuildId: 08134323d00289185684a4cd177d202f39c2a5f3)

SUMMARY: UndefinedBehaviorSanitizer: unsigned-integer-overflow rest.cpp:792:77
0xB10C pushed a commit that referenced this pull request Nov 7, 2024
…et_create_transaction

5a26cf7 fuzz: fix `implicit-integer-sign-change` in wallet_create_transaction (brunoerg)

Pull request description:

  This PR limites the value of `m_confirm_target` to avoid `implicit-integer-sign-change`:
  ```
  /ci_container_base/src/wallet/fees.cpp:58:58: runtime error: implicit conversion from type 'unsigned int' of value 4294967292 (32-bit, unsigned) to type 'int' changed the value to -4 (32-bit, signed)
      #0 0x55b6fd26c021 in wallet::GetMinimumFeeRate(wallet::CWallet const&, wallet::CCoinControl const&, FeeCalculation*) ci/scratch/build-x86_64-pc-linux-gnu/src/wallet/./src/wallet/fees.cpp:58:58
      #1 0x55b6fd3ef5ca in wallet::CreateTransactionInternal(wallet::CWallet&, std::vector<wallet::CRecipient, std::allocator<wallet::CRecipient>> const&, std::optional<unsigned int>, wallet::CCoinControl const&, bool) ci/scratch/build-x86_64-pc-linux-gnu/src/wallet/./src/wallet/spend.cpp:1101:49
      #2 0x55b6fd3ebea5 in wallet::CreateTransaction(wallet::CWallet&, std::vector<wallet::CRecipient, std::allocator<wallet::CRecipient>> const&, std::optional<unsigned int>, wallet::CCoinControl const&, bool) ci/scratch/build-x86_64-pc-linux-gnu/src/wallet/./src/wallet/spend.cpp:1382:16
      #3 0x55b6fccbc154 in wallet::(anonymous namespace)::wallet_create_transaction_fuzz_target(std::span<unsigned char const, 18446744073709551615ul>) ci/scratch/build-x86_64-pc-linux-gnu/src/test/fuzz/./src/wallet/test/fuzz/spend.cpp:99:11
      #4 0x55b6fccda45d in std::function<void (std::span<unsigned char const, 18446744073709551615ul>)>::operator()(std::span<unsigned char const, 18446744073709551615ul>) const /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:591:9
      #5 0x55b6fccda45d in LLVMFuzzerTestOneInput ci/scratch/build-x86_64-pc-linux-gnu/src/test/fuzz/util/./src/test/fuzz/fuzz.cpp:211:5
      #6 0x55b6fc368484 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) (/ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu/src/test/fuzz/fuzz+0x1c8a484) (BuildId: d11f8692b05f02b5a14b6e7579598b426e3144c5)
      #7 0x55b6fc367b79 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) (/ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu/src/test/fuzz/fuzz+0x1c89b79) (BuildId: d11f8692b05f02b5a14b6e7579598b426e3144c5)
      #8 0x55b6fc369796 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::vector<fuzzer::SizedFile, std::allocator<fuzzer::SizedFile>>&) (/ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu/src/test/fuzz/fuzz+0x1c8b796) (BuildId: d11f8692b05f02b5a14b6e7579598b426e3144c5)
      #9 0x55b6fc369ca7 in fuzzer::Fuzzer::Loop(std::vector<fuzzer::SizedFile, std::allocator<fuzzer::SizedFile>>&) (/ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu/src/test/fuzz/fuzz+0x1c8bca7) (BuildId: d11f8692b05f02b5a14b6e7579598b426e3144c5)
      #10 0x55b6fc35719f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) (/ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu/src/test/fuzz/fuzz+0x1c7919f) (BuildId: d11f8692b05f02b5a14b6e7579598b426e3144c5)
      #11 0x55b6fc381826 in main (/ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu/src/test/fuzz/fuzz+0x1ca3826) (BuildId: d11f8692b05f02b5a14b6e7579598b426e3144c5)
      #12 0x7f934c6661c9  (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 6d64b17fbac799e68da7ebd9985ddf9b5cb375e6)
      #13 0x7f934c66628a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 6d64b17fbac799e68da7ebd9985ddf9b5cb375e6)
      #14 0x55b6fc34c184 in _start (/ci_container_base/ci/scratch/build-x86_64-pc-linux-gnu/src/test/fuzz/fuzz+0x1c6e184) (BuildId: d11f8692b05f02b5a14b6e7579598b426e3144c5)

  SUMMARY: UndefinedBehaviorSanitizer: implicit-integer-sign-change /ci_container_base/src/wallet/fees.cpp:58:58
  MS: 0 ; base unit: 0000000000000000000000000000000000000000
  0x2e,0x1,0xb0,0xb8,0x0,0xff,0xff,0xff,0xff,0x60,0x14,0x22,0xff,0xff,0xff,0xff,0xff,0xfd,0xff,0xff,0xff,0xff,0xff,0x7e,0xf9,0x41,0x8,0x2b,0x17,0x58,0xb,0x17,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0x7e,0xf9,0x41,0x8,0x2b,0x17,0x58,0xb,
  .\001\260\270\000\377\377\377\377`\024\"\377\377\377\377\377\375\377\377\377\377\377~\371A\010+\027X\013\027\374\377\377\377\377\377\377~\371A\010+\027X\013
  artifact_prefix='./'; Test unit written to ./crash-5627f57ffba7568a500f8379f62c3338978b43f2
  Base64: LgGwuAD/////YBQi///////9//////9++UEIKxdYCxf8////////fvlBCCsXWAs=
  ```

ACKs for top commit:
  maflcko:
    lgtm ACK 5a26cf7
  dergoegge:
    utACK 5a26cf7

Tree-SHA512: a1b129d81d42350cf85ff6fb95cd6982b6aac88467a526ee4b3c9b3313af2f7952c5dfa9886f455756faba399d8356b6c318d7ab2d6318e08fea838bee90b2fe
0xB10C added a commit that referenced this pull request Mar 20, 2025
…db.IsTxAvailable(i) || available.count(i) > 0' failed.

$ cmake --build build_fuzz && FUZZ=partially_downloaded_block build_fuzz/src/test/fuzz/fuzz crash-570bed6f80d83fcc453015fa9143d889b7c94a2c
[  1%] Generating bitcoin-build-info.h
[  1%] Built target generate_build_info
[  2%] Built target test_fuzz
[  3%] Built target crc32c
[ 11%] Built target leveldb
[ 13%] Built target minisketch_clmul
[ 15%] Built target minisketch
[ 16%] Built target bitcoin_clientversion
[ 19%] Built target bitcoin_consensus
[ 29%] Built target bitcoin_common
[ 49%] Built target bitcoin_node
[ 49%] Built target bitcoin_cli
[ 53%] Built target bitcoin_crypto
[ 55%] Built target univalue
[ 62%] Built target bitcoin_util
[ 63%] Built target secp256k1_precomputed
[ 63%] Built target secp256k1
[ 69%] Built target bitcoin_wallet
[ 72%] Built target test_util
[ 72%] Building CXX object src/test/fuzz/CMakeFiles/fuzz.dir/partially_downloaded_block.cpp.o
[ 72%] Linking CXX executable fuzz
[100%] Built target fuzz
INFO: Running with entropic power schedule (0xFF, 100).
INFO: Seed: 536371425
INFO: Loaded 1 modules   (535168 inline 8-bit counters): 535168 [0x56040a076200, 0x56040a0f8c80),
INFO: Loaded 1 PC tables (535168 PCs): 535168 [0x56040a0f8c80,0x56040a923480),
build_fuzz/src/test/fuzz/fuzz: Running 1 inputs 1 time(s) each.
Running: crash-570bed6f80d83fcc453015fa9143d889b7c94a2c
txn =  1	 mempool = true	 extrapool = false	 prefilled = true  txid=9d0a4903b008d05a1e51ce51d73c1786b34cd411db5b5aa4d217231ed3b28b4b  wtxid=9d0a4903b008d05a1e51ce51d73c1786b34cd411db5b5aa4d217231ed3b28b4b
txn =  2	 mempool = true	 extrapool = true	 prefilled = false  txid=4d120b79afdc51662927de6d4b75158d5ea465f94fe003a6f8993afd0ece6ba1  wtxid=4d120b79afdc51662927de6d4b75158d5ea465f94fe003a6f8993afd0ece6ba1
txn =  3	 mempool = true	 extrapool = true	 prefilled = true  txid=b2c93a618655da4fa48af8210f3b8f12f1f67c88a6debbdaf2456860277f2e98  wtxid=b2c93a618655da4fa48af8210f3b8f12f1f67c88a6debbdaf2456860277f2e98
txn =  4	 mempool = true	 extrapool = true	 prefilled = false  txid=9b385350227be7e3b062315cfb111ac09c369569dfbf84d63a904b7a4afc1f04  wtxid=9b385350227be7e3b062315cfb111ac09c369569dfbf84d63a904b7a4afc1f04
txn =  5	 mempool = true	 extrapool = true	 prefilled = false  txid=7e072c5132c385cd482a06fb8947c264f226ee90918cd6a8d8869e7fd043b4f0  wtxid=7e072c5132c385cd482a06fb8947c264f226ee90918cd6a8d8869e7fd043b4f0
txn =  6	 mempool = true	 extrapool = true	 prefilled = false  txid=98d77f205090d53266c2909012a413492fa80bef00a922d1e1922dac5e659abd  wtxid=98d77f205090d53266c2909012a413492fa80bef00a922d1e1922dac5e659abd
txn =  7	 mempool = false	 extrapool = false	 prefilled = false  txid=b44314964212a30a0d3133337045860460012f15e1e9de2fc1c3acb17ac1df3a  wtxid=b44314964212a30a0d3133337045860460012f15e1e9de2fc1c3acb17ac1df3a
txn =  8	 mempool = false	 extrapool = false	 prefilled = false  txid=497b0b7bc8b119b823f5fcb26fa46623f34327f7436c77b3ac92b341e5a11f9e  wtxid=497b0b7bc8b119b823f5fcb26fa46623f34327f7436c77b3ac92b341e5a11f9e
txn =  9	 mempool = true	 extrapool = true	 prefilled = true  txid=c7b34928c81d17e2fb0b2aabaee2b3a0567f8b0922b8fd5158258ecaecb76ab7  wtxid=c7b34928c81d17e2fb0b2aabaee2b3a0567f8b0922b8fd5158258ecaecb76ab7
txn =  10	 mempool = true	 extrapool = true	 prefilled = false  txid=309c58ba57739e0197534eb7dbed7f39b4248099c7fe50f7561f6f61d8ab4626  wtxid=309c58ba57739e0197534eb7dbed7f39b4248099c7fe50f7561f6f61d8ab4626
txn =  11	 mempool = true	 extrapool = true	 prefilled = false  txid=f06f0359e985cba192ba7f6165f56f20fa203941b2fd52803a80c700cf5ee26d  wtxid=f06f0359e985cba192ba7f6165f56f20fa203941b2fd52803a80c700cf5ee26d
txn =  12	 mempool = true	 extrapool = true	 prefilled = false  txid=7e86a197c4ae7cd91a86b1893932c02443e55960188d79aae42860870f0236ed  wtxid=7e86a197c4ae7cd91a86b1893932c02443e55960188d79aae42860870f0236ed
txn =  13	 mempool = true	 extrapool = true	 prefilled = false  txid=141a7a08297f07e179cad904fb801ce1a09ee1c3be72a2ba9d865ee254143ca6  wtxid=141a7a08297f07e179cad904fb801ce1a09ee1c3be72a2ba9d865ee254143ca6
txn =  14	 mempool = true	 extrapool = true	 prefilled = false  txid=27b7c9a8625d212667fb49896439fc81c0c9e44648101c90648c486072462d74  wtxid=27b7c9a8625d212667fb49896439fc81c0c9e44648101c90648c486072462d74
txn =  15	 mempool = true	 extrapool = true	 prefilled = false  txid=e5d94eccca813047eec179aa763c57472fa699261a57e714d022e2622b7da0f9  wtxid=e5d94eccca813047eec179aa763c57472fa699261a57e714d022e2622b7da0f9
txn =  16	 mempool = true	 extrapool = true	 prefilled = false  txid=1abe7886b2abe79be66e6a83d89e1fbe6d0c0a889b2d4078203a2263f8d14f77  wtxid=1abe7886b2abe79be66e6a83d89e1fbe6d0c0a889b2d4078203a2263f8d14f77
txn =  17	 mempool = true	 extrapool = true	 prefilled = false  txid=57a1c4c7f1cf09987b38d0aaf287c1f539900d88b80299070c9a0ba31985d765  wtxid=57a1c4c7f1cf09987b38d0aaf287c1f539900d88b80299070c9a0ba31985d765
txn =  18	 mempool = true	 extrapool = true	 prefilled = true  txid=ff8eafa751f074e5ec9a3b89e2be6e0c7690429b105c8944962ecc8571907463  wtxid=ff8eafa751f074e5ec9a3b89e2be6e0c7690429b105c8944962ecc8571907463
txn =  19	 mempool = true	 extrapool = true	 prefilled = false  txid=fee040e6a32c851023b05e2e859d0eae35746514e9fd5520ecee47ccb585eadc  wtxid=fee040e6a32c851023b05e2e859d0eae35746514e9fd5520ecee47ccb585eadc
txn =  20	 mempool = true	 extrapool = true	 prefilled = false  txid=cdcdde9454b3b2fdbe7cb97432010d5df4bbd17cc95d69e74819afc55a34b5ec  wtxid=cdcdde9454b3b2fdbe7cb97432010d5df4bbd17cc95d69e74819afc55a34b5ec
txn =  21	 mempool = true	 extrapool = true	 prefilled = false  txid=91c81fc4b7d04f6eaf9699702ed13b53427fde8b5bbe777b2c443f25d0122412  wtxid=91c81fc4b7d04f6eaf9699702ed13b53427fde8b5bbe777b2c443f25d0122412
txn =  22	 mempool = true	 extrapool = true	 prefilled = false  txid=3e11af71115c4cc82cf3211f06d17d23ff32d24d3ee213bdb4a481932e106789  wtxid=3e11af71115c4cc82cf3211f06d17d23ff32d24d3ee213bdb4a481932e106789
txn =  23	 mempool = true	 extrapool = true	 prefilled = false  txid=cd6237315df890fbd70566c5b114f132cfbce9819bd7318704705d869c42ab8c  wtxid=cd6237315df890fbd70566c5b114f132cfbce9819bd7318704705d869c42ab8c
txn =  24	 mempool = true	 extrapool = true	 prefilled = false  txid=e6882bc74e5053da71a957f26caa502042a3b3d5834a09097f015ac38af4782d  wtxid=e6882bc74e5053da71a957f26caa502042a3b3d5834a09097f015ac38af4782d
txn =  25	 mempool = true	 extrapool = true	 prefilled = false  txid=fe23e9198f2417fa4db3113f4374f8be4ce97711848e299659b479c248268f8d  wtxid=fe23e9198f2417fa4db3113f4374f8be4ce97711848e299659b479c248268f8d
txn =  26	 mempool = true	 extrapool = true	 prefilled = false  txid=6356b9993eb2763fcdd835d1432be145d7188f91f964593640a8124c24aa088c  wtxid=6356b9993eb2763fcdd835d1432be145d7188f91f964593640a8124c24aa088c
txn =  27	 mempool = true	 extrapool = true	 prefilled = true  txid=2da970f31d4290501e2f1c552e59e64aac98b652af1eb7777afc22a8682a4129  wtxid=2da970f31d4290501e2f1c552e59e64aac98b652af1eb7777afc22a8682a4129
txn =  28	 mempool = true	 extrapool = true	 prefilled = false  txid=795c20676936b67031fd4f4ebb7f754155eaff957bac0fec88ee19d458164b7d  wtxid=795c20676936b67031fd4f4ebb7f754155eaff957bac0fec88ee19d458164b7d
txn =  29	 mempool = true	 extrapool = true	 prefilled = false  txid=2e07aa279ad0acaac85da57ff413b93fb31b7d8405e7fd246072ceb338aae960  wtxid=2e07aa279ad0acaac85da57ff413b93fb31b7d8405e7fd246072ceb338aae960
txn =  30	 mempool = true	 extrapool = true	 prefilled = false  txid=b292fec666ddfee46b9cdfd9adfc58cd86a8b820fafa49ad1e8ac41b15d520cc  wtxid=b292fec666ddfee46b9cdfd9adfc58cd86a8b820fafa49ad1e8ac41b15d520cc
txn =  31	 mempool = true	 extrapool = true	 prefilled = false  txid=ed17724bb4f30543e2ff0d39591b7f81c4124db547dd338b5936ad520bfd266e  wtxid=ed17724bb4f30543e2ff0d39591b7f81c4124db547dd338b5936ad520bfd266e
txn =  32	 mempool = true	 extrapool = true	 prefilled = false  txid=75ae8dd3f93e26e76074e02c3aa297bc8211a7636b6183271b3f3c171cdd2e16  wtxid=75ae8dd3f93e26e76074e02c3aa297bc8211a7636b6183271b3f3c171cdd2e16
txn =  33	 mempool = true	 extrapool = true	 prefilled = true  txid=19e187775b313323e4e9139b38126eaab10cbf017f9a3304f5b93136951da159  wtxid=19e187775b313323e4e9139b38126eaab10cbf017f9a3304f5b93136951da159
txn =  34	 mempool = true	 extrapool = true	 prefilled = false  txid=08f65d789aa6509906efa57387de3affcea779ac4a9364cd80962fe6773bd874  wtxid=08f65d789aa6509906efa57387de3affcea779ac4a9364cd80962fe6773bd874
txn =  35	 mempool = true	 extrapool = true	 prefilled = false  txid=0559b647e8dc71bbba0738ab96604023a32b84bfb2b4d362d4e7c43f8f6b6acf  wtxid=0559b647e8dc71bbba0738ab96604023a32b84bfb2b4d362d4e7c43f8f6b6acf
txn =  36	 mempool = true	 extrapool = true	 prefilled = false  txid=bc89ea205612c9fd6d963f3e46e11d4352776f8f1d88a3dd9c5d3a134906bfd1  wtxid=bc89ea205612c9fd6d963f3e46e11d4352776f8f1d88a3dd9c5d3a134906bfd1
txn =  37	 mempool = true	 extrapool = true	 prefilled = false  txid=109d765fd05fe6054eebb340b44e3968294174fabc9c6fc08eb2a31a887aff38  wtxid=109d765fd05fe6054eebb340b44e3968294174fabc9c6fc08eb2a31a887aff38
txn =  38	 mempool = true	 extrapool = true	 prefilled = false  txid=69f25e91d4ae6c284bd694950667983d2a600f693390487a327899fdd9cea5c5  wtxid=69f25e91d4ae6c284bd694950667983d2a600f693390487a327899fdd9cea5c5
txn =  39	 mempool = true	 extrapool = true	 prefilled = false  txid=0277f2c4453eaaef98d5ae404d1e041a0f042d1c754c6f9074aeacb403436aa3  wtxid=0277f2c4453eaaef98d5ae404d1e041a0f042d1c754c6f9074aeacb403436aa3
txn =  40	 mempool = true	 extrapool = true	 prefilled = false  txid=5e8926a64c8e7af49a8f57f7583334e20b062c580808a72569288ee75f013ea6  wtxid=5e8926a64c8e7af49a8f57f7583334e20b062c580808a72569288ee75f013ea6
txn =  41	 mempool = true	 extrapool = true	 prefilled = false  txid=f3f9dcc06296bef79105be7657d24bbfdaf01be5db08490e86e24bfb4b955ad4  wtxid=f3f9dcc06296bef79105be7657d24bbfdaf01be5db08490e86e24bfb4b955ad4
txn =  42	 mempool = true	 extrapool = true	 prefilled = false  txid=76dcc7865273206f322c2cad548508178391ba2a3f8e973dcd39ef6bbe7b90fa  wtxid=76dcc7865273206f322c2cad548508178391ba2a3f8e973dcd39ef6bbe7b90fa
txn =  43	 mempool = true	 extrapool = true	 prefilled = false  txid=8883aaf530a9e60ae0230c466ed21173054499555556984c373b3ee596ec9ec9  wtxid=8883aaf530a9e60ae0230c466ed21173054499555556984c373b3ee596ec9ec9
txn =  44	 mempool = true	 extrapool = true	 prefilled = false  txid=32438df59e8978fa6eb2bd3d3b50993d009323b60c6e1f1762360ada8437292c  wtxid=32438df59e8978fa6eb2bd3d3b50993d009323b60c6e1f1762360ada8437292c
txn =  45	 mempool = true	 extrapool = true	 prefilled = false  txid=550bcf60c9424365b2ad6ec265e404140b5ca9cd7328a9a2295fc864e55ccc12  wtxid=550bcf60c9424365b2ad6ec265e404140b5ca9cd7328a9a2295fc864e55ccc12
txn =  46	 mempool = true	 extrapool = true	 prefilled = false  txid=3adde5d65075f9a92ea80ed9fe1802b4036c2ef9bbd91d06a362bdb2b377cade  wtxid=3adde5d65075f9a92ea80ed9fe1802b4036c2ef9bbd91d06a362bdb2b377cade
txn =  47	 mempool = true	 extrapool = true	 prefilled = false  txid=a4c04faf52b2a63ac00a14d1a408bfba47254641559ef83f59d3faf116712b2e  wtxid=a4c04faf52b2a63ac00a14d1a408bfba47254641559ef83f59d3faf116712b2e
txn =  48	 mempool = true	 extrapool = true	 prefilled = true  txid=b44314964212a30a0d3133337045860460012f15e1e9de2fc1c3acb17ac1df3a  wtxid=b44314964212a30a0d3133337045860460012f15e1e9de2fc1c3acb17ac1df3a
txn =  49	 mempool = true	 extrapool = true	 prefilled = false  txid=cfd73dd50c1d1db871e9248a47f6102ff3f8d7f2e6180aed39c7b2077558cb0e  wtxid=cfd73dd50c1d1db871e9248a47f6102ff3f8d7f2e6180aed39c7b2077558cb0e
txn =  50	 mempool = true	 extrapool = true	 prefilled = false  txid=c7b34928c81d17e2fb0b2aabaee2b3a0567f8b0922b8fd5158258ecaecb76ab7  wtxid=c7b34928c81d17e2fb0b2aabaee2b3a0567f8b0922b8fd5158258ecaecb76ab7
txn =  51	 mempool = true	 extrapool = true	 prefilled = false  txid=6ee1fcc8a5d27ea5689927bb23f2f1112c39b5cc446b3ffffbff343e3465bf09  wtxid=6ee1fcc8a5d27ea5689927bb23f2f1112c39b5cc446b3ffffbff343e3465bf09
txn =  52	 mempool = true	 extrapool = true	 prefilled = false  txid=03d0d65b445466f345d9112d91b1d0a744e9178de3e09b29a4326cf21ed137b0  wtxid=03d0d65b445466f345d9112d91b1d0a744e9178de3e09b29a4326cf21ed137b0
txn =  53	 mempool = true	 extrapool = true	 prefilled = false  txid=be9f73e78ee05ebbf493da945daec12881f720753fa71f73e0be1ba637409cfa  wtxid=be9f73e78ee05ebbf493da945daec12881f720753fa71f73e0be1ba637409cfa
txn =  54	 mempool = true	 extrapool = true	 prefilled = false  txid=bcea0c8b4d0fabff69a5f6dd0d4fa906884cd44409aace86fdd60e4908beb5b0  wtxid=bcea0c8b4d0fabff69a5f6dd0d4fa906884cd44409aace86fdd60e4908beb5b0
txn =  55	 mempool = true	 extrapool = true	 prefilled = true  txid=e45a2b82ec99f1159486ad58cbdd8aafd88666312573d77aa663980deb728505  wtxid=e45a2b82ec99f1159486ad58cbdd8aafd88666312573d77aa663980deb728505
txn =  56	 mempool = true	 extrapool = true	 prefilled = false  txid=3109deae8ff5ff19b2e0e13b9f1c9a03b991eb6d0909a58da27c48d2f9125b2a  wtxid=3109deae8ff5ff19b2e0e13b9f1c9a03b991eb6d0909a58da27c48d2f9125b2a
txn =  57	 mempool = true	 extrapool = true	 prefilled = false  txid=96a1fdeb92e077a05ad2ea7bf4314358dbe21d471715d9f56039cadb6fe97f8c  wtxid=96a1fdeb92e077a05ad2ea7bf4314358dbe21d471715d9f56039cadb6fe97f8c
txn =  58	 mempool = true	 extrapool = true	 prefilled = false  txid=015f1ebb73a34000e5ea47d64c598416591a36a59e73adc13455d3ff6025596f  wtxid=015f1ebb73a34000e5ea47d64c598416591a36a59e73adc13455d3ff6025596f
txn =  59	 mempool = true	 extrapool = true	 prefilled = false  txid=d632d0c9f345c5972868a5ad88bba521ec5c0f49dc4e3bc2ba58dcf5cbc9b8c4  wtxid=d632d0c9f345c5972868a5ad88bba521ec5c0f49dc4e3bc2ba58dcf5cbc9b8c4
txn =  60	 mempool = true	 extrapool = true	 prefilled = false  txid=9f4b836af0d0f7e5926b48760a7f7e0d4dafba96bdee43066e9c777515531804  wtxid=9f4b836af0d0f7e5926b48760a7f7e0d4dafba96bdee43066e9c777515531804
txn =  61	 mempool = true	 extrapool = true	 prefilled = false  txid=a8d8df09a390e609f81a708b2187713775e37766c09bc6f010857da155660d1c  wtxid=a8d8df09a390e609f81a708b2187713775e37766c09bc6f010857da155660d1c
txn =  62	 mempool = true	 extrapool = true	 prefilled = false  txid=f632f633ac4b3cc0e5df85523450f59dd909c25c894efa11fd79dc601a7d55f8  wtxid=f632f633ac4b3cc0e5df85523450f59dd909c25c894efa11fd79dc601a7d55f8
txn =  63	 mempool = true	 extrapool = true	 prefilled = false  txid=c924d087d84a8841748d15e72809e954abdefd71f1c56e4a7a3876e0db433917  wtxid=c924d087d84a8841748d15e72809e954abdefd71f1c56e4a7a3876e0db433917
txn =  64	 mempool = true	 extrapool = true	 prefilled = false  txid=18aceafd389705a4c689c6bd34bc15ca09771ed3450b76ffec1606142780d9fb  wtxid=18aceafd389705a4c689c6bd34bc15ca09771ed3450b76ffec1606142780d9fb
txn =  65	 mempool = true	 extrapool = true	 prefilled = false  txid=546c9dfc842689ee4e3ce89b095ebe88c3f7b1ef5fc366cb7c7af65ece50bd35  wtxid=546c9dfc842689ee4e3ce89b095ebe88c3f7b1ef5fc366cb7c7af65ece50bd35
txn =  66	 mempool = true	 extrapool = true	 prefilled = false  txid=5ed176f9a500db8ea3e9870e761920c696d701b71e3141aaa56e748214c2ec81  wtxid=5ed176f9a500db8ea3e9870e761920c696d701b71e3141aaa56e748214c2ec81
txn =  67	 mempool = true	 extrapool = true	 prefilled = true  txid=4bbfb7702292fa163835b90237447a9661660637dcfdeb37ab25a9ee115159ec  wtxid=4bbfb7702292fa163835b90237447a9661660637dcfdeb37ab25a9ee115159ec
txn =  68	 mempool = true	 extrapool = true	 prefilled = false  txid=4fafa6f2aeb5f11762a7c852c3251b0e424b7592210399282192cd527d6601a7  wtxid=4fafa6f2aeb5f11762a7c852c3251b0e424b7592210399282192cd527d6601a7
txn =  69	 mempool = true	 extrapool = true	 prefilled = false  txid=47ba175d36b778b6f2dcf2ccdbc416bd96976c630d2e75c3647777fd44b97d28  wtxid=47ba175d36b778b6f2dcf2ccdbc416bd96976c630d2e75c3647777fd44b97d28
txn =  70	 mempool = true	 extrapool = true	 prefilled = false  txid=db34b77c8099b4a236dbc627535678bc398e3b870b301d2dbefced3c37177bb0  wtxid=db34b77c8099b4a236dbc627535678bc398e3b870b301d2dbefced3c37177bb0
txn =  71	 mempool = true	 extrapool = true	 prefilled = false  txid=9703e82cdee9a3e7b3d4f093d19206e88b9eaf17157a87d37bd7c455b116caa3  wtxid=9703e82cdee9a3e7b3d4f093d19206e88b9eaf17157a87d37bd7c455b116caa3
txn =  72	 mempool = true	 extrapool = true	 prefilled = false  txid=b2803f6f7fbe1ee375669580c9a5d11ca7673669ab8c33bf8e39062d6d5f1562  wtxid=b2803f6f7fbe1ee375669580c9a5d11ca7673669ab8c33bf8e39062d6d5f1562
txn =  73	 mempool = true	 extrapool = true	 prefilled = false  txid=b8d0e824c1dc2178de766d65e653898aa54166882686e7706a4a0d653558cd85  wtxid=b8d0e824c1dc2178de766d65e653898aa54166882686e7706a4a0d653558cd85
txn =  74	 mempool = true	 extrapool = true	 prefilled = false  txid=2e16a21f38630c3a974e4bf569e5e978496a6a54e3dcb651a703151a5c9ad4b8  wtxid=2e16a21f38630c3a974e4bf569e5e978496a6a54e3dcb651a703151a5c9ad4b8
txn =  75	 mempool = true	 extrapool = true	 prefilled = true  txid=075d99aed19fa2841995af3d45dd307e7bb50b92748fa6007b5bd75c8dca39a1  wtxid=075d99aed19fa2841995af3d45dd307e7bb50b92748fa6007b5bd75c8dca39a1
txn =  76	 mempool = true	 extrapool = true	 prefilled = false  txid=080411a74a8ae87f41f8bffb003282884221a1230c5cbb1cc4568ed9ac627615  wtxid=080411a74a8ae87f41f8bffb003282884221a1230c5cbb1cc4568ed9ac627615
txn =  77	 mempool = true	 extrapool = true	 prefilled = false  txid=4d37924796f14efb3b11e0e9e05859b7eb8986f21da131ae0fb0ee30a0873f67  wtxid=4d37924796f14efb3b11e0e9e05859b7eb8986f21da131ae0fb0ee30a0873f67
txn =  78	 mempool = true	 extrapool = true	 prefilled = false  txid=230658862f5a5e7ad512a9988c435601ca6e7e1f1c9d0bab294aa04b97a3a4e3  wtxid=230658862f5a5e7ad512a9988c435601ca6e7e1f1c9d0bab294aa04b97a3a4e3
txn =  79	 mempool = true	 extrapool = true	 prefilled = false  txid=caf4ce3757747f46fe1d2d52a9ee412e2a8d84ee165dceb8f8f1511f3388a4bd  wtxid=caf4ce3757747f46fe1d2d52a9ee412e2a8d84ee165dceb8f8f1511f3388a4bd
txn =  80	 mempool = true	 extrapool = true	 prefilled = false  txid=6cccc58e6e6d20e705a1060212ce5d6a513ceac968c57d6d7a6b7668898ab483  wtxid=6cccc58e6e6d20e705a1060212ce5d6a513ceac968c57d6d7a6b7668898ab483
txn =  81	 mempool = true	 extrapool = true	 prefilled = false  txid=70d69be17c09a5b638a83b0ad23ba6e1414198e14dfad5675cf48ded350ee111  wtxid=70d69be17c09a5b638a83b0ad23ba6e1414198e14dfad5675cf48ded350ee111
txn =  82	 mempool = true	 extrapool = true	 prefilled = false  txid=7a84acd90bd4910b0992ae5907d23f046e8235d512b397d00f9b51774c4f8e18  wtxid=7a84acd90bd4910b0992ae5907d23f046e8235d512b397d00f9b51774c4f8e18
txn =  83	 mempool = true	 extrapool = true	 prefilled = false  txid=f471f93ad11d5830204f03dd8db6627d99888c17d4d0a59732eca4eb584730f0  wtxid=f471f93ad11d5830204f03dd8db6627d99888c17d4d0a59732eca4eb584730f0
txn =  84	 mempool = true	 extrapool = true	 prefilled = false  txid=d28c2b05660362d6620d41b8aca0653830407b6edd5eb3cfd661055e9e4446a0  wtxid=d28c2b05660362d6620d41b8aca0653830407b6edd5eb3cfd661055e9e4446a0
txn =  85	 mempool = true	 extrapool = true	 prefilled = false  txid=9fbf80148530bf70e3006bce2fb808f84ed50b72c7e9e0c10d50c0bbed974efa  wtxid=9fbf80148530bf70e3006bce2fb808f84ed50b72c7e9e0c10d50c0bbed974efa
txn =  86	 mempool = true	 extrapool = true	 prefilled = false  txid=a40c855689aff5e53d4098ce3524ce1cfffb195d87d1bd42c44d3a23af1ec73f  wtxid=a40c855689aff5e53d4098ce3524ce1cfffb195d87d1bd42c44d3a23af1ec73f
txn =  87	 mempool = true	 extrapool = true	 prefilled = false  txid=8b1577c680278fe90332a3d74f092e6ed2fc678830df3883f2b5caf147fe895f  wtxid=8b1577c680278fe90332a3d74f092e6ed2fc678830df3883f2b5caf147fe895f
txn =  88	 mempool = true	 extrapool = true	 prefilled = false  txid=bea4648036a1e0efe9650fc157ee00d3efbf7016e973f2a91f48a7ba0388bded  wtxid=bea4648036a1e0efe9650fc157ee00d3efbf7016e973f2a91f48a7ba0388bded
tx 0 is available as it was prefilled
tx 1 is available as it was prefilled
tx 3 is available as it was prefilled
tx 9 is available as it was prefilled
tx 18 is available as it was prefilled
tx 27 is available as it was prefilled
tx 33 is available as it was prefilled
tx 48 is available as it was prefilled
tx 55 is available as it was prefilled
tx 67 is available as it was prefilled
tx 75 is available as it was prefilled
tx 2 is available as it was in our mempool (txid=4d120b79afdc51662927de6d4b75158d5ea465f94fe003a6f8993afd0ece6ba1 wtxid = 4d120b79afdc51662927de6d4b75158d5ea465f94fe003a6f8993afd0ece6ba1
tx 4 is available as it was in our mempool (txid=9b385350227be7e3b062315cfb111ac09c369569dfbf84d63a904b7a4afc1f04 wtxid = 9b385350227be7e3b062315cfb111ac09c369569dfbf84d63a904b7a4afc1f04
tx 5 is available as it was in our mempool (txid=7e072c5132c385cd482a06fb8947c264f226ee90918cd6a8d8869e7fd043b4f0 wtxid = 7e072c5132c385cd482a06fb8947c264f226ee90918cd6a8d8869e7fd043b4f0
tx 6 is available as it was in our mempool (txid=98d77f205090d53266c2909012a413492fa80bef00a922d1e1922dac5e659abd wtxid = 98d77f205090d53266c2909012a413492fa80bef00a922d1e1922dac5e659abd
tx 50 is available as it was in our mempool (txid=c7b34928c81d17e2fb0b2aabaee2b3a0567f8b0922b8fd5158258ecaecb76ab7 wtxid = c7b34928c81d17e2fb0b2aabaee2b3a0567f8b0922b8fd5158258ecaecb76ab7
tx 10 is available as it was in our mempool (txid=309c58ba57739e0197534eb7dbed7f39b4248099c7fe50f7561f6f61d8ab4626 wtxid = 309c58ba57739e0197534eb7dbed7f39b4248099c7fe50f7561f6f61d8ab4626
tx 11 is available as it was in our mempool (txid=f06f0359e985cba192ba7f6165f56f20fa203941b2fd52803a80c700cf5ee26d wtxid = f06f0359e985cba192ba7f6165f56f20fa203941b2fd52803a80c700cf5ee26d
tx 12 is available as it was in our mempool (txid=7e86a197c4ae7cd91a86b1893932c02443e55960188d79aae42860870f0236ed wtxid = 7e86a197c4ae7cd91a86b1893932c02443e55960188d79aae42860870f0236ed
tx 13 is available as it was in our mempool (txid=141a7a08297f07e179cad904fb801ce1a09ee1c3be72a2ba9d865ee254143ca6 wtxid = 141a7a08297f07e179cad904fb801ce1a09ee1c3be72a2ba9d865ee254143ca6
tx 14 is available as it was in our mempool (txid=27b7c9a8625d212667fb49896439fc81c0c9e44648101c90648c486072462d74 wtxid = 27b7c9a8625d212667fb49896439fc81c0c9e44648101c90648c486072462d74
tx 15 is available as it was in our mempool (txid=e5d94eccca813047eec179aa763c57472fa699261a57e714d022e2622b7da0f9 wtxid = e5d94eccca813047eec179aa763c57472fa699261a57e714d022e2622b7da0f9
tx 16 is available as it was in our mempool (txid=1abe7886b2abe79be66e6a83d89e1fbe6d0c0a889b2d4078203a2263f8d14f77 wtxid = 1abe7886b2abe79be66e6a83d89e1fbe6d0c0a889b2d4078203a2263f8d14f77
tx 17 is available as it was in our mempool (txid=57a1c4c7f1cf09987b38d0aaf287c1f539900d88b80299070c9a0ba31985d765 wtxid = 57a1c4c7f1cf09987b38d0aaf287c1f539900d88b80299070c9a0ba31985d765
tx 19 is available as it was in our mempool (txid=fee040e6a32c851023b05e2e859d0eae35746514e9fd5520ecee47ccb585eadc wtxid = fee040e6a32c851023b05e2e859d0eae35746514e9fd5520ecee47ccb585eadc
tx 20 is available as it was in our mempool (txid=cdcdde9454b3b2fdbe7cb97432010d5df4bbd17cc95d69e74819afc55a34b5ec wtxid = cdcdde9454b3b2fdbe7cb97432010d5df4bbd17cc95d69e74819afc55a34b5ec
tx 21 is available as it was in our mempool (txid=91c81fc4b7d04f6eaf9699702ed13b53427fde8b5bbe777b2c443f25d0122412 wtxid = 91c81fc4b7d04f6eaf9699702ed13b53427fde8b5bbe777b2c443f25d0122412
tx 22 is available as it was in our mempool (txid=3e11af71115c4cc82cf3211f06d17d23ff32d24d3ee213bdb4a481932e106789 wtxid = 3e11af71115c4cc82cf3211f06d17d23ff32d24d3ee213bdb4a481932e106789
tx 23 is available as it was in our mempool (txid=cd6237315df890fbd70566c5b114f132cfbce9819bd7318704705d869c42ab8c wtxid = cd6237315df890fbd70566c5b114f132cfbce9819bd7318704705d869c42ab8c
tx 24 is available as it was in our mempool (txid=e6882bc74e5053da71a957f26caa502042a3b3d5834a09097f015ac38af4782d wtxid = e6882bc74e5053da71a957f26caa502042a3b3d5834a09097f015ac38af4782d
tx 25 is available as it was in our mempool (txid=fe23e9198f2417fa4db3113f4374f8be4ce97711848e299659b479c248268f8d wtxid = fe23e9198f2417fa4db3113f4374f8be4ce97711848e299659b479c248268f8d
tx 26 is available as it was in our mempool (txid=6356b9993eb2763fcdd835d1432be145d7188f91f964593640a8124c24aa088c wtxid = 6356b9993eb2763fcdd835d1432be145d7188f91f964593640a8124c24aa088c
tx 28 is available as it was in our mempool (txid=795c20676936b67031fd4f4ebb7f754155eaff957bac0fec88ee19d458164b7d wtxid = 795c20676936b67031fd4f4ebb7f754155eaff957bac0fec88ee19d458164b7d
tx 29 is available as it was in our mempool (txid=2e07aa279ad0acaac85da57ff413b93fb31b7d8405e7fd246072ceb338aae960 wtxid = 2e07aa279ad0acaac85da57ff413b93fb31b7d8405e7fd246072ceb338aae960
tx 30 is available as it was in our mempool (txid=b292fec666ddfee46b9cdfd9adfc58cd86a8b820fafa49ad1e8ac41b15d520cc wtxid = b292fec666ddfee46b9cdfd9adfc58cd86a8b820fafa49ad1e8ac41b15d520cc
tx 31 is available as it was in our mempool (txid=ed17724bb4f30543e2ff0d39591b7f81c4124db547dd338b5936ad520bfd266e wtxid = ed17724bb4f30543e2ff0d39591b7f81c4124db547dd338b5936ad520bfd266e
tx 32 is available as it was in our mempool (txid=75ae8dd3f93e26e76074e02c3aa297bc8211a7636b6183271b3f3c171cdd2e16 wtxid = 75ae8dd3f93e26e76074e02c3aa297bc8211a7636b6183271b3f3c171cdd2e16
tx 34 is available as it was in our mempool (txid=08f65d789aa6509906efa57387de3affcea779ac4a9364cd80962fe6773bd874 wtxid = 08f65d789aa6509906efa57387de3affcea779ac4a9364cd80962fe6773bd874
tx 35 is available as it was in our mempool (txid=0559b647e8dc71bbba0738ab96604023a32b84bfb2b4d362d4e7c43f8f6b6acf wtxid = 0559b647e8dc71bbba0738ab96604023a32b84bfb2b4d362d4e7c43f8f6b6acf
tx 36 is available as it was in our mempool (txid=bc89ea205612c9fd6d963f3e46e11d4352776f8f1d88a3dd9c5d3a134906bfd1 wtxid = bc89ea205612c9fd6d963f3e46e11d4352776f8f1d88a3dd9c5d3a134906bfd1
tx 37 is available as it was in our mempool (txid=109d765fd05fe6054eebb340b44e3968294174fabc9c6fc08eb2a31a887aff38 wtxid = 109d765fd05fe6054eebb340b44e3968294174fabc9c6fc08eb2a31a887aff38
tx 38 is available as it was in our mempool (txid=69f25e91d4ae6c284bd694950667983d2a600f693390487a327899fdd9cea5c5 wtxid = 69f25e91d4ae6c284bd694950667983d2a600f693390487a327899fdd9cea5c5
tx 39 is available as it was in our mempool (txid=0277f2c4453eaaef98d5ae404d1e041a0f042d1c754c6f9074aeacb403436aa3 wtxid = 0277f2c4453eaaef98d5ae404d1e041a0f042d1c754c6f9074aeacb403436aa3
tx 40 is available as it was in our mempool (txid=5e8926a64c8e7af49a8f57f7583334e20b062c580808a72569288ee75f013ea6 wtxid = 5e8926a64c8e7af49a8f57f7583334e20b062c580808a72569288ee75f013ea6
tx 41 is available as it was in our mempool (txid=f3f9dcc06296bef79105be7657d24bbfdaf01be5db08490e86e24bfb4b955ad4 wtxid = f3f9dcc06296bef79105be7657d24bbfdaf01be5db08490e86e24bfb4b955ad4
tx 42 is available as it was in our mempool (txid=76dcc7865273206f322c2cad548508178391ba2a3f8e973dcd39ef6bbe7b90fa wtxid = 76dcc7865273206f322c2cad548508178391ba2a3f8e973dcd39ef6bbe7b90fa
tx 43 is available as it was in our mempool (txid=8883aaf530a9e60ae0230c466ed21173054499555556984c373b3ee596ec9ec9 wtxid = 8883aaf530a9e60ae0230c466ed21173054499555556984c373b3ee596ec9ec9
tx 44 is available as it was in our mempool (txid=32438df59e8978fa6eb2bd3d3b50993d009323b60c6e1f1762360ada8437292c wtxid = 32438df59e8978fa6eb2bd3d3b50993d009323b60c6e1f1762360ada8437292c
tx 45 is available as it was in our mempool (txid=550bcf60c9424365b2ad6ec265e404140b5ca9cd7328a9a2295fc864e55ccc12 wtxid = 550bcf60c9424365b2ad6ec265e404140b5ca9cd7328a9a2295fc864e55ccc12
tx 46 is available as it was in our mempool (txid=3adde5d65075f9a92ea80ed9fe1802b4036c2ef9bbd91d06a362bdb2b377cade wtxid = 3adde5d65075f9a92ea80ed9fe1802b4036c2ef9bbd91d06a362bdb2b377cade
tx 47 is available as it was in our mempool (txid=a4c04faf52b2a63ac00a14d1a408bfba47254641559ef83f59d3faf116712b2e wtxid = a4c04faf52b2a63ac00a14d1a408bfba47254641559ef83f59d3faf116712b2e
tx 7 is available as it was in our mempool (txid=b44314964212a30a0d3133337045860460012f15e1e9de2fc1c3acb17ac1df3a wtxid = b44314964212a30a0d3133337045860460012f15e1e9de2fc1c3acb17ac1df3a
tx 49 is available as it was in our mempool (txid=cfd73dd50c1d1db871e9248a47f6102ff3f8d7f2e6180aed39c7b2077558cb0e wtxid = cfd73dd50c1d1db871e9248a47f6102ff3f8d7f2e6180aed39c7b2077558cb0e
tx 51 is available as it was in our mempool (txid=6ee1fcc8a5d27ea5689927bb23f2f1112c39b5cc446b3ffffbff343e3465bf09 wtxid = 6ee1fcc8a5d27ea5689927bb23f2f1112c39b5cc446b3ffffbff343e3465bf09
tx 52 is available as it was in our mempool (txid=03d0d65b445466f345d9112d91b1d0a744e9178de3e09b29a4326cf21ed137b0 wtxid = 03d0d65b445466f345d9112d91b1d0a744e9178de3e09b29a4326cf21ed137b0
tx 53 is available as it was in our mempool (txid=be9f73e78ee05ebbf493da945daec12881f720753fa71f73e0be1ba637409cfa wtxid = be9f73e78ee05ebbf493da945daec12881f720753fa71f73e0be1ba637409cfa
tx 54 is available as it was in our mempool (txid=bcea0c8b4d0fabff69a5f6dd0d4fa906884cd44409aace86fdd60e4908beb5b0 wtxid = bcea0c8b4d0fabff69a5f6dd0d4fa906884cd44409aace86fdd60e4908beb5b0
tx 56 is available as it was in our mempool (txid=3109deae8ff5ff19b2e0e13b9f1c9a03b991eb6d0909a58da27c48d2f9125b2a wtxid = 3109deae8ff5ff19b2e0e13b9f1c9a03b991eb6d0909a58da27c48d2f9125b2a
tx 57 is available as it was in our mempool (txid=96a1fdeb92e077a05ad2ea7bf4314358dbe21d471715d9f56039cadb6fe97f8c wtxid = 96a1fdeb92e077a05ad2ea7bf4314358dbe21d471715d9f56039cadb6fe97f8c
tx 58 is available as it was in our mempool (txid=015f1ebb73a34000e5ea47d64c598416591a36a59e73adc13455d3ff6025596f wtxid = 015f1ebb73a34000e5ea47d64c598416591a36a59e73adc13455d3ff6025596f
tx 59 is available as it was in our mempool (txid=d632d0c9f345c5972868a5ad88bba521ec5c0f49dc4e3bc2ba58dcf5cbc9b8c4 wtxid = d632d0c9f345c5972868a5ad88bba521ec5c0f49dc4e3bc2ba58dcf5cbc9b8c4
tx 60 is available as it was in our mempool (txid=9f4b836af0d0f7e5926b48760a7f7e0d4dafba96bdee43066e9c777515531804 wtxid = 9f4b836af0d0f7e5926b48760a7f7e0d4dafba96bdee43066e9c777515531804
tx 61 is available as it was in our mempool (txid=a8d8df09a390e609f81a708b2187713775e37766c09bc6f010857da155660d1c wtxid = a8d8df09a390e609f81a708b2187713775e37766c09bc6f010857da155660d1c
tx 62 is available as it was in our mempool (txid=f632f633ac4b3cc0e5df85523450f59dd909c25c894efa11fd79dc601a7d55f8 wtxid = f632f633ac4b3cc0e5df85523450f59dd909c25c894efa11fd79dc601a7d55f8
tx 63 is available as it was in our mempool (txid=c924d087d84a8841748d15e72809e954abdefd71f1c56e4a7a3876e0db433917 wtxid = c924d087d84a8841748d15e72809e954abdefd71f1c56e4a7a3876e0db433917
tx 64 is available as it was in our mempool (txid=18aceafd389705a4c689c6bd34bc15ca09771ed3450b76ffec1606142780d9fb wtxid = 18aceafd389705a4c689c6bd34bc15ca09771ed3450b76ffec1606142780d9fb
tx 65 is available as it was in our mempool (txid=546c9dfc842689ee4e3ce89b095ebe88c3f7b1ef5fc366cb7c7af65ece50bd35 wtxid = 546c9dfc842689ee4e3ce89b095ebe88c3f7b1ef5fc366cb7c7af65ece50bd35
tx 66 is available as it was in our mempool (txid=5ed176f9a500db8ea3e9870e761920c696d701b71e3141aaa56e748214c2ec81 wtxid = 5ed176f9a500db8ea3e9870e761920c696d701b71e3141aaa56e748214c2ec81
tx 68 is available as it was in our mempool (txid=4fafa6f2aeb5f11762a7c852c3251b0e424b7592210399282192cd527d6601a7 wtxid = 4fafa6f2aeb5f11762a7c852c3251b0e424b7592210399282192cd527d6601a7
tx 69 is available as it was in our mempool (txid=47ba175d36b778b6f2dcf2ccdbc416bd96976c630d2e75c3647777fd44b97d28 wtxid = 47ba175d36b778b6f2dcf2ccdbc416bd96976c630d2e75c3647777fd44b97d28
tx 70 is available as it was in our mempool (txid=db34b77c8099b4a236dbc627535678bc398e3b870b301d2dbefced3c37177bb0 wtxid = db34b77c8099b4a236dbc627535678bc398e3b870b301d2dbefced3c37177bb0
tx 71 is available as it was in our mempool (txid=9703e82cdee9a3e7b3d4f093d19206e88b9eaf17157a87d37bd7c455b116caa3 wtxid = 9703e82cdee9a3e7b3d4f093d19206e88b9eaf17157a87d37bd7c455b116caa3
tx 72 is available as it was in our mempool (txid=b2803f6f7fbe1ee375669580c9a5d11ca7673669ab8c33bf8e39062d6d5f1562 wtxid = b2803f6f7fbe1ee375669580c9a5d11ca7673669ab8c33bf8e39062d6d5f1562
tx 73 is available as it was in our mempool (txid=b8d0e824c1dc2178de766d65e653898aa54166882686e7706a4a0d653558cd85 wtxid = b8d0e824c1dc2178de766d65e653898aa54166882686e7706a4a0d653558cd85
tx 74 is available as it was in our mempool (txid=2e16a21f38630c3a974e4bf569e5e978496a6a54e3dcb651a703151a5c9ad4b8 wtxid = 2e16a21f38630c3a974e4bf569e5e978496a6a54e3dcb651a703151a5c9ad4b8
tx 76 is available as it was in our mempool (txid=080411a74a8ae87f41f8bffb003282884221a1230c5cbb1cc4568ed9ac627615 wtxid = 080411a74a8ae87f41f8bffb003282884221a1230c5cbb1cc4568ed9ac627615
tx 77 is available as it was in our mempool (txid=4d37924796f14efb3b11e0e9e05859b7eb8986f21da131ae0fb0ee30a0873f67 wtxid = 4d37924796f14efb3b11e0e9e05859b7eb8986f21da131ae0fb0ee30a0873f67
tx 78 is available as it was in our mempool (txid=230658862f5a5e7ad512a9988c435601ca6e7e1f1c9d0bab294aa04b97a3a4e3 wtxid = 230658862f5a5e7ad512a9988c435601ca6e7e1f1c9d0bab294aa04b97a3a4e3
tx 79 is available as it was in our mempool (txid=caf4ce3757747f46fe1d2d52a9ee412e2a8d84ee165dceb8f8f1511f3388a4bd wtxid = caf4ce3757747f46fe1d2d52a9ee412e2a8d84ee165dceb8f8f1511f3388a4bd
tx 80 is available as it was in our mempool (txid=6cccc58e6e6d20e705a1060212ce5d6a513ceac968c57d6d7a6b7668898ab483 wtxid = 6cccc58e6e6d20e705a1060212ce5d6a513ceac968c57d6d7a6b7668898ab483
tx 81 is available as it was in our mempool (txid=70d69be17c09a5b638a83b0ad23ba6e1414198e14dfad5675cf48ded350ee111 wtxid = 70d69be17c09a5b638a83b0ad23ba6e1414198e14dfad5675cf48ded350ee111
tx 82 is available as it was in our mempool (txid=7a84acd90bd4910b0992ae5907d23f046e8235d512b397d00f9b51774c4f8e18 wtxid = 7a84acd90bd4910b0992ae5907d23f046e8235d512b397d00f9b51774c4f8e18
tx 83 is available as it was in our mempool (txid=f471f93ad11d5830204f03dd8db6627d99888c17d4d0a59732eca4eb584730f0 wtxid = f471f93ad11d5830204f03dd8db6627d99888c17d4d0a59732eca4eb584730f0
tx 84 is available as it was in our mempool (txid=d28c2b05660362d6620d41b8aca0653830407b6edd5eb3cfd661055e9e4446a0 wtxid = d28c2b05660362d6620d41b8aca0653830407b6edd5eb3cfd661055e9e4446a0
tx 85 is available as it was in our mempool (txid=9fbf80148530bf70e3006bce2fb808f84ed50b72c7e9e0c10d50c0bbed974efa wtxid = 9fbf80148530bf70e3006bce2fb808f84ed50b72c7e9e0c10d50c0bbed974efa
tx 86 is available as it was in our mempool (txid=a40c855689aff5e53d4098ce3524ce1cfffb195d87d1bd42c44d3a23af1ec73f wtxid = a40c855689aff5e53d4098ce3524ce1cfffb195d87d1bd42c44d3a23af1ec73f
tx 87 is available as it was in our mempool (txid=8b1577c680278fe90332a3d74f092e6ed2fc678830df3883f2b5caf147fe895f wtxid = 8b1577c680278fe90332a3d74f092e6ed2fc678830df3883f2b5caf147fe895f
tx 88 is available as it was in our mempool (txid=bea4648036a1e0efe9650fc157ee00d3efbf7016e973f2a91f48a7ba0388bded wtxid = bea4648036a1e0efe9650fc157ee00d3efbf7016e973f2a91f48a7ba0388bded
0 tx? available    available.count(i)=1    assert(true)
1 tx? available    available.count(i)=1    assert(true)
2 tx? available    available.count(i)=1    assert(true)
3 tx? available    available.count(i)=1    assert(true)
4 tx? available    available.count(i)=1    assert(true)
5 tx? available    available.count(i)=1    assert(true)
6 tx? available    available.count(i)=1    assert(true)
7 tx? available    available.count(i)=0    assert(false)
fuzz: test/fuzz/partially_downloaded_block.cpp:125: void partially_downloaded_block_fuzz_target(FuzzBufferType): Assertion `!pdb.IsTxAvailable(i) || available.count(i) > 0' failed.
==246693== ERROR: libFuzzer: deadly signal
    #0 0x5604070ad39a  (/home/b10c/git/core/master/build_fuzz/src/test/fuzz/fuzz+0x18d639a)
    #1 0x560406fb1980  (/home/b10c/git/core/master/build_fuzz/src/test/fuzz/fuzz+0x17da980)
    #2 0x560406f8e9f6  (/home/b10c/git/core/master/build_fuzz/src/test/fuzz/fuzz+0x17b79f6)
    #3 0x560406f8eaba  (/home/b10c/git/core/master/build_fuzz/src/test/fuzz/fuzz+0x17b7aba)
    #4 0x7fb541df761f  (/nix/store/nqb2ns2d1lahnd5ncwmn6k84qfd7vx2k-glibc-2.40-36/lib/libc.so.6+0x4061f) (BuildId: 704cab5816f130c494208e8cc24d87a386ef085b)
    #5 0x7fb541e49a9b  (/nix/store/nqb2ns2d1lahnd5ncwmn6k84qfd7vx2k-glibc-2.40-36/lib/libc.so.6+0x92a9b) (BuildId: 704cab5816f130c494208e8cc24d87a386ef085b)
    #6 0x7fb541df7575  (/nix/store/nqb2ns2d1lahnd5ncwmn6k84qfd7vx2k-glibc-2.40-36/lib/libc.so.6+0x40575) (BuildId: 704cab5816f130c494208e8cc24d87a386ef085b)
    #7 0x7fb541ddf934  (/nix/store/nqb2ns2d1lahnd5ncwmn6k84qfd7vx2k-glibc-2.40-36/lib/libc.so.6+0x28934) (BuildId: 704cab5816f130c494208e8cc24d87a386ef085b)
    #8 0x7fb541ddf858  (/nix/store/nqb2ns2d1lahnd5ncwmn6k84qfd7vx2k-glibc-2.40-36/lib/libc.so.6+0x28858) (BuildId: 704cab5816f130c494208e8cc24d87a386ef085b)
    #9 0x7fb541defa55  (/nix/store/nqb2ns2d1lahnd5ncwmn6k84qfd7vx2k-glibc-2.40-36/lib/libc.so.6+0x38a55) (BuildId: 704cab5816f130c494208e8cc24d87a386ef085b)
    #10 0x5604075d4871  (/home/b10c/git/core/master/build_fuzz/src/test/fuzz/fuzz+0x1dfd871)
    #11 0x5604078b26de  (/home/b10c/git/core/master/build_fuzz/src/test/fuzz/fuzz+0x20db6de)
    #12 0x560406f8f2b8  (/home/b10c/git/core/master/build_fuzz/src/test/fuzz/fuzz+0x17b82b8)
    #13 0x560406f6ef08  (/home/b10c/git/core/master/build_fuzz/src/test/fuzz/fuzz+0x1797f08)
    #14 0x560406f73cf9  (/home/b10c/git/core/master/build_fuzz/src/test/fuzz/fuzz+0x179ccf9)
    #15 0x560406ebeec2  (/home/b10c/git/core/master/build_fuzz/src/test/fuzz/fuzz+0x16e7ec2)
    bitcoin#16 0x7fb541de127d  (/nix/store/nqb2ns2d1lahnd5ncwmn6k84qfd7vx2k-glibc-2.40-36/lib/libc.so.6+0x2a27d) (BuildId: 704cab5816f130c494208e8cc24d87a386ef085b)
    bitcoin#17 0x7fb541de1338  (/nix/store/nqb2ns2d1lahnd5ncwmn6k84qfd7vx2k-glibc-2.40-36/lib/libc.so.6+0x2a338) (BuildId: 704cab5816f130c494208e8cc24d87a386ef085b)
    bitcoin#18 0x560406f5e8f4  (/home/b10c/git/core/master/build_fuzz/src/test/fuzz/fuzz+0x17878f4)

NOTE: libFuzzer has rudimentary signal handlers.
      Combine libFuzzer with AddressSanitizer or similar for better crash reports.
SUMMARY: libFuzzer: deadly signal
0xB10C pushed a commit that referenced this pull request May 2, 2025
cad39f8 bench: ensure wallet migration benchmark runs exactly once (Lőrinc)
c1f458a ci: re-enable all benchmark runs (Lőrinc)
1da11db bench: clean up migrated descriptor wallets via loader teardown (Lőrinc)

Pull request description:

  The low-priority `WalletMigration` benchmark existed for some time but was never run automatically in our CI.

  Although the failure first surfaced on Windows as a hang during temporary directory cleanup, it could also be reproduced on Linux and macOS when forcing multiple iterations (e.g. via a long `--min-time`).

  ### Root causes

  1. **Leaked open wallets on Windows**
     `MigrateLegacyToDescriptor` produces two new descriptor wallets (the primary spendable wallet and a companion watch‑only wallet). Without unloading them, their database files remained open in the `WalletContext`, blocking directory removal and hanging the test harness.

  <details><summary>Details</summary>

  ```bash
  what():  filesystem error: cannot remove all: The process cannot access the file because it is being used by another process [C:\Users\RUNNER\~1\AppData\Local\Temp\test_common bitcoin\WalletMigration\d8ffd89a7700ce01c31f] [C:\Users\RUNNER~1\AppData\Local\Temp\test_common bitcoin\WalletMigration\d8ffd89a7700ce01c31f\regtest\wallet.dat]
  ```

  </details>

  2. **Undefined behavior on repeated runs**
     The benchmark body calls `std::move(wallet)`, invalidating the local `wallet` pointer. Running more than one iteration causes a use-after-move by the sanitizers.

  <details><summary>Details</summary>

  ```bash
  error: bench_bitcoin 0x00067927: DW_TAG_member '_M_local_buf' refers to type 0x00000000000b3ba7 which extends beyond the bounds of 0x0006791d
  * thread #1, name = 'b-test', stop reason = signal SIGSEGV: address not mapped to object (fault address: 0xc8)
    * frame #0: 0x00005555556a3f33 bench_bitcoin`... basic_string<char>::length(this=<unavailable>) const at basic_string.h:1079:16
  ```

  </details>

  ### Fixes

  - **Automatic wallet teardown**
    Wrap the benchmark in a `MakeWalletLoader` (owning a `WalletContext`), so that both migrated wallets are unloaded when the loader goes out of scope, eliminating any lingering open files.

  - **Re-enable benchmarks in CI**
    Drop the temporary filter in GitHub Actions. The `-sanity-check` run already executes each benchmark once, so `WalletMigration` now runs automatically without hangs or crashes.

  - **Single iteration**
    Configure the microbenchmark with `.epochs(1).epochIterations(1)`, ensuring the migration code runs exactly once and avoiding use-after-move.

  No measurable change in benchmark performance.

ACKs for top commit:
  maflcko:
    review ACK cad39f8 🍥
  furszy:
    utACK cad39f8
  hebasto:
    ACK cad39f8, tested on Ubuntu 25.04.

Tree-SHA512: 10343ce7ab9b63ba4f51a7673018215577ea7ec188e41d535a66d69d73b85bca6ba301c33f6920c02f8f7d686c75c65c4a4e9bdafb04b60be85d66aa743cfa20
0xB10C pushed a commit that referenced this pull request Jul 8, 2025
Using Clang clang version 20.1.6 (Fedora 20.1.6-9.fc43) and:
```bash
export CC=clang
export CXX=clang++
cmake -B build -DBUILD_GUI=ON -DSANITIZERS=address
cmake --build build
export LSAN_OPTIONS="suppressions=/root/bitcoin/test/sanitizer_suppressions/lsan"
ctest --test-dir build
```

```bash
Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 1589ms
********* Finished testing of AddressBookTests *********

=================================================================
==21869==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 88 byte(s) in 1 object(s) allocated from:
    #0 0xaaaab5d5af40 in operator new(unsigned long) (/root/bitcoin/build/bin/test_bitcoin-qt+0x39af40) (BuildId: c0e038f1c507ea6860d1cfd499ac54ad83359872)
    #1 0xffff8c8f56cc in QLayoutPrivate::createWidgetItem(QLayout const*, QWidget*) (/lib64/libQt6Widgets.so.6+0x1a56cc) (BuildId: 8b7b9e470f4d4cd920282a4f963abb01225814fa)
    #2 0xffff8c8d2f90 in QBoxLayout::insertWidget(int, QWidget*, int, QFlags<Qt::AlignmentFlag>) (/lib64/libQt6Widgets.so.6+0x182f90) (BuildId: 8b7b9e470f4d4cd920282a4f963abb01225814fa)
    #3 0xaaaab5fc7188 in SendCoinsDialog::addEntry() /root/bitcoin/build/src/qt/./qt/sendcoinsdialog.cpp:596:18
    #4 0xaaaab5fc4eec in SendCoinsDialog::SendCoinsDialog(PlatformStyle const*, QWidget*) /root/bitcoin/build/src/qt/./qt/sendcoinsdialog.cpp:84:5
    #5 0xaaaab5da67ac in (anonymous namespace)::MiniGUI::MiniGUI(interfaces::Node&, PlatformStyle const*) /root/bitcoin/build/src/qt/test/./qt/test/wallettests.cpp:235:75
    #6 0xaaaab5da2000 in (anonymous namespace)::TestGUI(interfaces::Node&, std::shared_ptr<wallet::CWallet> const&) /root/bitcoin/build/src/qt/test/./qt/test/wallettests.cpp:270:13
    #7 0xaaaab5d9ebc8 in (anonymous namespace)::TestGUI(interfaces::Node&) /root/bitcoin/build/src/qt/test/./qt/test/wallettests.cpp:453:5
    #8 0xaaaab5d9ebc8 in WalletTests::walletTests() /root/bitcoin/build/src/qt/test/./qt/test/wallettests.cpp:475:5
    #9 0xffff8b1c5314 in QMetaMethodInvoker::invokeImpl(QMetaMethod, void*, Qt::ConnectionType, long long, void const* const*, char const* const*, QtPrivate::QMetaTypeInterface const* const*) (/lib64/libQt6Core.so.6+0x195314) (BuildId: eacb2d1228362560e5df1a1ce496c99ad61960e7)
    #10 0xffff8b1c5dc8 in QMetaMethod::invokeImpl(QMetaMethod, void*, Qt::ConnectionType, long long, void const* const*, char const* const*, QtPrivate::QMetaTypeInterface const* const*) (/lib64/libQt6Core.so.6+0x195dc8) (BuildId: eacb2d1228362560e5df1a1ce496c99ad61960e7)
    #11 0xffff8cf57c54  (/lib64/libQt6Test.so.6+0x27c54) (BuildId: 96bb1cdeead53af0ced36d7970cf9cd79c4c4ccd)
    #12 0xffff8cf5fa18  (/lib64/libQt6Test.so.6+0x2fa18) (BuildId: 96bb1cdeead53af0ced36d7970cf9cd79c4c4ccd)
    #13 0xffff8cf6067c  (/lib64/libQt6Test.so.6+0x3067c) (BuildId: 96bb1cdeead53af0ced36d7970cf9cd79c4c4ccd)
    #14 0xffff8cf610a4  (/lib64/libQt6Test.so.6+0x310a4) (BuildId: 96bb1cdeead53af0ced36d7970cf9cd79c4c4ccd)
    #15 0xffff8cf61aa4 in QTest::qRun() (/lib64/libQt6Test.so.6+0x31aa4) (BuildId: 96bb1cdeead53af0ced36d7970cf9cd79c4c4ccd)
    bitcoin#16 0xffff8cf61eb4 in QTest::qExec(QObject*, int, char**) (/lib64/libQt6Test.so.6+0x31eb4) (BuildId: 96bb1cdeead53af0ced36d7970cf9cd79c4c4ccd)
    bitcoin#17 0xaaaab5d7d77c in main /root/bitcoin/build/src/qt/test/./qt/test/test_main.cpp:95:30
    bitcoin#18 0xffff8aad6398 in __libc_start_call_main (/lib64/libc.so.6+0x26398) (BuildId: 627f878dd454ee3cc1dfdbd347bb565f1ffb53e7)
    bitcoin#19 0xffff8aad6478 in __libc_start_main@GLIBC_2.17 (/lib64/libc.so.6+0x26478) (BuildId: 627f878dd454ee3cc1dfdbd347bb565f1ffb53e7)
    bitcoin#20 0xaaaab5c74cac in _start (/root/bitcoin/build/bin/test_bitcoin-qt+0x2b4cac) (BuildId: c0e038f1c507ea6860d1cfd499ac54ad83359872)
```

This happens when building using depends:
```bash
Indirect leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0xaaaabdbe86f8 in malloc (/root/bitcoin/build/bin/test_bitcoin-qt+0x4386f8) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #1 0xfbff97f8c164  (<unknown module>)
    #2 0xaaaabf0cfaa4 in QDBusConnectionPrivate::QDBusConnectionPrivate() (/root/bitcoin/build/bin/test_bitcoin-qt+0x191faa4) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #3 0xaaaabf0c9e30 in QDBusConnectionManager::doConnectToStandardBus(QDBusConnection::BusType, QString const&, bool) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1919e30) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #4 0xaaaabf0cb0e4 in QtPrivate::QCallableObject<QDBusConnectionPrivate* (QDBusConnectionManager::*)(QDBusConnection::BusType, QString const&, bool), QtPrivate::List<QDBusConnection::BusType&, QString const&, bool&>, QDBusConnectionPrivate*>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (/root/bitcoin/build/bin/test_bitcoin-qt+0x191b0e4) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #5 0xaaaabf5cbaf0 in QObject::event(QEvent*) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1e1baf0) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #6 0xaaaabf5a4ce0 in QCoreApplicationPrivate::notify_helper(QObject*, QEvent*) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1df4ce0) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #7 0xaaaabf5a486c in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1df486c) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #8 0xaaaabf5a575c in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1df575c) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #9 0xaaaabf66b858 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1ebb858) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #10 0xaaaabf5a9e3c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1df9e3c) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #11 0xaaaabf632a44 in QThread::exec() (/root/bitcoin/build/bin/test_bitcoin-qt+0x1e82a44) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #12 0xaaaabf0c9bd0 in QDBusConnectionManager::run() (/root/bitcoin/build/bin/test_bitcoin-qt+0x1919bd0) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #13 0xaaaabf669c30 in QThreadPrivate::start(void*) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1eb9c30) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
    #14 0xaaaabdbe5f2c in asan_thread_start(void*) asan_interceptors.cpp.o
    #15 0xffff99538608 in thread_start (/lib64/libc.so.6+0xf8608) (BuildId: 627f878dd454ee3cc1dfdbd347bb565f1ffb53e7)

SUMMARY: AddressSanitizer: 3592 byte(s) leaked in 37 allocation(s).
```
0xB10C pushed a commit that referenced this pull request Jul 8, 2025
5be31b2 lsan: add more Qt suppressions (fanquake)

Pull request description:

  Using Clang clang version 20.1.6 (Fedora 20.1.6-9.fc43) and:
  ```bash
  export CC=clang
  export CXX=clang++
  cmake -B build -DBUILD_GUI=ON -DSANITIZERS=address
  cmake --build build
  export LSAN_OPTIONS="suppressions=/root/bitcoin/test/sanitizer_suppressions/lsan"
  ctest --test-dir build
  ```

  ```bash
  Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 1589ms
  ********* Finished testing of AddressBookTests *********

  =================================================================
  ==21869==ERROR: LeakSanitizer: detected memory leaks

  Direct leak of 88 byte(s) in 1 object(s) allocated from:
      #0 0xaaaab5d5af40 in operator new(unsigned long) (/root/bitcoin/build/bin/test_bitcoin-qt+0x39af40) (BuildId: c0e038f1c507ea6860d1cfd499ac54ad83359872)
      #1 0xffff8c8f56cc in QLayoutPrivate::createWidgetItem(QLayout const*, QWidget*) (/lib64/libQt6Widgets.so.6+0x1a56cc) (BuildId: 8b7b9e470f4d4cd920282a4f963abb01225814fa)
      #2 0xffff8c8d2f90 in QBoxLayout::insertWidget(int, QWidget*, int, QFlags<Qt::AlignmentFlag>) (/lib64/libQt6Widgets.so.6+0x182f90) (BuildId: 8b7b9e470f4d4cd920282a4f963abb01225814fa)
      #3 0xaaaab5fc7188 in SendCoinsDialog::addEntry() /root/bitcoin/build/src/qt/./qt/sendcoinsdialog.cpp:596:18
      #4 0xaaaab5fc4eec in SendCoinsDialog::SendCoinsDialog(PlatformStyle const*, QWidget*) /root/bitcoin/build/src/qt/./qt/sendcoinsdialog.cpp:84:5
      #5 0xaaaab5da67ac in (anonymous namespace)::MiniGUI::MiniGUI(interfaces::Node&, PlatformStyle const*) /root/bitcoin/build/src/qt/test/./qt/test/wallettests.cpp:235:75
      #6 0xaaaab5da2000 in (anonymous namespace)::TestGUI(interfaces::Node&, std::shared_ptr<wallet::CWallet> const&) /root/bitcoin/build/src/qt/test/./qt/test/wallettests.cpp:270:13
      #7 0xaaaab5d9ebc8 in (anonymous namespace)::TestGUI(interfaces::Node&) /root/bitcoin/build/src/qt/test/./qt/test/wallettests.cpp:453:5
      #8 0xaaaab5d9ebc8 in WalletTests::walletTests() /root/bitcoin/build/src/qt/test/./qt/test/wallettests.cpp:475:5
      #9 0xffff8b1c5314 in QMetaMethodInvoker::invokeImpl(QMetaMethod, void*, Qt::ConnectionType, long long, void const* const*, char const* const*, QtPrivate::QMetaTypeInterface const* const*) (/lib64/libQt6Core.so.6+0x195314) (BuildId: eacb2d1228362560e5df1a1ce496c99ad61960e7)
      #10 0xffff8b1c5dc8 in QMetaMethod::invokeImpl(QMetaMethod, void*, Qt::ConnectionType, long long, void const* const*, char const* const*, QtPrivate::QMetaTypeInterface const* const*) (/lib64/libQt6Core.so.6+0x195dc8) (BuildId: eacb2d1228362560e5df1a1ce496c99ad61960e7)
      #11 0xffff8cf57c54  (/lib64/libQt6Test.so.6+0x27c54) (BuildId: 96bb1cdeead53af0ced36d7970cf9cd79c4c4ccd)
      #12 0xffff8cf5fa18  (/lib64/libQt6Test.so.6+0x2fa18) (BuildId: 96bb1cdeead53af0ced36d7970cf9cd79c4c4ccd)
      #13 0xffff8cf6067c  (/lib64/libQt6Test.so.6+0x3067c) (BuildId: 96bb1cdeead53af0ced36d7970cf9cd79c4c4ccd)
      #14 0xffff8cf610a4  (/lib64/libQt6Test.so.6+0x310a4) (BuildId: 96bb1cdeead53af0ced36d7970cf9cd79c4c4ccd)
      #15 0xffff8cf61aa4 in QTest::qRun() (/lib64/libQt6Test.so.6+0x31aa4) (BuildId: 96bb1cdeead53af0ced36d7970cf9cd79c4c4ccd)
      bitcoin#16 0xffff8cf61eb4 in QTest::qExec(QObject*, int, char**) (/lib64/libQt6Test.so.6+0x31eb4) (BuildId: 96bb1cdeead53af0ced36d7970cf9cd79c4c4ccd)
      bitcoin#17 0xaaaab5d7d77c in main /root/bitcoin/build/src/qt/test/./qt/test/test_main.cpp:95:30
      bitcoin#18 0xffff8aad6398 in __libc_start_call_main (/lib64/libc.so.6+0x26398) (BuildId: 627f878dd454ee3cc1dfdbd347bb565f1ffb53e7)
      bitcoin#19 0xffff8aad6478 in __libc_start_main@GLIBC_2.17 (/lib64/libc.so.6+0x26478) (BuildId: 627f878dd454ee3cc1dfdbd347bb565f1ffb53e7)
      bitcoin#20 0xaaaab5c74cac in _start (/root/bitcoin/build/bin/test_bitcoin-qt+0x2b4cac) (BuildId: c0e038f1c507ea6860d1cfd499ac54ad83359872)
  ```

  This happens when building using depends:
  ```bash
  Indirect leak of 24 byte(s) in 1 object(s) allocated from:
      #0 0xaaaabdbe86f8 in malloc (/root/bitcoin/build/bin/test_bitcoin-qt+0x4386f8) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
      #1 0xfbff97f8c164  (<unknown module>)
      #2 0xaaaabf0cfaa4 in QDBusConnectionPrivate::QDBusConnectionPrivate() (/root/bitcoin/build/bin/test_bitcoin-qt+0x191faa4) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
      #3 0xaaaabf0c9e30 in QDBusConnectionManager::doConnectToStandardBus(QDBusConnection::BusType, QString const&, bool) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1919e30) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
      #4 0xaaaabf0cb0e4 in QtPrivate::QCallableObject<QDBusConnectionPrivate* (QDBusConnectionManager::*)(QDBusConnection::BusType, QString const&, bool), QtPrivate::List<QDBusConnection::BusType&, QString const&, bool&>, QDBusConnectionPrivate*>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (/root/bitcoin/build/bin/test_bitcoin-qt+0x191b0e4) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
      #5 0xaaaabf5cbaf0 in QObject::event(QEvent*) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1e1baf0) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
      #6 0xaaaabf5a4ce0 in QCoreApplicationPrivate::notify_helper(QObject*, QEvent*) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1df4ce0) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
      #7 0xaaaabf5a486c in QCoreApplication::notifyInternal2(QObject*, QEvent*) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1df486c) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
      #8 0xaaaabf5a575c in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1df575c) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
      #9 0xaaaabf66b858 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1ebb858) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
      #10 0xaaaabf5a9e3c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1df9e3c) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
      #11 0xaaaabf632a44 in QThread::exec() (/root/bitcoin/build/bin/test_bitcoin-qt+0x1e82a44) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
      #12 0xaaaabf0c9bd0 in QDBusConnectionManager::run() (/root/bitcoin/build/bin/test_bitcoin-qt+0x1919bd0) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
      #13 0xaaaabf669c30 in QThreadPrivate::start(void*) (/root/bitcoin/build/bin/test_bitcoin-qt+0x1eb9c30) (BuildId: dd54811dc11325890f7bac3e3a49d38f5a7ffef5)
      #14 0xaaaabdbe5f2c in asan_thread_start(void*) asan_interceptors.cpp.o
      #15 0xffff99538608 in thread_start (/lib64/libc.so.6+0xf8608) (BuildId: 627f878dd454ee3cc1dfdbd347bb565f1ffb53e7)

  SUMMARY: AddressSanitizer: 3592 byte(s) leaked in 37 allocation(s).
  ```

ACKs for top commit:
  maflcko:
    lgtm ACK 5be31b2

Tree-SHA512: 0c33661c7ec83ea9b874c1ee4ee2de513131690287363e216a88560dfb31a59ef563a50af756c86a991583aa64a600a74e20fd5d6a104cf4c0a27532de8d2211
0xB10C pushed a commit that referenced this pull request Jul 8, 2025
67dc752 cmake, test: Disable tests instead of ignoring them (Hennadii Stepanov)
bb9157d cmake, refactor: Switch to `Python3::Interpreter` imported target (Hennadii Stepanov)

Pull request description:

  This PR:

  1. Switches to a modern CMake approach by using the `Python3::Interpreter` imported target, which is more robust than using variables.

  2. Disables the `util_rpcauth_test` test explicitly instead of silently ignoring it.

  A build and test log for the case when Python is unavailable is provided below:
  ```
  $ cmake -B build
  $ cmake --build build -j 16
  $ ctest --test-dir build -j $(nproc) -R "^util"
  Internal ctest changing into directory: /bitcoin/build
  Test project /bitcoin/build
      Start 115: util_tests
      Start 117: util_trace_tests
      Start 114: util_string_tests
      Start 116: util_threadnames_tests
      Start   1: util_rpcauth_test
  1/5 Test   #1: util_rpcauth_test ................***Not Run (Disabled)   0.00 sec
  2/5 Test bitcoin#114: util_string_tests ................   Passed    0.11 sec
  3/5 Test bitcoin#117: util_trace_tests .................   Passed    0.11 sec
  4/5 Test bitcoin#116: util_threadnames_tests ...........   Passed    0.11 sec
  5/5 Test bitcoin#115: util_tests .......................   Passed    0.13 sec

  100% tests passed, 0 tests failed out of 4

  Total Test time (real) =   0.13 sec

  The following tests did not run:
    1 - util_rpcauth_test (Disabled)
  ```

ACKs for top commit:
  purpleKarrot:
    ACK 67dc752
  janb84:
    tACK 67dc752

Tree-SHA512: 5fc7ebe31ac03f4b8a53ecfcfc1cace0f647a1d2c989651988edae96bdfbbe2dee171714e57cb028e65ead1bb40806a82d9821746451dbf005538601fd33ea88
0xB10C pushed a commit that referenced this pull request Aug 4, 2025
…xec in RunCommandJSON"

faa1c3e Revert "Merge bitcoin#32343: common: Close non-std fds before exec in RunCommandJSON" (MarcoFalke)

Pull request description:

  After a fork() in a multithreaded program, the child can safely
  call only async-signal-safe functions (see [signal-safety(7)](https://www.man7.org/linux/man-pages/man7/signal-safety.7.html))
  until such time as it calls execv.

  The standard library (`std` namespace) is not async-signal-safe. Also, `throw`, isn't.

  There was an alternative implementation using `readdir` (bitcoin#32529), but that isn't async-signal-safe either, and that implementation was still using `throw`.

  So temporarily revert this feature.

  A follow-up in the future can add it back, using only async-signal-safe functions, or by using a different approach.

  Fixes bitcoin#32524
  Fixes bitcoin#33015
  Fixes bitcoin#32855

  For reference, a failure can manifest in the GCC debug mode:

  * While `fork`ing, a debug mode mutex is held (by any other thread).
  * The `fork`ed child tries to use the stdard libary before `execv` and deadlocks.

  This may look like the following:

  ```
  (gdb) thread apply all bt

  Thread 1 (Thread 0xf58f4b40 (LWP 774911) "b-httpworker.2"):
  #0  0xf7f4f589 in __kernel_vsyscall ()
  #1  0xf79e467e in ?? () from /lib32/libc.so.6
  #2  0xf79eb582 in pthread_mutex_lock () from /lib32/libc.so.6
  #3  0xf7d93bf2 in ?? () from /lib32/libstdc++.so.6
  #4  0xf7d93f36 in __gnu_debug::_Safe_iterator_base::_M_attach(__gnu_debug::_Safe_sequence_base*, bool) () from /lib32/libstdc++.so.6
  #5  0x5668810a in __gnu_debug::_Safe_iterator_base::_Safe_iterator_base (this=0xf58f13ac, __seq=0xf58f13f8, __constant=false) at /bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/debug/safe_base.h:91
  #6  0x56ddfb50 in __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<int*, std::__cxx1998::vector<int, std::allocator<int> > >, std::__debug::vector<int, std::allocator<int> >, std::forward_iterator_tag>::_Safe_iterator (this=0xf58f13a8, __i=3, __seq=0xf58f13f8) at /bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/debug/safe_iterator.h:162
  #7  0x56ddfacb in __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<int*, std::__cxx1998::vector<int, std::allocator<int> > >, std::__debug::vector<int, std::allocator<int> >, std::bidirectional_iterator_tag>::_Safe_iterator (this=0xf58f13a8, __i=3, __seq=0xf58f13f8) at /bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/debug/safe_iterator.h:539
  #8  0x56ddfa5b in __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<int*, std::__cxx1998::vector<int, std::allocator<int> > >, std::__debug::vector<int, std::allocator<int> >, std::random_access_iterator_tag>::_Safe_iterator (this=0xf58f13a8, __i=3, __seq=0xf58f13f8) at /bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/debug/safe_iterator.h:687
  #9  0x56ddd3f6 in std::__debug::vector<int, std::allocator<int> >::begin (this=0xf58f13f8) at /bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/debug/vector:300
  #10 0x57d83701 in subprocess::detail::Child::execute_child (this=0xf58f156c) at ./util/subprocess.h:1372
  #11 0x57d80a7c in subprocess::Popen::execute_process (this=0xf58f1cd8) at ./util/subprocess.h:1231
  #12 0x57d6d2b4 in subprocess::Popen::Popen<subprocess::input, subprocess::output, subprocess::error, subprocess::close_fds> (this=0xf58f1cd8, cmd_args="fake.py enumerate", args=..., args=..., args=..., args=...) at ./util/subprocess.h:964
  #13 0x57d6b597 in RunCommandParseJSON (str_command="fake.py enumerate", str_std_in="") at ./common/run_command.cpp:27
  #14 0x57a90547 in ExternalSigner::Enumerate (command="fake.py", signers=std::__debug::vector of length 0, capacity 0, chain="regtest") at ./external_signer.cpp:28
  #15 0x56defdab in enumeratesigners()::$_0::operator()(RPCHelpMan const&, JSONRPCRequest const&) const (this=0xf58f2ba0, self=..., request=...) at ./rpc/external_signer.cpp:51
  ...
  (truncated, only one thread exists)
  ```

ACKs for top commit:
  fanquake:
    ACK faa1c3e
  darosior:
    ACK faa1c3e

Tree-SHA512: 602da5f2eba08d7fe01ba19baf411e287ae27fe2d4b82f41734e05b7b1d938ce94cc0041e86ba677284fa92838e96ebee687023ff28047e2b036fd9a53567e0a
0xB10C pushed a commit that referenced this pull request Sep 15, 2025
The `-assumevalid` option skips script verification for a specified block and all its ancestors during Initial Block Download.
Many new users are surprised when this suddenly slows their node to a halt.
This commit adds a log message to clearly indicate when this optimization ends and full validation begins (and vice versa).

When using `-assumeutxo`, logging is suppressed for the active assumed-valid chainstate and for the background validation chainstate to avoid the confusing toggles.

-------

> cmake -B build && cmake --build build && mkdir -p demo && build/bin/bitcoind -datadir=demo -stopatheight=500 | grep 'signature validation'

```
2025-08-08T20:59:21Z Disabling signature validations at block #1 (00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048).
2025-08-08T20:59:21Z Enabling signature validations at block bitcoin#100 (000000007bc154e0fa7ea32218a72fe2c1bb9f86cf8c9ebf9a715ed27fdb229a).
2025-08-08T20:59:21Z Disabling signature validations at block bitcoin#200 (000000008f1a7008320c16b8402b7f11e82951f44ca2663caf6860ab2eeef320).
2025-08-08T20:59:21Z Enabling signature validations at block bitcoin#300 (0000000062b69e4a2c3312a5782d7798b0711e9ebac065cd5d19f946439f8609).
```
0xB10C pushed a commit that referenced this pull request Sep 15, 2025
…hange

fab2980 assumevalid: log every script validation state change (Lőrinc)

Pull request description:

  The `-assumevalid` option skips script verification for a specified block and all its ancestors during Initial Block Download.
  Many new [users are surprised](bitcoin#32832) when this suddenly slows their node to a halt.
  This commit adds a log message to clearly indicate when this optimization ends and full validation begins (and vice versa).

  <details>
  <summary>Testing instructions</summary>

  The behavior can easily be tested by adding this before the new log:
  ```C++
      // TODO hack to enable/disable script checks based on block height for testing purposes
           if (pindex->nHeight < 100) fScriptChecks = false;
      else if (pindex->nHeight < 200) fScriptChecks = true;
      else if (pindex->nHeight < 300) fScriptChecks = false;
      else if (pindex->nHeight < 400) fScriptChecks = true;
  ```
  and exercise the new code with:
  ```bash
  cmake -B build && cmake --build build && mkdir -p demo && build/bin/bitcoind -datadir=demo -stopatheight=500 | grep 'signature validation'
  ```
  showing something like:
  * Disabling signature validations at block #1 (00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048).
  * Enabling signature validations at block bitcoin#100 (000000007bc154e0fa7ea32218a72fe2c1bb9f86cf8c9ebf9a715ed27fdb229a).
  * Disabling signature validations at block bitcoin#200 (000000008f1a7008320c16b8402b7f11e82951f44ca2663caf6860ab2eeef320).
  * Enabling signature validations at block bitcoin#300 (0000000062b69e4a2c3312a5782d7798b0711e9ebac065cd5d19f946439f8609).

  </details>

ACKs for top commit:
  achow101:
    ACK fab2980
  ajtowns:
    crACK fab2980
  davidgumberg:
    untested crACK bitcoin@fab2980

Tree-SHA512: e90b66f7423b639356daace476942ce83e65e70466544394cbe2f15738bdbf716163eaf590c64c5448f9b41aeeaafe3342c48c6a7a478678a70b0310ca94e11d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants