WebAssembly / WebAssembly/threads
Unsynchronized data races
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?
- Will a thread reading memory being concurrently filled via
memory.fillsee a linearly advancing fill? - Will a thread reading memory being concurrently filled via
memory.fillsee 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
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 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