Skip to content

trap if waitable added to waitable-set while used synchronously#13415

Merged
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
dicej:waitable-sync-async-trap
May 23, 2026
Merged

trap if waitable added to waitable-set while used synchronously#13415
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
dicej:waitable-sync-async-trap

Conversation

@dicej

@dicej dicej commented May 19, 2026

Copy link
Copy Markdown
Contributor

...and vice-versa.

Per WebAssembly/component-model#647, a waitable may not be added to a waitable-set while it's being used in a synchronous operation, nor may a waitable that's already added to a waitable-set be used in a synchronous operation.

Test case courtesy of Alex via #13212.

Fixes #13212

@dicej dicej requested a review from alexcrichton May 19, 2026 22:35
@dicej dicej requested a review from a team as a code owner May 19, 2026 22:36
@github-actions github-actions Bot added wasmtime:api Related to the API of the `wasmtime` crate itself wasmtime:c-api Issues pertaining to the C API. labels May 20, 2026
@dicej dicej force-pushed the waitable-sync-async-trap branch from 3ce2474 to 67d0619 Compare May 20, 2026 15:41
@dicej

dicej commented May 20, 2026

Copy link
Copy Markdown
Contributor Author

I realized we don't have a test yet for adding a waitable to a set while it's involved in a sync operation; will add one.

...and vice-versa.

Per WebAssembly/component-model#647, a waitable may not
be added to a waitable-set while it's being used in a synchronous operation, nor
may a waitable that's already added to a waitable-set be used in a synchronous
operation.

Test case courtesy of Alex via bytecodealliance#13212.

Fixes bytecodealliance#13212
@dicej dicej force-pushed the waitable-sync-async-trap branch from 67d0619 to 44e630a Compare May 20, 2026 18:08

@alexcrichton alexcrichton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@alexcrichton alexcrichton added this pull request to the merge queue May 23, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 23, 2026
@alexcrichton alexcrichton added this pull request to the merge queue May 23, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 23, 2026
@alexcrichton alexcrichton added this pull request to the merge queue May 23, 2026
Merged via the queue into bytecodealliance:main with commit a7fb188 May 23, 2026
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wasmtime:api Related to the API of the `wasmtime` crate itself wasmtime:c-api Issues pertaining to the C API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bail_bug! hit when synchronous write is notified while it's also in a waitable set

2 participants