jellevandenhooff opened PR #12704 from jellevandenhooff:fix-async-stream-cancel-state-corruption to bytecodealliance:main:
Ran into an issue with async stream.cancel-read causing a panic. The attached change makes my guest pass, and the test reproduces. However, it is LLM written and I am not 100% confident in either the diagnosis or the description of the bug in the test.
jellevandenhooff requested fitzgen for a review on PR #12704.
jellevandenhooff requested wasmtime-core-reviewers for a review on PR #12704.
dicej requested dicej for a review on PR #12704.
dicej unassigned fitzgen from PR #12704 Fix async stream cancel corrupting read/write state.
dicej submitted PR review:
Thanks for catching and fixing this, @jellevandenhooff.
Currently, not many guest binding generators support cancellation, and while the Rust binding generator _does_, it uses the synchronous versions of
cancel-readandcancel-write, allowing this to fly under the radar.@alexcrichton's recent PR downgrades the panic to a trap, but it's great to have it fixed altogether.
dicej added PR #12704 Fix async stream cancel corrupting read/write state to the merge queue.
github-merge-queue[bot] removed PR #12704 Fix async stream cancel corrupting read/write state from the merge queue.
jellevandenhooff updated PR #12704.
jellevandenhooff commented on PR #12704:
Happy to contribute! Rebased on that change.
(As shameless plug, I've been discovering these issues working on wasip3 go guest at https://github.com/jellevandenhooff/go/commits/wasip3-prototype/. I run the entire go test suite with
WASMTIME=~/hack/wasmtime/target/release/wasmtime GOARCH=wasm32 GOOS=wasip3 GOWASIRUNTIME=wasmtime ./bin/go tool dist test. The guest bindings support cancellation for all socket operations through go's built-in netpoll mechanisms, which has been good for stress-testing wasmtime.)
alexcrichton commented on PR #12704:
The stress testing is very much appreciated, thank you so much for the reports here and fixes! The surface area of async is broad enough that it's tough to ensure comprehensive coverage so it's great to get a different runtime tickling different bits than JS/C/Rust/Python have all tickled so far
jellevandenhooff updated PR #12704.
dicej added PR #12704 Fix async stream cancel corrupting read/write state to the merge queue.
dicej merged PR #12704.
dicej removed PR #12704 Fix async stream cancel corrupting read/write state from the merge queue.
Last updated: Mar 23 2026 at 16:19 UTC