rust-lang / rust-lang/rust

wasm32-unknown-unknown: must not re-enter module after abort

Open
#117,344 4 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

I-unsound O-wasm
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

@thomcc points out that when we abort on wasm32-unknown-unknown, there's nothing actually stopping whoever invoked that module from calling back into it. That's bad, it leads to unsoundness! We should either find some way to prevent this (I don't know how wasm works, maybe there's a global flag we can set on abort and check on every entry point), or we should at least document this prominently, in some place that people using this target are likely to see.

The wasi and emcscripten targets are not affected, they already "poison" modules on abort so they cannot be re-entered.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing abort handling and module entry points for the wasm32-unknown-unknown target, then compare them with the existing wasi and emscripten behavior. Done means either preventing re-entry after abort or documenting the limitation prominently where users of this target will see it.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.