rust-fuzz / honggfuzz-rs

Fuzz your Rust code with Google-developed Honggfuzz !
https://crates.io/crates/honggfuzz
Apache License 2.0
448 stars 40 forks source link

`failed to run LLVM passes: unknown pass name 'sancov'` when running hfuzz with rustc 1.57.0 #61

Closed danielabrozzoni closed 2 years ago

danielabrozzoni commented 2 years ago

Hi, I'm having troubles running hfuzz in a CI environment. The error I'm getting:

RUST_BACKTRACE="full" HFUZZ_RUN_ARGS="--exit_upon_crash --iterations 10000 -v --timeout 2 --input coordinatord_fuzz_corpus" cargo hfuzz run send_msg && cd ..
/usr/bin/ld.gold
    Updating crates.io index
    Updating git repository `https://github.com/revault/revault_net`
    Updating git repository `https://github.com/revault/revault_tx`
 Downloading crates ...
  Downloaded block-buffer v0.9.0
  Downloaded lazy_static v1.4.0
  Downloaded log v0.4.14
  Downloaded futures-executor v0.3.17
  Downloaded futures-core v0.3.17
  Downloaded getrandom v0.2.3
  Downloaded ed25519 v1.2.0
  Downloaded crypto-mac v0.10.1
  Downloaded instant v0.1.11
  Downloaded ppv-lite86 v0.2.10
  Downloaded subtle v2.4.1
  Downloaded stringprep v0.1.2
  Downloaded socket2 v0.4.2
  Downloaded semver v0.9.0
  Downloaded opaque-debug v0.3.0
  Downloaded num-integer v0.1.44
  Downloaded num-traits v0.2.14
  Downloaded parking_lot_core v0.8.5
  Downloaded parking_lot v0.11.2
  Downloaded proc-macro-nested v0.1.7
  Downloaded proc-macro-hack v0.5.19
  Downloaded pin-project-lite v0.2.7
  Downloaded unicode-bidi v0.3.6
  Downloaded byteorder v1.4.3
  Downloaded cpufeatures v0.2.1
  Downloaded cc v1.0.70
  Downloaded futures-task v0.3.17
  Downloaded futures-channel v0.3.17
  Downloaded chrono v0.4.19
  Downloaded version_check v0.9.3
  Downloaded same-file v1.0.6
  Downloaded serde_derive v1.0.130
  Downloaded time v0.1.43
  Downloaded walkdir v2.3.2
  Downloaded tokio-macros v1.3.0
  Downloaded tokio-util v0.6.8
  Downloaded lock_api v0.4.5
  Downloaded pkg-config v0.3.20
  Downloaded postgres-types v0.2.1
  Downloaded dirs v3.0.2
  Downloaded scopeguard v1.1.0
  Downloaded signature v1.3.1
  Downloaded sha2 v0.9.8
  Downloaded miniscript v6.0.1
  Downloaded semver-parser v0.7.0
  Downloaded rand_core v0.5.1
  Downloaded typenum v1.14.0
  Downloaded unicode-normalization v0.1.19
  Downloaded toml v0.5.8
  Downloaded rand v0.8.4
  Downloaded syn v1.0.77
  Downloaded num_cpus v1.13.0
  Downloaded smallvec v1.6.1
  Downloaded serde_json v1.0.68
  Downloaded revault_tx v0.3.0
  Downloaded proc-macro2 v1.0.29
  Downloaded secp256k1-sys v0.4.1
  Downloaded tinyvec v1.5.0
  Downloaded tokio-postgres v0.7.2
  Downloaded secp256k1 v0.20.3
  Downloaded postgres-protocol v0.6.1
  Downloaded snow v0.7.2
  Downloaded fern v0.5.9
  Downloaded bitcoin v0.27.1
  Downloaded rustc_version v0.2.3
  Downloaded phf v0.8.0
  Downloaded percent-encoding v2.1.0
  Downloaded bitcoin_hashes v0.10.0
  Downloaded bech32 v0.8.1
  Downloaded phf_shared v0.8.0
  Downloaded slab v0.4.4
  Downloaded siphasher v0.3.7
  Downloaded md-5 v0.9.1
  Downloaded futures-util v0.3.17
  Downloaded futures-io v0.3.17
  Downloaded tokio v1.12.0
  Downloaded tinyvec_macros v0.1.0
  Downloaded daemonize-simple v0.1.5
  Downloaded unicode-xid v0.2.2
  Downloaded ryu v1.0.5
  Downloaded serde v1.0.130
  Downloaded rand_core v0.6.3
  Downloaded quote v1.0.9
  Downloaded rand_chacha v0.3.1
  Downloaded futures-sink v0.3.17
  Downloaded dirs-sys v0.3.6
  Downloaded digest v0.9.0
  Downloaded bytes v1.1.0
  Downloaded sodiumoxide v0.2.7
  Downloaded base64 v0.13.0
  Downloaded async-trait v0.1.51
  Downloaded autocfg v1.0.1
  Downloaded mio v0.7.13
  Downloaded pin-utils v0.1.0
  Downloaded itoa v0.4.8
  Downloaded hmac v0.10.1
  Downloaded generic-array v0.14.4
  Downloaded futures-macro v0.3.17
  Downloaded futures v0.3.17
  Downloaded cfg-if v1.0.0
  Downloaded memchr v2.4.1
  Downloaded libc v0.2.103
  Downloaded fallible-iterator v0.2.0
  Downloaded libsodium-sys v0.2.7
  Downloaded bitcoinconsensus v0.19.0-3
   Compiling libc v0.2.103
   Compiling proc-macro2 v1.0.29
   Compiling unicode-xid v0.2.2
   Compiling syn v1.0.77
   Compiling autocfg v1.0.1
   Compiling cc v1.0.70
   Compiling cfg-if v1.0.0
error: failed to run LLVM passes: unknown pass name 'sancov'

error: could not compile `cfg-if` due to previous error
warning: build failed, waiting for other jobs to finish...
error: build failed
Error: Process completed with exit code 101.

OS: Github Actions with ubuntu-latest rustc version: rustc 1.57.0-nightly (05044c2e6 2021-09-26) cargo version: cargo 1.57.0-nightly (0121d66aa 2021-09-22).

I think the culprit is the rustc version, I can reproduce locally using rustc 1.57, but everything works correctly when I use rustc 1.53.

fgsch commented 2 years ago

Workaround and potential fix: https://github.com/rust-fuzz/afl.rs/issues/192

syheliel commented 2 years ago

error still exists if not adding RUSTFLAGS="-Znew-llvm-pass-manager=no"

PaulGrandperrin commented 2 years ago

@syheliel @fgsch @danielabrozzoni after a long while, I'm back to maintaining honggfuzz-rs!

I merged #63 which use sancov-module instead of disabling the new pass manager, if someone thinks it's not the best fix, don't hesitate to tell me :)

vivekvpandya commented 8 months ago

@syheliel @fgsch @danielabrozzoni after a long while, I'm back to maintaining honggfuzz-rs!

I merged #63 which use sancov-module instead of disabling the new pass manager, if someone thinks it's not the best fix, don't hesitate to tell me :)

@PaulGrandperrin how you find out that with new-pass manager sancov-module will work?