-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Still cannot build project with 'panic = abort' #2738
Comments
Thanks for the report! And yes, hm, indeed, this is a problem! I'll have to noodle on a way to fix this, unfortunately it probably won't be trivial |
@alexcrichton if it's hard to fix, maybe it's easier to detect that problem and tell the user why it's broken and link to this here. That was surprisingly hard to google for and it wastes quite a bit of time. |
Hm let me elaborate on what I'm thinking for this:
My idea for a solution here is to just have a "panic" flag which is set for plugins and all of their dependencies, so even though @mitsuhiko it's probably not really any harder to fix than it is to detect, so just need to find some time to implement this. |
Any good news on this? Basically it blocks |
Fix panic=abort when compiling with plugins Closes #2738
Seems to still be an issue despite the merge/close: Cargo.toml:
The main.rs is just a Hello World program. It yields the same error (error: the linked panic runtime Fails on both 1.12 stable and nightly (144af3e97 2016-10-02). |
@Jragonmiris ah unfortunately that's a bad error message but it's because of The fix here would be to remove |
I have a simple project whose only direct dependency is |
@AaronFriel do you have a |
Would it affect anything that I'm building on Windows? Here's my cargo.toml:
|
Hm even then I wasn't able to reproduce. Could you gist a full build of |
I have reduced the problem to being unable to |
@AaronFriel ah yeah unfortunately |
Sure! I created issue #3166 |
Thanks! |
**Context:** For the fuzzer to be able to "understand" that something went wrong, like a panic, the process must terminate in an abnormal fashion. The default panic hook will unwind the stack, run destructors, optionally print a backtrace and exit with code 101. The fuzzer will not be able to "understand" that something wwnt particuliarly wrong. One way to stop a process in a way that the fuzzer understands as abnormal is to call `std::process::abort()`. **Possible solutions:** - build with "-C panic=abort": incompatible with compiler plugins rust-lang/cargo#2738 (comment) rust-fuzz/afl.rs#120 - use `panic::catch_unwind()` to catch unwinding stacks and call `std::process::abort()`: all kind of bugs will then unwind their stack up to the code calling this function and therefore render different bugs indistinguishable from the fuzzer point of view. - use a custom panic hook and call `std::process::abort()` here. **Implemented solution** We implemented both solution 2 and 3. Solution 3 has no drawbacks that I know of, but could potentially be missed if the fuzzed code modifies the panic hook. In this case, we fall back to solution 2 as a last resort.
**Context:** For the fuzzer to be able to "understand" that something went wrong, like a panic, the process must terminate in an abnormal fashion. The default panic hook will unwind the stack, run destructors, optionally print a backtrace and exit with code 101. The fuzzer will not be able to "understand" that something went particuliarly wrong. One way to stop a process in a way that the fuzzer understands as abnormal is to call `std::process::abort()`. **Possible solutions:** - build with "-C panic=abort": incompatible with compiler plugins rust-lang/cargo#2738 (comment) rust-fuzz/afl.rs#120 - use `panic::catch_unwind()` to catch unwinding stacks and call `std::process::abort()`: all kind of bugs will then unwind their stack up to the code calling this function and therefore render different bugs indistinguishable from the fuzzer's point of view. - use a custom panic hook and call `std::process::abort()` here. **Implemented solution** We implemented both solution 2 and 3. Solution 3 has no drawbacks that I know of, but could potentially be missed if the fuzzed code modifies the panic hook. In this case, we fall back to solution 2 as a last resort.
This time compiler plugins seem to be the culprit
This time adding
doesn't help
Meta:
The text was updated successfully, but these errors were encountered: