wasm-micro-runtime icon indicating copy to clipboard operation
wasm-micro-runtime copied to clipboard

Different output compared with other runtimes when running the same wasm file.

Open abc767234318 opened this issue 9 months ago • 1 comments

I constructed a wasm binary with many exported function. I used the following command and compared the outputs of WAMR with other runtimes.

filea202224.zip

wasmtime compile filea202224.wasm
wasmer compile -o filea202224.aot  filea202224.wasm
wamrc -o filea202224.aot filea202224.wasm
wasmedge compile filea202224.wasm  filea202224.aot

The outputs of WAMR are different from other runtimes. The outputs are as follows:

-----------------wasmtime-----------------

-----------------wasmer-----------------
warning: the output file has a wrong extension. We recommend using `filea202224.wasmu` for the chosen target
Compiler: cranelift
Target: x86_64-unknown-linux-gnu
✔ File compiled successfully to `filea202224.aot`.
-----------------wamr-----------------
WASM module load failed: duplicate export name

-----------------wasmedge-----------------
[2023-11-19 20:39:52.263] [info] compile start
[2023-11-19 20:39:52.268] [info] verify start
[2023-11-19 20:39:52.270] [info] optimize start
[2023-11-19 20:39:52.350] [info] codegen start
[2023-11-19 20:39:52.419] [info] output start
[2023-11-19 20:39:52.423] [info] compile done
[2023-11-19 20:39:52.424] [info] output start

I have analyzed it and I think the error may occurred at line 8970 and line 8971 of its wat file. image

abc767234318 avatar Nov 19 '23 12:11 abc767234318

thanks for reporting it. ~pleas try again with https://github.com/bytecodealliance/wasm-micro-runtime/pull/2806~. We might set a limitation on import names and exports, please join the discussion in #2806

lum1n0us avatar Nov 21 '23 07:11 lum1n0us