Introduce wasmtime::Store::try_new, which handles OOM#12415
Merged
fitzgen merged 4 commits intobytecodealliance:mainfrom Jan 27, 2026
Merged
Introduce wasmtime::Store::try_new, which handles OOM#12415fitzgen merged 4 commits intobytecodealliance:mainfrom
wasmtime::Store::try_new, which handles OOM#12415fitzgen merged 4 commits intobytecodealliance:mainfrom
Conversation
Subscribe to Label Actioncc @fitzgen DetailsThis issue or pull request has been labeled: "fuzzing", "wasmtime:api"Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
e119b58 to
8d5daa1
Compare
Member
|
@fitzgen oh to resolve that, you'll need to set |
Subscribe to Label ActionDetailsThis issue or pull request has been labeled: "winch"Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
`Store::new` is an infallible constructor, so there is not a direct way to make it return an error on OOM. Additionally, it is one of the most-used functions in the Wasmtime embedder API, so changing its signature to return a `Result` is a non-starter -- it would cause way too much pain. So instead we define `Store::try_new` which returns a `Result` and make `Store::new` call and unwrap that new constructor. Part of bytecodealliance#12069
8d5daa1 to
948deef
Compare
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jan 26, 2026
* Introduce `wasmtime::Store::try_new`, which handles OOM `Store::new` is an infallible constructor, so there is not a direct way to make it return an error on OOM. Additionally, it is one of the most-used functions in the Wasmtime embedder API, so changing its signature to return a `Result` is a non-starter -- it would cause way too much pain. So instead we define `Store::try_new` which returns a `Result` and make `Store::new` call and unwrap that new constructor. Part of #12069 * update disas tests and fix winch * Disable concurrency support in `Store::try_new` OOM test * Add attributes that were lost in rebase
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jan 26, 2026
* Introduce `wasmtime::Store::try_new`, which handles OOM `Store::new` is an infallible constructor, so there is not a direct way to make it return an error on OOM. Additionally, it is one of the most-used functions in the Wasmtime embedder API, so changing its signature to return a `Result` is a non-starter -- it would cause way too much pain. So instead we define `Store::try_new` which returns a `Result` and make `Store::new` call and unwrap that new constructor. Part of #12069 * update disas tests and fix winch * Disable concurrency support in `Store::try_new` OOM test * Add attributes that were lost in rebase
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Store::newis an infallible constructor, so there is not a direct way to makeit return an error on OOM. Additionally, it is one of the most-used functions in
the Wasmtime embedder API, so changing its signature to return a
Resultis anon-starter -- it would cause way too much pain. So instead we define
Store::try_newwhich returns aResultand makeStore::newcall and unwrapthat new constructor.
Part of #12069
Depends on
ModuleRuntimeInfos across all stores in an engine #12409initialize_vmctx#12412ModuleRuntimeInfo#12413memory_tysparam fromvm::Instance::new#12414