fuzz: Update honggfuzz and rust version required (#3563)

This commit is contained in:
Jon Cinque 2022-09-01 19:36:47 +02:00 committed by GitHub
parent 7e2a048045
commit 07d14e948a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 20 deletions

17
Cargo.lock generated
View File

@ -1886,13 +1886,14 @@ dependencies = [
[[package]] [[package]]
name = "honggfuzz" name = "honggfuzz"
version = "0.5.54" version = "0.5.55"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bea09577d948a98a5f59b7c891e274c4fb35ad52f67782b3d0cb53b9c05301f1" checksum = "848e9c511092e0daa0a35a63e8e6e475a3e8f870741448b9f6028d69b142f18e"
dependencies = [ dependencies = [
"arbitrary", "arbitrary",
"lazy_static", "lazy_static",
"memmap", "memmap2",
"rustc_version",
] ]
[[package]] [[package]]
@ -2470,16 +2471,6 @@ version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
[[package]]
name = "memmap"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b"
dependencies = [
"libc",
"winapi 0.3.9",
]
[[package]] [[package]]
name = "memmap2" name = "memmap2"
version = "0.5.3" version = "0.5.3"

View File

@ -3,7 +3,11 @@
set -e set -e
cd "$(dirname "$0")/.." cd "$(dirname "$0")/.."
source ./ci/rust-version.sh nightly # honggfuzz uses a newer version of arbitrary, which requires a newer version of Rust
# Once SPL upgrades to Rust 1.63.0, look into removing version specification
RUST_STABLE_VERSION=1.63.0 source ./ci/rust-version.sh stable
cargo +"$rust_stable" install honggfuzz --version=0.5.55 --force || true
usage() { usage() {
exitcode=0 exitcode=0
@ -25,10 +29,7 @@ if [[ -z $2 ]]; then
usage "No runtime provided" usage "No runtime provided"
fi fi
# Temporary workaround using RUSTFLAGS and rust nightly due to: HFUZZ_RUN_ARGS="--run_time $run_time --exit_upon_crash" cargo +"$rust_stable" hfuzz run $fuzz_target
# https://github.com/rust-fuzz/honggfuzz-rs/issues/61
# Once the issue is resolved, remove the RUSTFLAGS and nightly usage everywhere.
RUSTFLAGS="-Znew-llvm-pass-manager=no" HFUZZ_RUN_ARGS="--run_time $run_time --exit_upon_crash" cargo +"$rust_nightly" hfuzz run $fuzz_target
# Until https://github.com/rust-fuzz/honggfuzz-rs/issues/16 is resolved, # Until https://github.com/rust-fuzz/honggfuzz-rs/issues/16 is resolved,
# hfuzz does not return an error code on crash, so look for a crash artifact # hfuzz does not return an error code on crash, so look for a crash artifact

View File

@ -9,6 +9,5 @@ set -x
cargo --version cargo --version
cargo install rustfilt || true cargo install rustfilt || true
cargo install honggfuzz --version=0.5.54 --force || true
cargo +"$rust_stable" build-sbf --version cargo +"$rust_stable" build-sbf --version

View File

@ -9,7 +9,7 @@ edition = "2018"
publish = false publish = false
[dependencies] [dependencies]
honggfuzz = { version = "0.5.54" } honggfuzz = { version = "0.5.55" }
arbitrary = { version = "1.0", features = ["derive"] } arbitrary = { version = "1.0", features = ["derive"] }
solana-program = "1.11.6" solana-program = "1.11.6"
spl-math = { version = "0.1", path = "../../../libraries/math", features = [ "no-entrypoint" ] } spl-math = { version = "0.1", path = "../../../libraries/math", features = [ "no-entrypoint" ] }