WebAssembly / WebAssembly/binaryen

[C-API / JS-API] Binaryen crash if recent "memoryName" is null for memory ops

Open
#4,962 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

After #4811 and #4940

If not specify recently introduced memoryName (just use nullptr) parameter for BinaryenLoad, BinaryenStore, BinaryenMemoryFill etc., this lead to crash with assertion inside emscripten-optimizer/istring.h (line 65):

RuntimeError: Aborted(Assertion failed: s, at: .../binaryen.js/binaryen/src/emscripten-optimizer/istring.h,65,IString).

https://github.com/WebAssembly/binaryen/blob/main/src/emscripten-optimizer/istring.h#L65

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 with the BinaryenLoad, BinaryenStore, and BinaryenMemoryFill APIs described in the issue, then inspect src/emscripten-optimizer/istring.h at line 65 and trace how a null memoryName reaches that assertion. Reproduce the C-API and JS-API calls with nullptr, and confirm that memory operations with an omitted memoryName no longer crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, javascript, wasm
Domain
api, compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.