From fef4f50d2fa7fd27d01371e918d3ba5f2e52f9cd Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 27 Oct 2025 21:32:57 +0000 Subject: [PATCH 1/2] Use `honggfuzz`'s `--run-time` arg to limit per-fuzz runtime in CI We have some complexity in `ci-fuzz.sh` to limit each fuzzer to a rough runtime, but `honggfuzz` has a `--run-time` argument that we can simply use instead, which we do here. --- fuzz/ci-fuzz.sh | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/fuzz/ci-fuzz.sh b/fuzz/ci-fuzz.sh index d1274d751a8..d57a5ad78fa 100755 --- a/fuzz/ci-fuzz.sh +++ b/fuzz/ci-fuzz.sh @@ -33,17 +33,9 @@ cargo --color always hfuzz build -j8 for TARGET in src/bin/*.rs; do FILENAME=$(basename $TARGET) FILE="${FILENAME%.*}" - HFUZZ_RUN_ARGS="--exit_upon_crash -v -n8" - if [ "$FILE" = "chanmon_consistency_target" ]; then - HFUZZ_RUN_ARGS="$HFUZZ_RUN_ARGS -F 64 -N1000" - elif [ "$FILE" = "process_network_graph_target" -o "$FILE" = "full_stack_target" -o "$FILE" = "router_target" -o "$FILE" = "lsps_message_target" ]; then - HFUZZ_RUN_ARGS="$HFUZZ_RUN_ARGS -N10000" - elif [ "$FILE" = "indexedmap_target" ]; then - HFUZZ_RUN_ARGS="$HFUZZ_RUN_ARGS -N100000" - elif [ "$FILE" = "fs_store_target" ]; then - HFUZZ_RUN_ARGS="$HFUZZ_RUN_ARGS -F 64 -N10000" - else - HFUZZ_RUN_ARGS="$HFUZZ_RUN_ARGS -N1000000" + HFUZZ_RUN_ARGS="--exit_upon_crash -v -n8 --run_time 30" + if [ "$FILE" = "chanmon_consistency_target" -o "$FILE" = "fs_store_target" ]; then + HFUZZ_RUN_ARGS="$HFUZZ_RUN_ARGS -F 64" fi export HFUZZ_RUN_ARGS cargo --color always hfuzz run $FILE From fbdb5c5486b73a7addf87d41567a7f02efcb27da Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 27 Oct 2025 21:36:25 +0000 Subject: [PATCH 2/2] Disable `codegen-units = 1` in CI fuzz job This now slows us down as we run our fuzz job on a machine with more than one or two cores. --- fuzz/ci-fuzz.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/fuzz/ci-fuzz.sh b/fuzz/ci-fuzz.sh index d57a5ad78fa..46d9acf3b2e 100755 --- a/fuzz/ci-fuzz.sh +++ b/fuzz/ci-fuzz.sh @@ -26,6 +26,7 @@ cargo install --color always --force honggfuzz --no-default-features # Because we're fuzzing relatively few iterations, the maximum possible # compiler optimizations aren't necessary, so we turn off LTO sed -i 's/lto = true//' Cargo.toml +sed -i 's/codegen-units = 1//' Cargo.toml export HFUZZ_BUILD_ARGS="--features honggfuzz_fuzz"