Missing validation error
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- wasm
- Domain
- compilers
Research direction
Unpack jj.tar.gz and reproduce the V8 validation error with pkg/dart2wasm/bin/run_wasm.js, jj.mjs, and jj.wasm. Compare wasm-opt's handling of the shown unreachable WAT sequence with V8's validation, and add or update a regression test so the tools agree on whether this module is valid.
Written by the indexing model from the issue text.
Description
See jj.tar.gz.
Unpack via:
% tar xvzf jj.tar.gz
...
When running with V8 we get a validation error:
% d8 $PWD/pkg/dart2wasm/bin/run_wasm.js -- $PWD/jj.mjs $PWD/jj.wasm
run_wasm.js:346: CompileError: WebAssembly.compile(): Compiling function #181:"main" failed: not enough arguments on the stack for drop (need 1, got 0) @+25996
}
^
CompileError: WebAssembly.compile(): Compiling function #181:"main" failed: not enough arguments on the stack for drop (need 1, got 0) @+25996
1 pending unhandled Promise rejection(s) detected.
Though optimizing with wasm-opt works fine and the result runs:
% wasm-opt --enable-gc --enable-reference-types --enable-multivalue --enable-exception-handling --enable-nontrapping-float-to-int --enable-sign-ext --enable-bulk-memory --enable-threads --enable-simd '--no-inline=*<noInline>*' --traps-never-happen -g -Os --gufa -Os -Os jj.wasm -o jj.wasm
% d8 $PWD/pkg/dart2wasm/bin/run_wasm.js -- $PWD/jj.mjs $PWD/jj.wasm
%
Is wasm-opt not supposed to issue a validation error here as well? (even though the corresponding code is unreachable)
local.get $reporter
drop
drop
block $label2
unreachable
end
drop
- Dominant language
- WebAssembly
- Stars
- 8.6k
- Forks
- 885
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 77
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from WebAssembly/binaryen
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
WebAssembly/binaryen#9135 · 1 comment ·
-
Difficulty 2/5 Half a day Newbie friendliness 76/100
WebAssembly/binaryen#9018 · 3 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
WebAssembly/binaryen#9133 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
WebAssembly/binaryen#9123 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
WebAssembly/binaryen#9122 ·
All issues in WebAssembly/binaryen
Similar issues
-
flang:fir-hlfir
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
llvm/llvm-project#225935 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
objectionary/eo#8923 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Coarray integration tests carry no LABELS, so run_tests.py silently skips them under every backend Opencoarray
Difficulty 2/5 1-3 hours Newbie friendliness 70/100