Skip to content

Commit b93b1d6

Browse files
committed
Update CI fuzzing to use hard-coded full_stack seeds
This should materially improve our fuzzing coverage in CI.
1 parent 2d05ff3 commit b93b1d6

File tree

6 files changed

+665
-621
lines changed

6 files changed

+665
-621
lines changed

.github/workflows/build.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,12 @@ jobs:
262262
sudo apt-get -y install build-essential binutils-dev libunwind-dev
263263
- name: Pin the regex dependency
264264
run: |
265-
cd fuzz && cargo update -p regex --precise "1.9.6" --verbose && cd ..
265+
cd fuzz && cargo update -p regex --precise "1.9.6" --verbose
266+
cd write-seeds && cargo update -p regex --precise "1.9.6" --verbose
266267
- name: Sanity check fuzz targets on Rust ${{ env.TOOLCHAIN }}
267268
run: |
268269
cd fuzz
269-
RUSTFLAGS="--cfg=fuzzing --cfg=secp256k1_fuzz --cfg=hashes_fuzz" cargo test --verbose --color always
270+
RUSTFLAGS="--cfg=fuzzing --cfg=secp256k1_fuzz --cfg=hashes_fuzz" cargo test --verbose --color always --lib --bins
270271
cargo clean
271272
- name: Run fuzzers
272273
run: cd fuzz && ./ci-fuzz.sh && cd ..

fuzz/ci-fuzz.sh

+8-1
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,17 @@ rm *_target.rs
1313
[ "$(git diff)" != "" ] && exit 1
1414
popd
1515

16+
export RUSTFLAGS="--cfg=secp256k1_fuzz --cfg=hashes_fuzz"
17+
18+
mkdir -p hfuzz_workspace/full_stack_target/input
19+
pushd write-seeds
20+
RUSTFLAGS="$RUSTFLAGS --cfg=fuzzing" cargo run ../hfuzz_workspace/full_stack_target/input
21+
popd
22+
1623
cargo install --color always --force honggfuzz --no-default-features
1724
sed -i 's/lto = true//' Cargo.toml
25+
sed -i 's/codegen-units = 1//' Cargo.toml
1826

19-
export RUSTFLAGS="--cfg=secp256k1_fuzz --cfg=hashes_fuzz"
2027
export HFUZZ_BUILD_ARGS="--features honggfuzz_fuzz"
2128

2229
cargo --color always hfuzz build

0 commit comments

Comments
 (0)