Repository navigation
Avoid dangling references to exited threads - #13926
Merged
alexcrichton merged 2 commits intoJul 21, 2026
Merged
Conversation
This commit is a refactor of the `HostTask::caller` field to no longer refer to a `QualifiedThreadId`. This is not valid to store within a `HostTask` because threads can exit while a host task is still running. More generally a `caller` field isn't valid to store because tasks can exit without blocking on callees, but that refactoring is left for another day. Otherwise most of this commit is juggling state and moving things around now that `caller` is no longer present. I've attempted to explicitly pass it around in a few places and notably delineate boundaries of tasks entering/exiting a bit more clearly in a few locations. This commit also surface WebAssembly/component-model#678 which is something we'll have to address in the future as well, and now it's got a `FIXME` for the primary location of where the chosen task to lower with is suspect. Closes bytecodealliance#13890
dicej
approved these changes
Jul 21, 2026
yagehu
referenced
this pull request
in yagehu/wasmtime-x
Jul 26, 2026
* Avoid dangling references to exited threads This commit is a refactor of the `HostTask::caller` field to no longer refer to a `QualifiedThreadId`. This is not valid to store within a `HostTask` because threads can exit while a host task is still running. More generally a `caller` field isn't valid to store because tasks can exit without blocking on callees, but that refactoring is left for another day. Otherwise most of this commit is juggling state and moving things around now that `caller` is no longer present. I've attempted to explicitly pass it around in a few places and notably delineate boundaries of tasks entering/exiting a bit more clearly in a few locations. This commit also surface WebAssembly/component-model#678 which is something we'll have to address in the future as well, and now it's got a `FIXME` for the primary location of where the chosen task to lower with is suspect. Closes #13890 * Fix compile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit is a refactor of the
HostTask::callerfield to no longer refer to aQualifiedThreadId. This is not valid to store within aHostTaskbecause threads can exit while a host task is still running. More generally acallerfield isn't valid to store because tasks can exit without blocking on callees, but that refactoring is left for another day.Otherwise most of this commit is juggling state and moving things around now that
calleris no longer present. I've attempted to explicitly pass it around in a few places and notably delineate boundaries of tasks entering/exiting a bit more clearly in a few locations. This commit also surface WebAssembly/component-model#678 which is something we'll have to address in the future as well, and now it's got aFIXMEfor the primary location of where the chosen task to lower with is suspect.Closes #13890