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
subotac requested dicej for a review on PR #14067.
subotac requested wasmtime-core-reviewers for a review on PR #14067.
github-actions[bot] added the label wasmtime:api on PR #14067.
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?
subotac updated PR #14067.
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.
:memo: alexcrichton submitted PR review:
Thanks yeah. Could you leave a comment for why this conditional
getis done? Naively I don't understand why this global is missing inglobal_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?
subotac updated PR #14067.
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::
subotac commented on PR #14067:
Thanks yeah. Could you leave a comment for why this conditional
getis done? Naively I don't understand why this global is missing inglobal_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 throughMemory,
while component adapter modules can import runtime-managed globals, such as
component instance flags, thatStoreOpaque::for_each_globaldoes not
enumerate. In both cases serialization remains best-effort rather than
panicking when a resource is absent from the dump.
subotac requested alexcrichton for a review on PR #14067.
:thumbs_up: alexcrichton submitted PR review.
alexcrichton added PR #14067 Fix core dumps for composed components to the merge queue.
:check: alexcrichton merged PR #14067.
alexcrichton removed PR #14067 Fix core dumps for composed components from the merge queue.
Last updated: Aug 30 2026 at 09:07 UTC