Stream: git-wasmtime

Topic: wasmtime / Issue #1433 linking: multiple memories error


view this post on Zulip Wasmtime GitHub notifications bot (Mar 30 2020 at 09:44):

Alphapage opened Issue #1433:

Hello,

I tried this linking example:https://bytecodealliance.github.io/wasmtime/examples-rust-linking.html

I just added a linking3.wat file which is a tweaked copy of linking2.wat and added (import "linking3" "memory" (memory 1)) to linking1.wat.

But I get a multiple memories error. Is it the normal behaviour ? Can I only link 2 modules ?

Thank you in advance for your help.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 30 2020 at 13:34):

tschneidereit commented on Issue #1433:

cc @alexcrichton

view this post on Zulip Wasmtime GitHub notifications bot (Mar 30 2020 at 14:11):

pepyakin commented on Issue #1433:

In the current version of the webassembly spec only one memory per wasm instance is supported, so you basically have three options at the moment:

  1. module imports memory,
  2. module exports memory,
  3. module defines no memory,

there is a pending proposal for lifting this limitation exists: https://github.com/WebAssembly/multi-memory

view this post on Zulip Wasmtime GitHub notifications bot (Mar 30 2020 at 14:59):

alexcrichton commented on Issue #1433:

Thanks for the report! Wasmtime at this time doesn't implement the multi-memory proposal (I'm not actually sure of anything that does myself), and as pointed out by @pepyakin we'd need to implement that all first before more than one memory is allowed.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 30 2020 at 15:13):

Alphapage commented on Issue #1433:

Sorry, my mistake! I was thinking that linking1.wat was using its own memory but it is using the imported one from linking2.wat.
I'm really waiting for multi-memory feature to have dedicated memory to share data between modules using dynamic linking.
Because for now, I think you can't reproduce linking1.wat and linking2.wat in c or rust without corrupting the linear memory which is used to allocate dynamic memory.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 30 2020 at 15:13):

Alphapage closed Issue #1433:

Hello,

I tried this linking example:https://bytecodealliance.github.io/wasmtime/examples-rust-linking.html

I just added a linking3.wat file which is a tweaked copy of linking2.wat and added (import "linking3" "memory" (memory 1)) to linking1.wat.

But I get a multiple memories error. Is it the normal behaviour ? Can I only link 2 modules ?

Thank you in advance for your help.


Last updated: Dec 23 2024 at 12:05 UTC