Repository navigation
CABI: don't trap if the last thread of a task exits before the task is resolved - #767
Conversation
…s resolved Resolves #763
alexcrichton
left a comment
There was a problem hiding this comment.
lgtm, but @dicej should be sure to take a look too
dicej
left a comment
There was a problem hiding this comment.
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.
|
@dicej Agreed: I think debugger options are the best route here for detecting deadlocks. |
* 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>
|
Was it intentional that the trap w.r.t. dangling borrows was also removed here? I was thinking about https://github.com/bytecodealliance/wasmtime/pull/15443/changes#r4682941157 and I feel like removing that trap is going to break at least the Rust bindings generator if not others (semantically if not literally) |
|
This PR only intentionally removed an assertion (enforced by trap elsewhere) that followed as a corollary of the trap-if-not-resolved guard (which was also removed). There is still a trap-if-dangling-borrows guard on the synchronous-return, |
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.