Commit Graph

6 Commits

Author SHA1 Message Date
marcofleon
48df0939e7 fuzz: Remove unnecessary thread pool mutexes
Remove the `Mutex` from the `threadpool` and `dbwrapper_concurrent_reads`
pool startup helpers. Fuzz targets are entered sequentially within a
process and parallel fuzzing uses separate processes/forks, which each
have their own copy of the global thread pool. Therefore, a mutex to
prevent two in-process callers from racing to start the pool isn't needed.
2026-06-22 12:11:22 +01:00
marcofleon
a4c3b003f8 fuzz: Speed up dbwrapper_concurrent_reads harness
Limit how many read queries each worker executes. This significantly
speeds up the test, as each worker runs >90% fewer (2000 to 128)
expensive LevelDB operations (like `IteratorSeek`) but still
ends up hitting the intended target code.

Revert the `num_entries` max from 3000 back to 5000, as that didn't
have much effect on input speed and restores a bit of lost coverage.
2026-06-22 12:11:14 +01:00
Andrew Toth
1ce9e26239 fuzz: improve dbwrapper_concurrent_reads performance 2026-06-10 14:31:03 -04:00
Andrew Toth
8cb8653a22 fuzz: target concurrent leveldb reads 2026-06-02 09:56:32 -04:00
Andrew Toth
6609088fe6 fuzz: extract ConsumeDBParams helper
Pull the inline DBParams construction out of TestDbWrapper into a shared
ConsumeDBParams() helper. This is a pure refactor with no behavior change,
preparing for an additional harness that needs to build the same params.
2026-06-02 09:48:57 -04:00
Andrew Toth
b63ef20d54 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.

A sibling dbwrapper_threaded target uses a bare memenv so LevelDB's real
background thread runs, exercising force_compact and threaded compaction
paths that the deterministic variant cannot reach.

Adds an implicit-integer-sign-change suppression for
BytewiseComparatorImpl::FindShortSuccessor (leveldb/util/comparator.cc:58)
to the test ubsan suppressions list. LevelDB's bytewise comparator
implicitly converts a signed `char` byte to `uint8_t` there. The path
is only reached when compaction picks an SST boundary key, so it
requires a small enough max_file_size for compaction to fire during
the fuzz run.

Co-authored-by: l0rinc <pap.lorinc@gmail.com>
2026-05-20 11:03:36 -04:00