[fuzz] cargo fuzz targets for the road-file parser and the control envelope

road_file: any bytes as one road file in the home store. The parser never panics;
a road that parses renders to canonical text that parses back to the same road
and rendering is a fixed point; compile never panics; and a file that does not
parse, or a road the compiler reports an error for, leaves every plan
byte-identical (deny by default).

envelope: Envelope::decode never panics; whatever it accepts re-encodes, decodes
to the same envelope and encodes stably.

Own workspace, as cargo fuzz lays it out. On Windows with the stable MSVC
toolchain and no sanitizer, build.rs links win_sections.c, which gives the
SanitizerCoverage counters their COFF section bounds (compiler-rt only ships them
inside a sanitizer runtime); the exact command is in road_file.rs.
This commit is contained in:
2026-11-25 08:15:53 +01:00
parent 828962a9e9
commit d5917e7aab
7 changed files with 613 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
// Windows only: give the coverage counters their section bounds (see win_sections.c).
fn main() {
println!("cargo:rerun-if-changed=win_sections.c");
if std::env::var("CARGO_CFG_TARGET_ENV").as_deref() == Ok("msvc") {
cc::Build::new().file("win_sections.c").compile("win_sections");
}
}