Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade libfuzzer for LLVM 6.0 #30

Merged
merged 2 commits into from
Feb 18, 2018
Merged

Upgrade libfuzzer for LLVM 6.0 #30

merged 2 commits into from
Feb 18, 2018

Conversation

nagisa
Copy link
Member

@nagisa nagisa commented Feb 11, 2018

This PR pulls in the changes to libfuzzer, at commit llvm-mirror/compiler-rt@cc0ab3f.

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

This updates the CI tests with flags that are currently used by the
cargo-fuzz to give better confidence about stuff working properly.
@PaulGrandperrin
Copy link
Member

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).

Copy link
Member

@frewsxcv frewsxcv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for looking into this @nagisa, i really appreciate it 🙇

i just confirmed that libfuzzer-sys doesn't work with the latest nightlies (w/ llvm 6), and then specified this branch in my cargo.toml and everything works again! so here's a ✅

@frewsxcv
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request Feb 18, 2018
30: Upgrade libfuzzer for LLVM 6.0 r=frewsxcv a=nagisa

This PR pulls in the changes to libfuzzer, at commit llvm-mirror/compiler-rt@cc0ab3f.

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
@bors
Copy link
Contributor

bors bot commented Feb 18, 2018

Build succeeded

@bors bors bot merged commit 08b7053 into master Feb 18, 2018
@frewsxcv frewsxcv deleted the llvmup branch February 18, 2018 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants