Stream: git-wasmtime

Topic: wasmtime / PR #14126 Run linker callback finalizers on in...


view this post on Zulip Wasmtime GitHub notifications bot (Aug 12 2026 at 15:44):

grandpig opened PR #14126 from grandpig:fix-linker-callback-finalizers to bytecodealliance:main:

<!--
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
-->

Follow-up to bytecodealliance/wasmtime-go#293.

When one of the linker function APIs receives an invalid UTF-8 module or function name, to_str! returns an error before the Rust callback closure is constructed.

The closure owns the C-provided data and finalizer through ForeignData.

Constructing it after parsing the names therefore means that the finalizer is not called when name parsing fails.

Move callback construction before UTF-8 validation in:

This transfers ownership of data to ForeignData before any fallible name parsing. If parsing fails, normal Rust drop behavior invokes the finalizer.

Regression tests verify this behavior for the checked, unchecked, and async linker function APIs.

Testing

view this post on Zulip Wasmtime GitHub notifications bot (Aug 12 2026 at 15:44):

grandpig requested dicej for a review on PR #14126.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 12 2026 at 15:44):

grandpig requested wasmtime-core-reviewers for a review on PR #14126.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 12 2026 at 16:01):

:thumbs_up: dicej submitted PR review:

Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Aug 12 2026 at 16:01):

dicej has enabled auto merge for PR #14126.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 12 2026 at 16:02):

dicej added PR #14126 Run linker callback finalizers on invalid names to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 12 2026 at 16:29):

:check: dicej merged PR #14126.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 12 2026 at 16:29):

dicej removed PR #14126 Run linker callback finalizers on invalid names from the merge queue.


Last updated: Aug 30 2026 at 09:07 UTC