Skip to content

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

Open
dicej wants to merge 1 commit into
bytecodealliance:mainfrom
dicej:waitable-sync-async-trap
Open

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

Conversation

@dicej
Copy link
Copy Markdown
Contributor

@dicej dicej commented May 19, 2026

...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
Copy link
Copy Markdown
Contributor Author

dicej commented May 20, 2026

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
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

1 participant