Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Important fix: make fuzzer able to tell different bugs appart (again)
**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.
- Loading branch information