Merge rust-bitcoin/rust-bitcoin#1219: Revert "Temporarily disable fuzzing"

d25aba8ca0 fuzz: use travis-fuzz.sh in CI (Andrew Poelstra)
407cbca111 fuzz: remove mysteriously-not-necessary quotes from gh action script (Andrew Poelstra)
0a32525862 fuzz: disable features in honggfuzz (Andrew Poelstra)
c7910f4561 Revert "Temporarily disable fuzzing" (Andrew Poelstra)

Pull request description:

  This reverts commit 720ea29865.

  There is a new version of honggfuzz out. Maybe things work now.

ACKs for top commit:
  sanket1729:
    utACK d25aba8ca0
  tcharding:
    ACK d25aba8ca0

Tree-SHA512: d9d5cb89e5bcacfdd84bf293267ee558cffed4454908add9b6c4a172d3d06404564d1bb8c3f59f29a621369b901a9cdf31b8229b299320ac061f378a73bfa80c
This commit is contained in:
Andrew Poelstra 2022-08-31 14:56:20 +00:00
commit 24b9b419e5
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
3 changed files with 15 additions and 11 deletions

View File

@ -1,15 +1,12 @@
name: Fuzz
# Temporarily disable job until someone works out how to fix honggfuzz.
on: []
on: [push, pull_request]
jobs:
fuzz:
if: ${{ !github.event.act }}
runs-on: ubuntu-20.04
env:
HFUZZ_BUILD_ARGS: "--features honggfuzz_fuzz"
strategy:
fail-fast: false
matrix:
@ -31,11 +28,8 @@ jobs:
toolchain: 1.58
override: true
profile: minimal
- run: cargo install honggfuzz
if: steps.cache-fuzz.outputs.cache-hit != 'true'
- run: echo "HFUZZ_RUN_ARGS=\"--run_time 30 --exit_upon_crash -v -f hfuzz_input/${{ matrix.fuzz_target }}/input\"" >> $GITHUB_ENV
- name: fuzz
run: cd fuzz && cargo hfuzz run ${{ matrix.fuzz_target }}
run: cd fuzz && ./travis-fuzz.sh "${{ matrix.fuzz_target }}"
- run: echo "${{ matrix.fuzz_target }}.rs" >executed_${{ matrix.fuzz_target }}
- uses: actions/upload-artifact@v2
with:

View File

@ -12,7 +12,7 @@ afl_fuzz = ["afl"]
honggfuzz_fuzz = ["honggfuzz"]
[dependencies]
honggfuzz = { version = "0.5", optional = true }
honggfuzz = { version = "0.5", optional = true, default-features = false }
afl = { version = "0.4", optional = true }
bitcoin = { path = ".." }

View File

@ -8,9 +8,19 @@ if [ ${incorrectFilenames} -gt 0 ]; then
exit 2
fi
if [ "$1" == "" ]; then
TARGETS=fuzz_targets/*
else
TARGETS=fuzz_targets/"$1".rs
fi
cargo --version
rustc --version
# Testing
cargo install --force honggfuzz
for TARGET in fuzz_targets/*; do
cargo install --force honggfuzz --no-default-features
for TARGET in $TARGETS; do
echo "Fuzzing target $TARGET"
FILENAME=$(basename $TARGET)
FILE="${FILENAME%.*}"
if [ -d hfuzz_input/$FILE ]; then