Open sjamesr opened 20 hours ago
Please see the discussion at https://github.com/WebAssembly/spec/pull/1753#issuecomment-2394262819.
Nick recommends removing the non-standard memory size handling and instead implementing the custom-page-sizes proposal.
Has this been discussed before? Is there any interest in incorporating this into WAMR?
WAMR fails memory spec test at HEAD
Recently, the spec tests were updated to add a new test case asserting that
__heap_base
and other global exports do not affect memory accesses. WAMR fails this test and I'm trying to understand why.Test case
Apply the following patch and run the spec tests:
Run the test with
./test_wamr.sh -s spec -m x86_64 -t classic-interp
or something similar.Your environment
Expected behavior
The upstream patch indicates that engines should ignore the
__data_end
,__stack_top
and__heap_base
exports. I'm new to WASM, I could not find anything in the official spec to indicate what (if anything) the engine should do with these.To me, either the WAMR engine implementation is wrong, or the spec tests are wrong.
Actual behavior
The tests fail with out-of-bounds memory access, because the WAMR loader uses these global module exports to set the heap size.