Stream: git-wasmtime

Topic: wasmtime / PR #10374 `AnyRef::from_raw` needs to clone it...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2025 at 23:36):

fitzgen opened PR #10374 from fitzgen:anyref-from-raw-clone-gc-ref to bytecodealliance:main:

Like ExternRef::from_raw does.

This is because while to_raw clones the GC ref, it also exposes it to Wasm, inserting it into the DRC collector's table, which effectively gives ownership of that clone to Wasm. Then, if we don't clone in from_raw, when a GC is triggered, the DRC collector will see that Wasm isn't holding the ref alive anymore and will decref (and perhaps even deallocate) it, which leaves the AnyRef we constructed via from_raw dangling.

Fixes #10182

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2025 at 23:36):

fitzgen requested pchickey for a review on PR #10374.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 11 2025 at 23:36):

fitzgen requested wasmtime-core-reviewers for a review on PR #10374.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 12 2025 at 01:05):

github-actions[bot] commented on PR #10374:

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:

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

Learn more.
</details>

view this post on Zulip Wasmtime GitHub notifications bot (Mar 12 2025 at 02:03):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 12 2025 at 02:24):

alexcrichton merged PR #10374.


Last updated: Apr 17 2025 at 22:03 UTC