|
Embedded SDK
Embedded SDK
|
A campaign's merged corpus is its most valuable output: a compact set of inputs that together reach a lot of code. Promoting it into the app lets future runs and CI start from that coverage instead of rediscovering it every time.
After a good campaign, promote its merged corpus with promote-corpus.sh:
"$BOLOS_SDK"/fuzzing/scripts/promote-corpus.sh \ <app>/.fuzz-artifacts/<run>/targets/<target>/corpus \ <app>/fuzzing/base-corpus.zip
This writes two tracked files next to each other:
base-corpus.zip — the inputs, packed with the Python standard library (no zip/unzip tool required),base-corpus.compat-key — the sidecar key that ties the archive to a build.The .compat-key is metadata, not a fuzz input, so it is stored beside the archive, never inside it.
Reuse is automatic. On the next run the campaign (and CI) stage base-corpus.zip into the starting corpus — but only when its sidecar key matches the current build. A mismatch is reported and the stale corpus is skipped, so a changed binary is never fed inputs shaped for an old one. Set BASE_CORPUS_ZIP= (empty) to skip a promoted corpus for one run.
The end-to-end loop:
promote-corpus.sh its corpus to fuzzing/base-corpus.zip.base-corpus.zip and base-corpus.compat-key.The key is:
sha256( prefix_size || sha256(fuzz_globals.zon) || fuzzer || harness_version )
So it changes when the prefix size changes, when the invariant model changes (a new sanitizer, an SDK/toolchain change that shifts globals), or when you bump harness_version in the manifest. When the key changes, the old base corpus no longer matches: rerun a campaign and promote again to refresh it.
One promoted corpus per target is the intended shape.