rust-fuzz / libfuzzer

Rust bindings and utilities for LLVM’s libFuzzer
Apache License 2.0
208 stars 44 forks source link

Upgrade libfuzzer for LLVM 6.0 #30

Closed nagisa closed 6 years ago

nagisa commented 6 years ago

This PR pulls in the changes to libfuzzer, at commit https://github.com/llvm-mirror/compiler-rt/commit/cc0ab3fcf3c94169afdb905f02597cd9dead30ff.

My observation is that this works just fine with current state of affairs. That is, given a:

$ rustc -Cllvm-args=-version
LLVM (http://llvm.org/):
  LLVM version 6.0.0
  Optimized build.
  Default target: x86_64-unknown-linux-gnu
  Host CPU: znver1

The following command, when run within the both of the example folders in this repository work "just" fine (should also be confirmed by the CI), which somewhat counteracts observations made in #29, that libfuzzer cannot work with sanitizers anymore (quite the contrary, it seems that sanitizers are still required).

cargo rustc --release -- -Cpasses=sancov -Cllvm-args=-sanitizer-coverage-level=4 -Cllvm-args=-sanitizer-coverage-trace-compares -Cpanic=abort -Cllvm-args=-sanitizer-coverage-trace-divs -Cllvm-args=-sanitizer-coverage-trace-geps -Cllvm-args=-sanitizer-coverage-prune-blocks=0 -Zsanitizer=address

If I remember correctly, cargo-fuzz generates fuzz targets with this git repository as a dependency. This means that all these fuzz targets will possibly break for people using older compilers once we upgrade, however not upgrading libfuzzer-sys will(?) break people using the new nightly.

While our compatibility story is, I believe, that we support only the current nightly without any real back or forward compatibility, this might be a good time to think about how we want to go about our versioning and release flow. Perhaps we’ll be able to find some way that does not break everybody’s fuzz targets every time LLVMup happens.

Fixes https://github.com/rust-fuzz/libfuzzer-sys/issues/29

r? @frewsxcv or @Manishearth cc @PaulGrandperrin

PaulGrandperrin commented 6 years ago

When I built my first version of rustc with llvm6 I forgot to enable the sanitizers in the config.toml so that's why sanitizers weren't working for me. Maybe that also explains why compiling without sanitizers was working fine for me, but I doubt it. I'll try again with libFuzzer, but honggfuzz works well with and without sanitizers on llvm4 and llvm6 (this nightly).

frewsxcv commented 6 years ago

bors r+

bors[bot] commented 6 years ago

Build succeeded