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

Name of memory export gets mangled in threaded Wasm #2114

Closed
RReverser opened this issue Apr 29, 2020 · 0 comments · Fixed by #2583
Closed

Name of memory export gets mangled in threaded Wasm #2114

RReverser opened this issue Apr 29, 2020 · 0 comments · Fixed by #2583
Labels

Comments

@RReverser
Copy link
Member

RReverser commented Apr 29, 2020

Describe the Bug

WebAssembly memory is normally exported under memory name, but when wasm-bindgen runs on a Wasm file built with an atomics feature, it gets mangled to __wbindgen_export_0.

Steps to Reproduce

  1. Build an example in https://github.com/rustwasm/wasm-bindgen/tree/master/examples/raytrace-parallel.
  2. Inspect the generated Wasm with wasm2wat or wasm-dis or wasm-objdump etc.
  3. Find the memory export.

Expected Behavior

The memory is exported under name "memory" as it does by default in any Wasm builds by LLVM.

Actual Behavior

The memory is exported under name "__wbindgen_export_0" which is not stable enough name to rely on.

Additional Context

From #2102 (comment) via @alexcrichton:

That sounds like a bug in one of the possible passes along the way, likely something that's de-exporting it and then re-exporting it later, forgetting the original export name along the way.

@RReverser RReverser added the bug label Apr 29, 2020
RReverser added a commit to RReverser/wasm-bindgen that referenced this issue Jun 11, 2021
alexcrichton pushed a commit that referenced this issue Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant