rust-fuzz / honggfuzz-rs

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

Rust 1.30 broke honggfuzz builds #14

Closed TheBlueMatt closed 5 years ago

TheBlueMatt commented 5 years ago

(at least on travis). See, eg, build at https://travis-ci.org/rust-bitcoin/rust-lightning/jobs/446288104 which fails with "note: /usr/bin/ld: sancov_guards has both ordered [`__sancov_guards' in /home/travis/build/rust-bitcoin/rust-lightning/fuzz/hfuzz_target/x86_64-unknown-linux-gnu/release/deps/chanmon_deser_target-b3cbf469215400a7.chanmon_deser_target.7gmhrznz-cgu.1.rcgu.o] and unordered [`sancov_guards' in /home/travis/build/rust-bitcoin/rust-lightning/fuzz/hfuzz_target/x86_64-unknown-linux-gnu/release/deps/chanmon_deser_target-b3cbf469215400a7.chanmon_deser_target.7gmhrznz-cgu.1.rcgu.o] sections"

TheBlueMatt commented 5 years ago

I guess this is https://github.com/rust-lang/rust/issues/53945 but it doesnt appear to work on 0.5.30, which judging from git commit logs it should?

PaulGrandperrin commented 5 years ago

Hi @TheBlueMatt , thanks for the report. It does look like this is rust-lang/rust#53945, so the current workaround is to use RUSTFLAGS="-Clink-arg=-fuse-ld=gold" (https://github.com/rust-lang/rust/issues/53945#issuecomment-426824324).

As of honggfuzz-rs:0.5.30, there is a commit in the git history that tried to apply this workaround when needed (https://github.com/rust-fuzz/honggfuzz-rs/commit/7f4cdb98016bdf770135370def1095acc6865e78) but the patch wasn't working properly so I reverted it and only applied the workaround to my test script (https://github.com/rust-fuzz/honggfuzz-rs/commit/364475952289006390f89d63bf68899c9aee69e0).

TL;DR: The workaround is only present in this project test suite, but not applied to projects using it.

I'll look into fixing that this weekend, in the meantime, you can use the RUSTFLAGS environment variable if you need to.