WebAssembly / WebAssembly/binaryen
[wasm-opt] Global variables are not shared between threads, so using wasm-opt `--multi-memory-lowering` will cause memory corruption.
Nobody has claimed this yet.
- Dominant language
- WebAssembly
- Stars
- 8.6k
- Forks
- 885
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 69
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
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.
Assessment
- Tech stack
- wasm
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100