Skip to content

fix(bindgen): post return trap completion - #2305

Merged
vados-cosmonic merged 7 commits into
bytecodealliance:mainfrom
vados-cosmonic:fix/post-return-trap-completion
Oct 23, 2026
Merged

vados-cosmonic merged 7 commits into
bytecodealliance:mainfrom
vados-cosmonic:fix/post-return-trap-completion

Conversation

@vados-cosmonic

@vados-cosmonic vados-cosmonic commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Resolves #2300

vados-cosmonic and others added 7 commits October 23, 2026 09:15
Catch failures during canonical post-return cleanup and mark the
component trapped. Record the task failure even when a result is
already recorded, preventing successful async completion after
cleanup traps and rejecting subsequent component entry.

Co-authored-by: Markus Gritsch <gurkerl83@googlemail.com>
Add shared Rust fixtures and regression tests for synchronous exports,
JSPI-wrapped synchronous exports and WIT async exports. Verify that
cleanup failures reach the caller and subsequent component entry
is rejected.

Co-authored-by: Markus Gritsch <gurkerl83@googlemail.com>
Normalize stack exhaustion and core exceptions during post-return, retaining their causes. Guard fused cleanup imports against the owning component and reject task-managed cleanup failures before publishing results.
Keep the result discriminant until the completion handler decides whether to return its payload or reject. This prevents successful post-return cleanup from publishing an err payload as a fulfilled Promise.
Add documented WAT fixtures for direct and composed cleanup traps, async-lowered calls, and result completion with wrapped or raw errors. Check that healthy sibling instances remain callable. Shorten the existing Rust fixture and regression comments.
@vados-cosmonic
vados-cosmonic added this pull request to the merge queue Oct 23, 2026
Merged via the queue into bytecodealliance:main with commit 3acf8a1 Oct 23, 2026
66 checks passed
@vados-cosmonic
vados-cosmonic deleted the fix/post-return-trap-completion branch October 23, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Post-return traps do not consistently reject calls and prevent subsequent component entry

1 participant