WebAssembly / WebAssembly/binaryen

Memory packing is not safe with imported memory

Open
#2,423 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first bug
Dominant language
WebAssembly
Stars
8.6k
Forks
885
Avg merge
1d 19h
Merged PRs (30d)
69

Description

The MemoryPacking pass assumes that the initial memory is zero, so it is free to remove spans of zeroes from active segments. This is not technically true with an imported memory. Do we care? This has not been a problem in practice because toolchains generally assume that memory is fresh and owned by the wasm module.

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 reading the MemoryPacking pass and how it handles imported memory. Determine the intended behavior when the initial memory is not zero; done requires an agreed, safe scope for changing or retaining the optimization.

Written by the indexing model from the issue text.

Assessment

Tech stack
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.