fix: skip drop_fibers_and_futures when concurrency support is disabled #12515
+7
−0
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.
Summary
When the
component-model-asyncfeature is compiled in but the store was created without concurrency support,concurrent_stateisNone. DuringStore::drop,drop_fibers_and_futuresis called which then callsconcurrent_state_mut(). This panics becauseconcurrent_state_mut()unwraps theNonevalue.This fix adds a runtime check to early-return when
concurrency_support()returnsfalse, preventing the panic during Store drop.Problem
In
crates/wasmtime/src/runtime/store.rs:The
debug_assert!only catches this in debug builds, but in release builds theunwrap()will panic.Fix
Add a guard in
drop_fibers_and_futures:Test Plan
cargo check -p wasmtime --features component-model,component-model-async,async