trap on blocking call in sync task before return #12043
Draft
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 implements a spec change (PR pending) such that tasks created for calls to synchronous exports may not call potentially-blocking imports or return
waitorpollcallback codes prior to returning a value. Specifically, the following are prohibited in that scenario:This breaks a number of tests, which will be addressed in follow-up commits:
The
{tcp,udp}-socket.bindimplementation inwasmtime-wasiis implemented usingLinker::func_wrap_concurrentand thus assumed to be async, whereas the WIT interface says they're sync, leading to a type mismatch error at runtime. Alex and I have discussed this and have a general plan to address it.A number of tests in the tests/component-model submodule that points to the spec repo are failing. Those will presumably be fixed as part of the upcoming spec PR (although some could be due to bugs in this implementation, in which case I'll fix them).
A number of tests in tests/misc_testsuite are failing. I'll address those in a follow-up commit.