We currently don’t have a dedicated harness targeting CDBWrapper. OSS-Fuzz has a rudimentary harness for levelDB which fails, so doesn’t appear maintained.
This PR adds a harness targeting CDBWrapper against an in-memory oracle to verify correctness.
A DeterministicEnv wraps levelDB’s memenv to eliminate non-determinism by capturing background compaction and running it at fuzzer-chosen points.
The fuzzer also controls the cache_bytes and max_file_size sizes so that small values trigger memtable flushes and compaction.
DrahtBot added the label
Fuzzing
on Mar 21, 2026
DrahtBot
commented at 1:12 am on March 21, 2026:
contributor
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Reviews
See the guideline for information on the review process.
If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.
Conflicts
No conflicts as of last run.
DrahtBot added the label
CI failed
on Mar 21, 2026
andrewtoth force-pushed
on Mar 21, 2026
DrahtBot removed the label
CI failed
on Mar 21, 2026
andrewtoth force-pushed
on Mar 21, 2026
andrewtoth force-pushed
on Mar 21, 2026
andrewtoth force-pushed
on Mar 21, 2026
DrahtBot added the label
CI failed
on Mar 22, 2026
andrewtoth force-pushed
on Mar 22, 2026
andrewtoth force-pushed
on Mar 22, 2026
DrahtBot removed the label
CI failed
on Mar 22, 2026
dbwrapper: make max_file_size a configurable DBParams field
Useful for fuzzing different values.
9e444624bb
dbwrapper: accept optional testing leveldb::Env in DBParams
Allow callers to inject a custom leveldb::Env via DBParams::testing_env,
which takes priority over the memory_only in-memory environment. This
enables fuzz harnesses to supply a deterministic environment.
e903203536
andrewtoth force-pushed
on Mar 29, 2026
marcofleon
commented at 3:22 pm on April 2, 2026:
contributor
Concept ACK
Nice differential fuzz test. I’m running it now and I’ll do a more thorough review soon.
test: add fuzz harness for CDBWrapper
Introduces a libFuzzer harness that exercises CDBWrapper operations
against a std::map oracle, with a DeterministicEnv that captures LevelDB
background compaction for single-threaded determinism.
b967e255e7
andrewtoth force-pushed
on Apr 11, 2026
andrewtoth
commented at 3:10 pm on April 11, 2026:
contributor
Improved the assertions around iterators. This now exhausts the DB iterator completely instead of using LIMITED_WHILE, and asserts that the oracle iterator is also exhausted, ensuring no entries are missing.
Also added coverage for failing to deserialize a value by reading with a type that always throws on deserialization.
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-04-12 12:12 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me