Open ethanstanley3 opened 1 year ago
Probably linked to https://github.com/wasmerio/wasmer/issues/3323 and https://github.com/wasmerio/wasmer/issues/3190
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Describe the bug
Running a specific webassembly module results in non-deterministic wrong code generation between LLVM and LLVM with optimizations enabled. I found that LLVM is consistent with other WebAssembly implementations, including NodeJS.
Steps to reproduce
Here is a zipped rust project to reproduce the bug: load-wasmer.zip
load-wasmer.zip
cargo build
./verify.zsh
, which will run both versions and display the outputsHere are a few outputs I got:
Expected behavior
The displayed checksums should be the same and deterministic.
Actual behavior
The displayed checksums are not the same. The checksum for LLVM/Optimize is non-deterministic.
Here is the textual format of the test case. I have reduced it as much as I can. I have noted with comments lines that cannot be reduced while preserving non-determinism and the wrong code generation. An interesting behavior is that a call to a simple function cannot be inlined.
Additional context
This test case is derived from a program created by Wasmlike, an Xsmith-based random program generator. https://www.flux.utah.edu/project/xsmith