WebAssembly / WebAssembly/threads

Unsynchronized data races

Open
#189 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
WebAssembly
Stars
767
Forks
54
PR merge metrics
No merged PRs in 30d

Description

memory.fill is currently specified as writing its bytes sequentially from lowest address to highest: https://webassembly.github.io/spec/core/exec/instructions.html#xref-syntax-instructions-syntax-instr-memory-mathsf-memory-fill. This behavior is unobservable to the thread executing the instruction, and I would presume most implementations don't write a byte at a time. But with multiple threads, I understand the goal is to allow races. What do we guarantee in that case?

  1. Will a thread reading memory being concurrently filled via memory.fill see a linearly advancing fill?
  2. Will a thread reading memory being concurrently filled via memory.fill see either the old data or the new data? Could it see something else?

I am particularly interested in the last question: is seeing something else allowed.

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 memory.fill execution semantics in the linked WebAssembly specification section. Investigate the guarantees for reads concurrent with memory.fill, including whether partial or non-sequential observations are allowed, then clarify the specification once the behavior is decided.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.