node: don't abort on invalid -dbcache in settings.json #36347

pull 0xShadowX wants to merge 1 commits into bitcoin:master from 0xShadowX:fix-dbcache-settings-abort changing 3 files +7 −2
  1. 0xShadowX commented at 5:16 PM on September 26, 2026: none

    LogOversizedDbCache (added in #33333) is noexcept, but it reads -dbcache through CalculateDbCacheBytes -> GetIntArg. GetIntArg throws when settings.json has a number that isn't an integer or doesn't fit in int64, e.g. {"dbcache": 4096.5}. The exception hits the noexcept boundary and bitcoind aborts during startup:

    libc++abi: terminating due to uncaught exception of type std::runtime_error: JSON integer out of range
    

    This removes noexcept. The exception now reaches the handler in AppInit, and the node exits with status 1 and an error message instead of aborting:

    EXCEPTION: St13runtime_error
    JSON integer out of range
    bitcoin in AppInit()
    

    The added case in feature_settings.py writes {"dbcache": 4096.5} to settings.json and checks that startup fails with that message from AppInit.

  2. node: don't abort on invalid -dbcache in settings.json
    LogOversizedDbCache is noexcept, but it reads -dbcache through
    GetIntArg, which throws when settings.json holds a number that is not
    an integer or doesn't fit in int64 (e.g. {"dbcache": 4096.5}). The
    exception hits the noexcept boundary and std::terminate aborts
    bitcoind during startup.
    
    Remove noexcept so the exception reaches AppInit like it does for other
    integer settings, and the node exits with an error message instead of
    aborting.
    75e297d791
  3. DrahtBot commented at 5:16 PM on September 26, 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/36347.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    <!--5faf32d7da4f0f540f40219e4f7537a3-->


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-09-28 10:51 UTC

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