kernel: handle null mempool on chainstate deletion #35753

pull l0rinc wants to merge 1 commits into bitcoin:master from l0rinc:l0rinc/delete-chainstate-null-mempool changing 2 files +10 −1
  1. l0rinc commented at 2:30 AM on July 20, 2026: contributor

    Problem: Kernel creates a ChainstateManager without a mempool, while AppInitMain() supplies one for node applications. If chainstate wiping is enabled and the data directory contains a saved AssumeUTXO snapshot, LoadChainstate() calls DeleteChainstate(), which dereferences the snapshot's null mempool pointer.

    Fix: Accept a missing mempool when deleting the snapshot, matching the existing check in AddChainstate().

    <details> <summary>Failure without the fix</summary>

    unknown location:0: fatal error: in "validation_chainstatemanager_tests/chainstatemanager_delete_chainstate_no_mempool": memory access violation at address: 0x48: invalid permissions
    

    </details>

  2. validation: handle null mempool on delete
    Kernel can create a `ChainstateManager` without a mempool.
    Deleting an AssumeUTXO chainstate then dereferences the previous chainstate's null mempool pointer.
    
    Allow the previous chainstate to have no mempool, matching `AddChainstate()`.
    Cover the reindex/wipe lifecycle.
    a99b27f192
  3. DrahtBot added the label Validation on Jul 20, 2026
  4. DrahtBot commented at 2:31 AM on July 20, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35753.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process. A summary of reviews will appear here.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-07-21 17:50 UTC

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