1 minor finding · 1 suggestion
Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive for their assessments.
Findings
[minor] · New overflow rejection becomes a false wallet_bdb_parser crash
Source inspection shows that fuzz inputs reaching the new Overflow page has no data rejection are rethrown as crashes; whether the current corpus triggers this is unconfirmed.
Location: src/wallet/legacybdb.cpp:705 (head).
Details and suggested fix
When an otherwise accepted fuzz input references an overflow page with hf_offset == 0, MakeBerkeleyRODatabase catches the new exception and returns FAILED_LOAD with its message in error.original. The wallet_bdb_parser allowlist does not include that message, so it throws another std::runtime_error, which escapes the fuzz entry point. An empty terminal page previously completed the traversal, so this introduces a false crash even for inputs that did not previously time out. Add error.original == "Overflow page has no data" to the fuzz target's expected-error allowlist.
Optional improvements
[suggestion] · Infinite-loop regression test has no subprocess deadline
If the empty-page guard regresses, the new tool_wallet.py case waits indefinitely for bitcoin-wallet rather than reporting a bounded test failure.
Location: test/functional/tool_wallet.py:494 (head).
Details and suggested fix
The fixture makes page 4 empty and points its next_page back to itself. Without the guard, reading it never advances the accumulated length. assert_raises_tool_error waits in p.communicate() without a timeout, and test_runner.py also waits for the test process without a deadline. For this hang-specific case, use communicate(timeout=...) scaled by self.options.timeout_factor; on TimeoutExpired, kill and reap the subprocess before failing with a clear diagnostic. Retain the existing stdout, exit-code, stderr, and dump-file assertions.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [suggestion]: The blanket empty-page rejection lacks a documented compatibility basis (earlier report)
Background
Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.
Documented decisions
The earlier overflow-length validation was explicitly intended to prevent circular overflow references from causing infinite traversal: it rejects impossible declared lengths and data exceeding the declared item length.
This documents the termination rationale inherited by the affected loop, not a historical guarantee that overflow pages contain data. In the pinned base, a page contributing no bytes does not advance the accumulated-length bound. The head adds a nonempty-page requirement, but the inspected historical proposal does not supply compatibility evidence for that requirement.
Ralph's inferences
This reader's existing compatibility policy distinguishes ideal format invariants from files BDB actually accepts; a normal-writer invariant alone would not establish the full historical acceptance boundary.
The pinned reader deliberately omits a file-size divisibility check because BDB accepts such files, and omits a subdatabase last-page check because BDB does not maintain that field reliably. These exceptions explain why the empty-page question needs writer or acceptance evidence specific to overflow chains. They do not themselves demonstrate that empty overflow pages are valid.
The reader's accepted input is narrower than arbitrary BDB recovery states: it requires every page's log sequence number to indicate that logs are unnecessary to obtain the database contents.
The pinned code rejects pages whose LSN is not file 0, offset 1, and directs users to reopen and close the database with a BDB-capable version. A transient empty page during recovery would therefore not by itself answer the compatibility question; the relevant case is an empty overflow page still referenced after completion and flushing. No inspected source establishes whether that case can occur.