Every STITCH++ project is a folder with a stitch.toml, a Dockerfile that builds the library,
and harness/ with the stubs. stitch init writes all three. Commands find the project by
looking for stitch.toml in the current directory and its parents (stitch -C DIR picks one).
[project]
stitch_version = "0.2.0"# the STITCH++ release this harness is written for
name = "cjson"
language = "cpp"
[source]
git = "https://github.com/DaveGamble/cJSON"
rev = "v1.7.18"
[build]
cflags = ["-I/src"]
ldflags = ["/src/build/libcjson.a"]
[fuzz]
timeout_ms = 2000
Only [source] is required. Paths that the build uses (cflags, classpath, path = "/src", …)
are paths inside the image, where the library source is at /src. A relative
[source] path is the exception: it is on your machine, relative to the folder of stitch.toml.
[project] stitch_version pins the project to one release of STITCH++: one version of the
stitch-fuzz CLI, and with it one runtime and one set of Docker images. The images are tagged by a
hash of their sources and never change once published, so the same version always builds and
fuzzes the harness the same way.
The pin is exact. A CLI of any other version stops with:
error: this project is pinned to STITCH++ 0.2.0 (stitch.toml [project] stitch_version), but the installed stitch-fuzz is 0.3.0.
use the pinned version: pip install stitch-fuzz==0.2.0
(or without installing: uvx --from stitch-fuzz==0.2.0 stitch ...)
or move the project to 0.3.0: read `stitch changelog --since 0.2.0`, update the harness, then run `stitch upgrade`
To work on a project (fuzz, triage, write reproducers): install the pinned version, as the
message says. Do not change the pin to make the error go away.
To move a project to a newer release: with the newer CLI installed, read
stitch changelog (in a project it lists the releases after the pinned one) and make the
harness changes each entry lists under Upgrading. Then stitch upgrade rewrites
stitch_version, and stitch build, stitch check and stitch probe confirm the harness
works. Start new campaigns after an upgrade (stitch fuzz --fresh): the old ones were made
with the old runtime.
stitch init writes the installed version. A project without stitch_version runs with any
release (no check); stitch upgrade adds the pin.
STITCH_ANY_VERSION=1 turns the error into a warning, for developing STITCH++ itself.
CHANGELOG.md (in the repository, and stitch changelog offline) describes every release.
stitch repro and stitch report made from such a project fetch the library from the
repository’s origin at the current commit when that commit is pushed and nothing outside
stitch/ is modified, instead of bundling the source.
Repository URL. Mirrored once under ~/.cache/stitch/git; every revision builds from it.
rev
"HEAD"
Branch, tag or commit to build. stitch build --rev X (and exec, try, cov) override it; stitch bisect walks the history.
path
A local directory, used as-is with uncommitted changes. Relative to the folder of stitch.toml. If it is a git checkout, --rev and bisect work on its history.
submodules
false
Check out git submodules.
keep_git
false
Keep .git in /src (for builds that run git describe).
The Dockerfile that builds the library, relative to the project folder. It starts ARG STITCH_BASE / FROM ${STITCH_BASE} and copies the source with COPY --from=source . /src.
build_args
{}
Extra --build-arg values for it, e.g. { CMAKE_FLAGS = "-DFOO=ON" }.
context_files
[]
Files and folders of the project the Dockerfile COPYs (patches, scripts). Reproducers include them.
platform
none
--platform for building and running, e.g. "linux/amd64" for a library that does not build on arm64.
Time per program. A slower program is reported as a timeout.
max_nodes
24
Most calls per program.
jobs
1
Workers of stitch fuzz (--jobs overrides).
exceptions
"finding"
An uncaught exception the stub did not declare is a bug ("finding"), or just a failed call ("bail"). Every language except Swift (whose errors are values).
The harness crate’s dependencies, written as in Cargo.toml: the library (its crate name from /src/Cargo.toml; a workspace member: path = "/src/<crate>") and anything else the stubs use.
overflow_checks
true
Integer overflow panics.
sanitizers
[build] sanitizers
["address"] adds AddressSanitizer; [] on targets without it.