From a4df8d32d9023ae0c918d83ad0cf01ca6767f812 Mon Sep 17 00:00:00 2001 From: Takeshi Yoneda Date: Tue, 31 Oct 2023 08:35:42 +0900 Subject: [PATCH] fuzz: ignore out of fuel vs stack overflow diff (#1822) Signed-off-by: Takeshi Yoneda --- internal/integration_test/fuzz/wazerolib/nodiff.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/integration_test/fuzz/wazerolib/nodiff.go b/internal/integration_test/fuzz/wazerolib/nodiff.go index 6ee4768b85..2ced68f88c 100644 --- a/internal/integration_test/fuzz/wazerolib/nodiff.go +++ b/internal/integration_test/fuzz/wazerolib/nodiff.go @@ -379,10 +379,16 @@ func ensureInstantiationError(compilerErr, interpErr error) (okToInvoke bool, er interpErrMsg = interpErrMsg[:strings.Index(interpErrMsg, "\n")] } + if strings.Contains(compilerErrMsg, "stack overflow") && strings.Contains(interpErrMsg, "unreachable") { + // This is the case where the compiler reached stack overflow, but the interpreter reached the unreachable out of "fuel" during + // start function invocation. This is fine. + return false, nil + } + if !allowedErrorDuringInstantiation(compilerErrMsg) { - return false, fmt.Errorf("invalid error occur with compiler: %v", compilerErr) + return false, fmt.Errorf("invalid error occur with compiler: %v vs interpreter: %v", compilerErr, interpErr) } else if !allowedErrorDuringInstantiation(interpErrMsg) { - return false, fmt.Errorf("invalid error occur with interpreter: %v", interpErrMsg) + return false, fmt.Errorf("invalid error occur with interpreter: %v vs compiler: %v", interpErr, compilerErr) } if compilerErrMsg != interpErrMsg {