Skip to content

Fix usage of GC barriers when throwing an exnref #13330

Open
alexcrichton wants to merge 3 commits intobytecodealliance:mainfrom
alexcrichton:fix-exnref-ownership
Open

Fix usage of GC barriers when throwing an exnref #13330
alexcrichton wants to merge 3 commits intobytecodealliance:mainfrom
alexcrichton:fix-exnref-ownership

Conversation

@alexcrichton
Copy link
Copy Markdown
Member

  • set_pending_exception didn't have a write barrier to handle any
    previously configured exception.
  • When an exnref was caught it didn't go through expose_gc_ref_to_wasm.
  • During throw_impl the exnref wasn't cloned to give a strong
    reference to the store.

All of these should now be fixed with some minor refactorings and such
to ensure we've got the right barriers in the right places.

Closes #13316

Keeps imports a bit more organized and additionally cuts down on the
quantity of #[cfg] needed.
* `set_pending_exception` didn't have a write barrier to handle any
  previously configured exception.
* When an `exnref` was caught it didn't go through `expose_gc_ref_to_wasm`.
* During `throw_impl` the `exnref` wasn't cloned to give a strong
  reference to the store.

All of these should now be fixed with some minor refactorings and such
to ensure we've got the right barriers in the right places.

Closes bytecodealliance#13316
@alexcrichton alexcrichton requested a review from a team as a code owner May 8, 2026 20:37
@alexcrichton alexcrichton requested review from fitzgen and removed request for a team May 8, 2026 20:37
@github-actions github-actions Bot added wasmtime:api Related to the API of the `wasmtime` crate itself wasmtime:ref-types Issues related to reference types and GC in Wasmtime labels May 9, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

Subscribe to Label Action

cc @fitzgen

Details This issue or pull request has been labeled: "wasmtime:api", "wasmtime:ref-types"

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

  • fitzgen: wasmtime:ref-types

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

Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wasmtime:api Related to the API of the `wasmtime` crate itself wasmtime:ref-types Issues related to reference types and GC in Wasmtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DRC collector isn't walking exnref roots in the store

1 participant