wasmer icon indicating copy to clipboard operation
wasmer copied to clipboard

Can only execute with same engine that was used to deserialize

Open chipshort opened this issue 1 year ago • 3 comments

Describe the bug

When deserializing / compiling a module with one engine and then trying to execute it with a different engine, the execution fails with a HeapAccessOutOfBounds runtime error.

wasmer = { version = "3.3.0", features = ["singlepass"] }

rustc 1.68.2 (9eb3afe9e 2023-03-27)
binary: rustc
commit-hash: 9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0
commit-date: 2023-03-27
host: aarch64-apple-darwin
release: 1.68.2
LLVM version: 15.0.6

Steps to reproduce

I created a small example. The repo also contains the code for the wasm, but that's literally just a single function that returns 0. Just clone and cargo run

Expected behavior

If this is intended behaviour, it should be documented (or ideally be caught somehow, with a better error message). If this is not intended, the code in the example should just work and produce a value of 0

Actual behavior

The example code fails with a HeapAccessOutOfBounds in the commented line.

Additional context

This is a follow-up of the discussion in #3829

chipshort avatar May 22 '23 08:05 chipshort