Skip to content

Fix current instance count on failure during component instantiation#13048

Merged
alexcrichton merged 1 commit intobytecodealliance:mainfrom
alexcrichton:fix-decrement
Apr 13, 2026
Merged

Fix current instance count on failure during component instantiation#13048
alexcrichton merged 1 commit intobytecodealliance:mainfrom
alexcrichton:fix-decrement

Conversation

@alexcrichton
Copy link
Copy Markdown
Member

This commit fixes an issue during component instantiation where if instantiation failed during creation of the Instantiator due to OOM or if the async future was dropped the concurrent instance count in the pooling allocator would get corrupted (off-by-one). The fix here is to switch a map_err with a manual decrement to using a value that has a
destructor to ensure that it handles both of these cases.

@alexcrichton alexcrichton requested review from a team as code owners April 10, 2026 21:27
@alexcrichton alexcrichton requested review from fitzgen and removed request for a team April 10, 2026 21:27
@github-actions github-actions bot added fuzzing Issues related to our fuzzing infrastructure wasmtime:api Related to the API of the `wasmtime` crate itself labels Apr 10, 2026
@github-actions
Copy link
Copy Markdown

Subscribe to Label Action

cc @fitzgen

Details This issue or pull request has been labeled: "fuzzing", "wasmtime:api"

Thus the following users have been cc'd because of the following labels:

  • fitzgen: fuzzing

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@fitzgen fitzgen added this pull request to the merge queue Apr 13, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 13, 2026
This commit fixes an issue during component instantiation where if
instantiation failed during creation of the `Instantiator` due to OOM or
if the `async` future was dropped the concurrent instance count in the
pooling allocator would get corrupted (off-by-one). The fix here is to
switch a `map_err` with a manual decrement to using a value that has a
destructor to ensure that it handles both of these cases.
@alexcrichton alexcrichton enabled auto-merge April 13, 2026 19:03
@alexcrichton alexcrichton added this pull request to the merge queue Apr 13, 2026
Merged via the queue into bytecodealliance:main with commit bd98771 Apr 13, 2026
48 checks passed
@alexcrichton alexcrichton deleted the fix-decrement branch April 13, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fuzzing Issues related to our fuzzing infrastructure wasmtime:api Related to the API of the `wasmtime` crate itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants