Asyncify "OOM" leaves broken state
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- wasm
- Domain
- compilers
Research direction
Start by tracing the emitted Asyncify unwind/rewind mechanisms and the existing bound checks at points such as asyncify_stop_unwind. Verify how much local storage is required before unwinding, then confirm that an out-of-bounds condition is handled before locals are stored and that the module remains usable after the original error is caught.
Written by the indexing model from the issue text.
Description
Right now, emitted Asyncify unwind/rewind mechanisms always stores all the variables while unwinding, and only performs bound checks in points like asyncify_stop_unwind when memory outside of bounds is already corrupted.
This leaves module in a broken state: even if you catch & handle the original error, calling into other exports after this point can result in all sorts of broken behaviour.
A better solution would be to perform bound checks right before storing the locals - their size is known in advance, so such condition should be fairly simple and wouldn't add any noticeable overhead, but would improve reliability a lot.
cc @kripken thoughts?
- Dominant language
- WebAssembly
- Stars
- 8.6k
- Forks
- 885
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 77
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.
More from WebAssembly/binaryen
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
WebAssembly/binaryen#9135 · 1 comment ·
-
Difficulty 2/5 Half a day Newbie friendliness 76/100
WebAssembly/binaryen#9018 · 3 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
WebAssembly/binaryen#9133 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
WebAssembly/binaryen#9123 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
WebAssembly/binaryen#9122 ·
All issues in WebAssembly/binaryen
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
JakeChampion/lang#10213 ·
-
enhancement good first issue needs testing
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
bradcypert/plum#58 ·
-
flang:fir-hlfir
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
llvm/llvm-project#225935 ·
-
area:cards hand-tail ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
fil-donadoni/tolaria#4446 ·