Stream: git-wasmtime

Topic: wasmtime / PR #14067 Fix core dumps for composed components


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

subotac opened PR #14067 from subotac:fix/component-coredump-adapters to bytecodealliance:main:

Fixes #13983.

Core dumps from composed components could reference synthetic adapter globals that were missing from the dump's global index, causing serialization to panic.

Collect all globals visible to captured core instances, deduplicate them by their underlying definition, and add a regression test that serializes and validates a dump from the reported composed-component case.

Tests:

- cargo test --test all

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

subotac requested dicej for a review on PR #14067.

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

subotac requested wasmtime-core-reviewers for a review on PR #14067.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 03 2026 at 03:56):

github-actions[bot] added the label wasmtime:api on PR #14067.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 03 2026 at 14:27):

alexcrichton commented on PR #14067:

It feels a bit odd to me here to special-case globals compared to other core wasm items when assembling a core dump. With your understanding of the issue is there perhaps a more targeted fix for just the panic itself that would make sense? Or does it make more sense to put here?

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

subotac updated PR #14067.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 03 2026 at 17:37):

subotac commented on PR #14067:

Thanks — I changed this to a targeted serialization fix in 508a08692. The additional global collection and deduplication are gone. When an instance global is absent from the serialized global section, the lookup now
uses u32::MAX, matching the existing handling for memories. The composed-component regression test remains in place.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 03 2026 at 21:39):

:memo: alexcrichton submitted PR review:

Thanks yeah. Could you leave a comment for why this conditional get is done? Naively I don't understand why this global is missing in global_to_idx, and I also don't understand why the handling for memories is necessary (I forgot to add docs in ##12022). Would you be up for adding at least a doc block for globals, and perhaps memories too?

view this post on Zulip Wasmtime GitHub notifications bot (Aug 04 2026 at 09:57):

subotac updated PR #14067.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 04 2026 at 10:00):

subotac edited PR #14067:

Fixes #13983.

Core dumps from composed components can reference runtime-managed adapter
globals that are absent from the dump's global section, causing serialization
to panic.

Treat globals missing from the serialized section as unavailable by using
u32::MAX, matching the existing best-effort handling for missing memories.
Document why coredumps can omit both memories and globals, and add a regression
test that serializes and validates a dump from the reported composed-component
case.

Tests:

- cargo test --test all coredump::

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

subotac commented on PR #14067:

Thanks yeah. Could you leave a comment for why this conditional get is done? Naively I don't understand why this global is missing in global_to_idx, and I also don't understand why the handling for memories is necessary (I forgot to add docs in ##12022). Would you be up for adding at least a doc block for globals, and perhaps memories too?

Added comments for both lookups in c1333fc07e. Shared memories are intentionally
omitted from core dumps because they cannot be safely read through Memory,
while component adapter modules can import runtime-managed globals, such as
component instance flags, that StoreOpaque::for_each_global does not
enumerate. In both cases serialization remains best-effort rather than
panicking when a resource is absent from the dump.

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

subotac requested alexcrichton for a review on PR #14067.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 06 2026 at 14:08):

:thumbs_up: alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 06 2026 at 14:08):

alexcrichton added PR #14067 Fix core dumps for composed components to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 06 2026 at 14:37):

:check: alexcrichton merged PR #14067.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 06 2026 at 14:37):

alexcrichton removed PR #14067 Fix core dumps for composed components from the merge queue.


Last updated: Aug 30 2026 at 09:07 UTC