Skip to content

mempool_updatefromblock.py fails on 32-bit (armhf, ...) #34108

Closed

Description

@maflcko

Steps to reproduce:

  • armhf metal, or via podman run -it --rm --platform linux/arm/v7 'debian:trixie'
  • export DEBIAN_FRONTEND=noninteractive && apt update && apt install curl wget htop git vim ccache -y && git clone https://github.com/bitcoin/bitcoin.git --depth=1 ./b-c && cd b-c && apt install build-essential cmake pkg-config python3-zmq libzmq3-dev libevent-dev libboost-dev libsqlite3-dev systemtap-sdt-dev libcapnp-dev capnproto libqrencode-dev qt6-tools-dev qt6-l10n-tools qt6-base-dev clang llvm libc++-dev libc++abi-dev -y
  • rm -rf ./bld-bisect/ && cmake -B ./bld-bisect -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER='clang' -DCMAKE_CXX_COMPILER='clang++' --preset=dev-mode -DBUILD_UTIL_CHAINSTATE=OFF -DBUILD_BENCH=OFF -DBUILD_FUZZ_BINARY=OFF -DBUILD_GUI=OFF -DBUILD_KERNEL_LIB=OFF -DBUILD_TESTS=OFF -DENABLE_WALLET=OFF -DENABLE_IPC=OFF -DWITH_ZMQ=OFF -DWITH_BDB=OFF -DWITH_NATPMP=OFF -DWITH_NATPMPP=OFF -DWITH_MINIUPNPC=OFF -DWITH_MULTIPROCESS=OFF
  • cmake --build ./bld-bisect --parallel $(nproc) && ./bld-bisect/test/functional/mempool_updatefromblock.py --timeout-factor 5

First bad commit is 4789436

2025-12-18T20:39:45.629000Z TestFramework (INFO): PRNG seed is: 1933782243
2025-12-18T20:39:45.630000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_b7nlv98l
2025-12-18T20:39:47.600000Z TestFramework (INFO): Creating 100 transactions...
2025-12-18T20:39:50.975000Z TestFramework (INFO): The batch of 25 transactions has been accepted into the mempool.
2025-12-18T20:39:51.183000Z TestFramework (INFO): All of the transactions from the current batch have been mined into a block.
2025-12-18T20:39:59.928000Z TestFramework (INFO): The batch of 25 transactions has been accepted into the mempool.
2025-12-18T20:40:00.151000Z TestFramework (INFO): All of the transactions from the current batch have been mined into a block.
2025-12-18T20:40:14.350000Z TestFramework (INFO): The batch of 25 transactions has been accepted into the mempool.
2025-12-18T20:40:14.574000Z TestFramework (INFO): All of the transactions from the current batch have been mined into a block.
2025-12-18T20:40:30.226000Z TestFramework (INFO): The last batch of 25 transactions has been accepted into the mempool.
2025-12-18T20:40:32.193000Z TestFramework (INFO): All of the recently mined transactions have been re-added into the mempool in 1.9641704559326172 seconds.
2025-12-18T20:40:32.194000Z TestFramework (INFO): Checking descendants/ancestors properties of all of the in-mempool transactions...
2025-12-18T20:40:34.347000Z TestFramework (INFO): Creating independent transactions to test MAX_DISCONNECTED_TX_POOL_BYTES limit during reorg
2025-12-18T20:42:25.872000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/b-c/test/functional/test_framework/test_framework.py", line 183, in main
    self.run_test()
    ~~~~~~~~~~~~~^^
  File "/b-c/./bld-bisect/test/functional/mempool_updatefromblock.py", line 185, in run_test
    self.test_max_disconnect_pool_bytes()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/b-c/./bld-bisect/test/functional/mempool_updatefromblock.py", line 175, in test_max_disconnect_pool_bytes
    assert_equal(len(mempool), expected_parent_count * 2)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/b-c/test/functional/test_framework/util.py", line 77, in assert_equal
    raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
AssertionError: not(398 == 396)

Activity

  1. maflcko commented on Dec 18, 2025

    @maflcko
    MemberAuthor

    I guess the 32-bit mempool has tighter packing, so accepts more transactions?

  2. maflcko commented on Dec 18, 2025

    @maflcko
    MemberAuthor

    Also related to #33724, I wonder if we should just give up on size_t and use u64 consistently everywhere.

    All of this engineering effort doesn't seem worth it just to allow the few armhf users to add a few bytes of more transactions to their mempool.

  3. sipa commented on Dec 18, 2025

    @sipa
    Member

    @maflcko Even without using platform-dependent integer sizes, there will be memory usage differences between 32-bit and 64-bit platforms due to differences in pointer size. Beyond those, malloc overhead and alignments can differ between systems as well.

  4. maflcko commented on Dec 22, 2025

    @maflcko
    MemberAuthor

    That is probably right. Replacing size_t with uint64_t inside the mempool entry does not change anything here. However, setting DEBUG=1 in the std lib "works around" the issue. So it is likely that the dynamic memory overhead is different.

  5. added a commit that references this issue on Jan 5, 2026
  6. added a commit that references this issue on Jun 28, 2026
  7. added a commit that references this issue on Jun 30, 2026
  8. added a commit that references this issue on Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions