Closed bhansconnect closed 1 year ago
They generally do the same thing so this is a bit surprising.
You could try logging the commands the cargo fuzz
is executing to see what other flags are getting passed: https://github.com/rust-fuzz/cargo-fuzz/blob/bb2de3ece0564fd8d2410f74837f9d23e602f78d/src/project.rs#L312
Thanks for the hint. I'll take a look and try to do some debugging to figure out the differences.
Oh, figured it out. Your library also uses: -sanitizer-coverage-pc-table
. I missed that. Add that configuration when building my static library and everything is good now.
Hi, this may not exactly be a bug. It may just be some difference in configuration, but I am trying to get to the root of what is going on.
I have a rust app that links with a static library. I am trying to fuzz both together. I compile the static library with fuzzing enable and asan. Then I compile and run a fuzz target with
cargo fuzz run
.I get an output of:
This is probably caused by linking against the static library, but I am not fully sure why. I have tried changing my linker for rust, but it does not change anything.
If instead, I compile the fuzz target directly, as suggested by the
libFuzzer-sys
crate:And then run it directly
./target/debug/fuzz-target
. Everything will run as expected:Any ideas what could be causing the difference here? Would be really useful to able to use
cargo fuzz
to fuzz a rust + static library combination. Maybe there are extra llvm options/passes that should be run when generating the static library. Any pointers in general would be greatly appreciated. Even if it is just to docs about the llvm configuration thatcargo fuzz
uses.