mirror of
https://github.com/logos-blockchain/lez-fuzzing.git
synced 2026-06-07 11:39:30 +00:00
fix: use libFuzz binary to calculate AFL coverage
This commit is contained in:
parent
3d1e355cbf
commit
a87c2e749e
17
.github/workflows/fuzz-afl.yml
vendored
17
.github/workflows/fuzz-afl.yml
vendored
@ -231,10 +231,14 @@ jobs:
|
|||||||
RUSTFLAGS: "-C instrument-coverage"
|
RUSTFLAGS: "-C instrument-coverage"
|
||||||
RISC0_DEV_MODE: "1"
|
RISC0_DEV_MODE: "1"
|
||||||
run: |
|
run: |
|
||||||
|
# Build with the libfuzzer harness: libFuzzer accepts corpus files as
|
||||||
|
# positional arguments, runs each through the fuzz closure once, then
|
||||||
|
# exits — LLVM coverage counters (-C instrument-coverage) are flushed
|
||||||
|
# to the .profraw file on exit regardless of the fuzzer runtime used.
|
||||||
cargo build \
|
cargo build \
|
||||||
--manifest-path fuzz/Cargo.toml \
|
--manifest-path fuzz/Cargo.toml \
|
||||||
--no-default-features \
|
--no-default-features \
|
||||||
--features fuzzer-afl \
|
--features fuzzer-libfuzzer \
|
||||||
--release \
|
--release \
|
||||||
--bin ${{ matrix.target }}
|
--bin ${{ matrix.target }}
|
||||||
|
|
||||||
@ -246,17 +250,10 @@ jobs:
|
|||||||
mkdir -p "$PROFRAW_DIR"
|
mkdir -p "$PROFRAW_DIR"
|
||||||
idx=0
|
idx=0
|
||||||
|
|
||||||
# libFuzzer corpus (checked-in)
|
|
||||||
for f in corpus/libfuzz/${TARGET}/*; do
|
|
||||||
[ -f "$f" ] || continue
|
|
||||||
LLVM_PROFILE_FILE="${PROFRAW_DIR}/${idx}.profraw" "$BINARY" < "$f" 2>/dev/null || true
|
|
||||||
idx=$((idx + 1))
|
|
||||||
done
|
|
||||||
|
|
||||||
# AFL corpus (checked-in, accumulated from prior runs)
|
# AFL corpus (checked-in, accumulated from prior runs)
|
||||||
for f in corpus/afl/${TARGET}/*; do
|
for f in corpus/afl/${TARGET}/*; do
|
||||||
[ -f "$f" ] || continue
|
[ -f "$f" ] || continue
|
||||||
LLVM_PROFILE_FILE="${PROFRAW_DIR}/${idx}.profraw" "$BINARY" < "$f" 2>/dev/null || true
|
LLVM_PROFILE_FILE="${PROFRAW_DIR}/${idx}.profraw" "$BINARY" "$f" 2>/dev/null || true
|
||||||
idx=$((idx + 1))
|
idx=$((idx + 1))
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -266,7 +263,7 @@ jobs:
|
|||||||
[ -d "$QUEUE" ] || continue
|
[ -d "$QUEUE" ] || continue
|
||||||
for f in "$QUEUE"/id:*; do
|
for f in "$QUEUE"/id:*; do
|
||||||
[ -f "$f" ] || continue
|
[ -f "$f" ] || continue
|
||||||
LLVM_PROFILE_FILE="${PROFRAW_DIR}/${idx}.profraw" "$BINARY" < "$f" 2>/dev/null || true
|
LLVM_PROFILE_FILE="${PROFRAW_DIR}/${idx}.profraw" "$BINARY" "$f" 2>/dev/null || true
|
||||||
idx=$((idx + 1))
|
idx=$((idx + 1))
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user