From 6e9da94e43c2fbe1ae86392223d001759e01692b Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 7 Mar 2022 11:35:26 -0600 Subject: [PATCH] Relax restrictions in the differential fuzzer (#3890) If either end stack overflows we can't validate the other side since the other side, depending on codegen settings, may have been successful, hit a different trap, or also stack overflowed. --- crates/fuzzing/src/oracles.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/fuzzing/src/oracles.rs b/crates/fuzzing/src/oracles.rs index 7f88c61dc5..d5bc0ce18d 100644 --- a/crates/fuzzing/src/oracles.rs +++ b/crates/fuzzing/src/oracles.rs @@ -404,6 +404,13 @@ pub fn differential_execution( }; match (lhs, rhs) { + // Different compilation settings can lead to different amounts + // of stack space being consumed, so if either the lhs or the rhs + // hit a stack overflow then we discard the result of the other side + // since if it ran successfully or trapped that's ok in both + // situations. + (Err(e), _) | (_, Err(e)) if e.trap_code() == Some(TrapCode::StackOverflow) => {} + (Err(a), Err(b)) => { if a.trap_code() != b.trap_code() { fail();