WAMR (iwasm): Rejects valid empty (rec) groups
Reproducer
wasm-tools parse test.wat -o test.wasm
iwasm test.wasm
# WASM module load failed: unknown type 0
Expected
Empty rec groups (0x4E 0x00 — rec group with zero members) are valid per
the Wasm GC spec. The grammar is rectype ::= 0x4E n:u32 subtype^n where
n=0 is a legal count.
Other runtimes
| Runtime |
Result |
| wasm-tools validate |
valid |
| V8/d8 |
valid |
| WasmEdge |
valid |
| iwasm (WAMR) |
rejected |
Notes
The error number in "unknown type N" is the rec group index where the
empty (rec) appears:
(module (rec)) → unknown type 0
(module (type (func)) (rec)) → unknown type 1
(module (type (func)) (type (func)) (rec)) → unknown type 2
Acknowledgement
This bug has been found during development process of GCsmith.
MORE INFO WILL BE ADDED ABOUT ACKNOWLEDGEMENT
WAMR (iwasm): Rejects valid empty
(rec)groupsReproducer
(module (rec))wasm-tools parse test.wat -o test.wasm iwasm test.wasm # WASM module load failed: unknown type 0Expected
Empty rec groups (
0x4E 0x00— rec group with zero members) are valid perthe Wasm GC spec. The grammar is
rectype ::= 0x4E n:u32 subtype^nwheren=0is a legal count.Other runtimes
Notes
The error number in
"unknown type N"is the rec group index where theempty
(rec)appears:Acknowledgement
This bug has been found during development process of
GCsmith.MORE INFO WILL BE ADDED ABOUT ACKNOWLEDGEMENT