From 198606aab4e5e010aebcc16ca9894ec2d25061f1 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 22 Feb 2024 13:47:01 -0800 Subject: [PATCH 1/2] work --- scripts/fuzz_opt.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py index d3d50b64edf..a7c976eeb4d 100755 --- a/scripts/fuzz_opt.py +++ b/scripts/fuzz_opt.py @@ -462,6 +462,13 @@ def pick_initial_contents(): # --fuzz-exec reports a stack limit using this notation STACK_LIMIT = '[trap stack limit]' +# V8 reports this error in rare cases due to limitations in our handling of non- +# nullable locals in unreachable code, see +# https://github.com/WebAssembly/binaryen/pull/5665 +# https://github.com/WebAssembly/binaryen/issues/5599 +# and also see the --dce workaround below that also links to those issues. +V8_UNINITIALIZED_NONDEF_LOCAL = 'uninitialized non-defaultable local' + # given a call line that includes FUZZ_EXEC_CALL_PREFIX, return the export that # is called @@ -767,7 +774,10 @@ class D8: name = 'd8' def run(self, wasm, extra_d8_flags=[]): - return run_vm([shared.V8, FUZZ_SHELL_JS] + shared.V8_OPTS + extra_d8_flags + ['--', wasm]) + output = run_vm([shared.V8, FUZZ_SHELL_JS] + shared.V8_OPTS + extra_d8_flags + ['--', wasm]) + if 'V8_UNINITIALIZED_NONDEF_LOCAL' in output: + output = ignore + return output def can_run(self, wasm): return True From 2b1bc73bf47edb9edbdc57b439e6df03a15a020b Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 22 Feb 2024 13:49:53 -0800 Subject: [PATCH 2/2] fix --- scripts/fuzz_opt.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py index a7c976eeb4d..171a246d255 100755 --- a/scripts/fuzz_opt.py +++ b/scripts/fuzz_opt.py @@ -642,6 +642,8 @@ def filter_known_issues(output): # strings in this list for known issues (to which more need to be # added as necessary). HOST_LIMIT_PREFIX, + # see comment above on this constant + V8_UNINITIALIZED_NONDEF_LOCAL, ] for issue in known_issues: if issue in output: @@ -774,10 +776,7 @@ class D8: name = 'd8' def run(self, wasm, extra_d8_flags=[]): - output = run_vm([shared.V8, FUZZ_SHELL_JS] + shared.V8_OPTS + extra_d8_flags + ['--', wasm]) - if 'V8_UNINITIALIZED_NONDEF_LOCAL' in output: - output = ignore - return output + return run_vm([shared.V8, FUZZ_SHELL_JS] + shared.V8_OPTS + extra_d8_flags + ['--', wasm]) def can_run(self, wasm): return True