Stream: git-wasmtime

Topic: wasmtime / issue #11409 Implementation of GC is not sound...


view this post on Zulip Wasmtime GitHub notifications bot (Aug 08 2025 at 19:05):

alexcrichton opened issue #11409:

This line of code:

https://github.com/bytecodealliance/wasmtime/blob/b500820efe1576188653f9d710f7d21cdb4e39be/crates/wasmtime/src/runtime/store/gc.rs#L124

expands a borrow of &mut StoreOpaque (self in this case) into a &mut dyn VMStore which is effectively a &mut StoreInner<T>. This is a "widening" operation which makes the original mutable borrow wider by encompassing more fields. This is not a sound operation because a caller might simultaneously be borrowing &mut StoreOpaque and &mut T or similarly.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 08 2025 at 19:05):

alexcrichton added the wasm-proposal:gc label to Issue #11409.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 08 2025 at 19:05):

alexcrichton added the wasmtime:unsafe-code label to Issue #11409.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2025 at 01:46):

alexcrichton commented on issue #11409:

This is also arguably a problem during instance allocation and allocation of the gc heap

view this post on Zulip Wasmtime GitHub notifications bot (Aug 21 2025 at 01:45):

alexcrichton closed issue #11409:

This line of code:

https://github.com/bytecodealliance/wasmtime/blob/b500820efe1576188653f9d710f7d21cdb4e39be/crates/wasmtime/src/runtime/store/gc.rs#L124

expands a borrow of &mut StoreOpaque (self in this case) into a &mut dyn VMStore which is effectively a &mut StoreInner<T>. This is a "widening" operation which makes the original mutable borrow wider by encompassing more fields. This is not a sound operation because a caller might simultaneously be borrowing &mut StoreOpaque and &mut T or similarly.


Last updated: Dec 06 2025 at 07:03 UTC