Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--enable-threads does not enable shared memory support #1658

Closed
RReverser opened this issue May 5, 2020 · 4 comments
Closed

--enable-threads does not enable shared memory support #1658

RReverser opened this issue May 5, 2020 · 4 comments
Labels
bug Incorrect behavior in the current implementation that needs fixing

Comments

@RReverser
Copy link
Contributor

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:

/// This feature gates items such as shared memories and atomic
/// instructions. Note that enabling the threads feature will
/// also enable the bulk memory feature.

@RReverser RReverser added the bug Incorrect behavior in the current implementation that needs fixing label May 5, 2020
@bjorn3
Copy link
Contributor

bjorn3 commented May 5, 2020

Atomics are not implemented by Cranelift at all.

@programmerjake
Copy link

Atomics are not implemented by Cranelift at all.

they've since been implemented. #1059 (comment)

@alexcrichton
Copy link
Member

I'm going to close this in favor of #888 since it's otherwise a duplicate of that in that we're just missing big pieces of the threads proposal right now

@abrown
Copy link
Collaborator

abrown commented May 20, 2022

Just FYI: I'm working on this at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior in the current implementation that needs fixing
Projects
None yet
Development

No branches or pull requests

5 participants