Skip to content

CABI: don't trap if the last thread of a task exits before the task is resolved - #767

Merged
lukewagner merged 1 commit into
mainfrom
rm-trap
Nov 18, 2026
Merged

lukewagner merged 1 commit into
mainfrom
rm-trap

Conversation

@lukewagner

Copy link
Copy Markdown
Member

As discussed in #763, this PR removes a trap that used to be more load-bearing, but now seems superfluous since there are plenty of other ways to end up with a never-resolved task. The PR also adds some new tests for the new allowed behavior.

@alexcrichton alexcrichton left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, but @dicej should be sure to take a look too

@dicej dicej left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm kind of ambivalent about this. I do agree that there are other ways to end up with a never-resolved task, but I also feel like this is akin to runtime deadlock detection; just because you can't catch all of them doesn't mean you shouldn't try to catch the obvious ones. Perhaps "catching" in this case just means "provide a runtime option to print a warning or trap to a debugger when a guest does this", though.

Anyway, no real objections.

@lukewagner

Copy link
Copy Markdown
Member Author

@dicej Agreed: I think debugger options are the best route here for detecting deadlocks.

@lukewagner
lukewagner merged commit 9ff90fd into main Nov 18, 2026
2 checks passed
@lukewagner
lukewagner deleted the rm-trap branch November 18, 2026 00:51
q82419 added a commit to WasmEdge/wasmedge-spectest that referenced this pull request Nov 20, 2026
* Resync two tests with the spec repository at 585526a (2026/11/18):
  * component-model-async/during-sync-call-exclusive-resume: a task
    whose last thread exits without a result no longer traps
    (WebAssembly/component-model#767). The callback task that exits
    during a synchronous call now ends in the trap of the blocked
    synchronous call, so the expected message is the upstream one
    again.
  * component-model-async/during-sync-call-no-sibling-resume: the
    second case arms the sibling from inside the guest, with a single
    call from the host (WebAssembly/component-model#770).
* Add one test from the same commit:
  * component-model-async/exit-without-resolving: a task whose threads
    have all exited without a result stays unresolved; a caller that
    waits for it traps or deadlocks, and a caller that does not wait
    returns.
* Follow the rename of Explainer.md to Text.md in the comments of
  component-model-validation/annotated-names,
  component-model-validation/external-visibility, and
  component-model-validation/resources. Their converted files do not
  change.
* Update the README: every test now matches spec commit 585526a, the
  three async tests above are converted with wasm-tools 1.263.0, the
  message change of during-sync-call-exclusive-resume leaves the list,
  and exit-without-resolving joins the tests listed in `test/nyi.txt`.

Assisted-by: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: YiYing He <yiying@secondstate.io>
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.

3 participants