Stream: git-wasmtime

Topic: wasmtime / Issue #1658 --enable-threads does not enable s...


view this post on Zulip Wasmtime GitHub notifications bot (May 05 2020 at 13:37):

RReverser labeled Issue #1658:

I'm using Wasmtime 0.16.0.

I've noticed that, even with, --enable-threads, Wasmtime fails to parse modules defining shared memories, e.g.: https://github.com/GoogleChromeLabs/wasm-feature-detect/blob/master/src/detectors/threads/module.wat

(module
  (memory 1 1 shared)
  (func
    i32.const 0
    i32.atomic.load
    drop
  )
)

results in:

Caused by:
    0: failed directive on C:\Users\rreverser\Projects\wasm-feature-detect\src\detectors\threads\module.wat:5:1
    1: WebAssembly failed to compile
    2: WebAssembly translation error
    3: Unsupported feature: shared memories

While I know this feature is experimental and currently not very useful in Wasmtime, it seems unexpected because the comment for enable_threads suggests this should work at this flag enables shared memory and atomics:

https://github.com/bytecodealliance/wasmtime/blob/c284ffe6c036b8058228d576c46688968629b48c/crates/api/src/runtime.rs#L145-L147

view this post on Zulip Wasmtime GitHub notifications bot (May 05 2020 at 13:37):

RReverser opened Issue #1658:

I'm using Wasmtime 0.16.0.

I've noticed that, even with, --enable-threads, Wasmtime fails to parse modules defining shared memories, e.g.: https://github.com/GoogleChromeLabs/wasm-feature-detect/blob/master/src/detectors/threads/module.wat

(module
  (memory 1 1 shared)
  (func
    i32.const 0
    i32.atomic.load
    drop
  )
)

results in:

Caused by:
    0: failed directive on C:\Users\rreverser\Projects\wasm-feature-detect\src\detectors\threads\module.wat:5:1
    1: WebAssembly failed to compile
    2: WebAssembly translation error
    3: Unsupported feature: shared memories

While I know this feature is experimental and currently not very useful in Wasmtime, it seems unexpected because the comment for enable_threads suggests this should work at this flag enables shared memory and atomics:

https://github.com/bytecodealliance/wasmtime/blob/c284ffe6c036b8058228d576c46688968629b48c/crates/api/src/runtime.rs#L145-L147

view this post on Zulip Wasmtime GitHub notifications bot (May 05 2020 at 13:47):

bjorn3 commented on Issue #1658:

Atomics are not implemented by Cranelift at all.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 03 2021 at 22:42):

programmerjake commented on Issue #1658:

Atomics are not implemented by Cranelift at all.

they've since been implemented. https://github.com/bytecodealliance/wasmtime/issues/1059#issuecomment-679061786


Last updated: Dec 23 2024 at 12:05 UTC