components: process extract memory initializers for adapters.#4605
components: process extract memory initializers for adapters.#4605peterhuene wants to merge 2 commits intobytecodealliance:mainfrom
Conversation
This commit fixes an issue where the `ExtractMemory` initializer wasn't processed for adapters, leading to incorrect runtime instance indexes in the initializer resulting from the insertion of adapter instances. Ultimately this would either resolve the memory from the wrong instance or panic if the referenced instance didn't export a memory when instantiating the component. The fix is to fixup the memory export's instance when processing global initializers.
Subscribe to Label Actioncc @peterhuene DetailsThis issue or pull request has been labeled: "wasmtime:api"Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
alexcrichton
left a comment
There was a problem hiding this comment.
Oh dear, thanks for this! This makes me even more confident in the approach of #4597 which I think would also fix this issue (or at least I hope). That being said this is obviously correct and I think it's fine to merge in the meantime. Could you add a test though which exercises this?
|
I'll see about coming up with a minimal test case that exposes this bug (it was found via a composition of multiple Rust components, which makes it hard to use as a small test case). |
|
If you want you can throw a large |
|
Closing in favor of #4622. |
This PR fixes an issue where the
ExtractMemoryinitializer wasn'tprocessed for adapters, leading to incorrect runtime instance indexes in
the initializer resulting from the insertion of adapter instances.
Ultimately this would either resolve the memory from the wrong instance
or panic if the referenced instance didn't export a memory when
instantiating the component.
The fix is to fixup the memory export's instance when processing global
initializers.