[wasm-opt] Global variables are not shared between threads, so using wasm-opt `--multi-memory-lowering` will cause memory corruption.

Open
#7,916 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start by tracing the wasm-opt --multi-memory-lowering implementation and how it handles allocation from the module's minimum memory. Clarify the title's thread-sharing and memory-corruption concern, then define how configurable maximum-memory-based allocation and any compatibility-preserving command should behave.

Written by the indexing model from the issue text.

Description

Please ignore this comment and read on.
Currently, --multi-memory-lowering seems to handle memory allocation in the Min memory.
However, in practice, it would be more natural if the allocation could adapt to the Max memory size specified for the module.

However, this may become excessively large, so it would be preferable if it could be configurable.
Since this would break compatibility, it would likely require introducing a new command.

Dominant language
WebAssembly
Stars
8.6k
Forks
885
Avg merge
2d 1h
Merged PRs (30d)
70

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.

More from WebAssembly/binaryen

All issues in WebAssembly/binaryen

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.