-
Notifications
You must be signed in to change notification settings - Fork 48
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
Compatibility with LLVM6.0 on soon-to-be-release nightly #29
Comments
We only support the current nightly, so this will get updated whenever a nightly with LLVM 6.0 happens. Originally sanitizers were included only because they were required for fuzzing, however if they aren’t anymore, there’s less of the need to actually include sanitizer support with |
I'm reporting this in advance because the upgrade to libFuzzer6.0 with support for sanitizer is non-trivial and might take time. |
For info here is a segfault using libfuzzer6.0 and libasan6.0:
and the same segfault without any sanitizers:
|
I think ThinLTO broke sanitizer and it's still a non-workaroundable problem. Was there any changes since rust-lang/rust#45220? |
Update: The rust LLVM6.0 PR merged 11 hours ago rust-lang/rust#47828 |
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
Rustc will very soon merge it's shinny new LLVM6.0 backend rust-lang/rust#47828.
It will break fuzzing with current libfuzzer because the generated coverage intrumentation will expect new symbols to be implemented by the linked fuzzer implementation.
The current libfuzzer in libfuzzer-sys is 4.0 and is missing those new symbols.
Upgrading libfuzzer source code to 6.0 while disabling sanitizers works well and is compatible with compiler using LLVM4.0 (so the transition will be easy).
However, begin able to compile with sanitizer enabled will need more work: for instance, to make
sanitizer=address
work, we will probably need to first package asanThe text was updated successfully, but these errors were encountered: