Skip to content

Support core dump on snapshots created from snapshot/disk#1618

Open
ludfjig wants to merge 4 commits into
hyperlight-dev:mainfrom
ludfjig:crashdump-pie-entrypoint
Open

Support core dump on snapshots created from snapshot/disk#1618
ludfjig wants to merge 4 commits into
hyperlight-dev:mainfrom
ludfjig:crashdump-pie-entrypoint

Conversation

@ludfjig

@ludfjig ludfjig commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Closes #1617 by fixing symbol resolution for sandboxes created from snapshots. The binary path is left empty, but this is on purpose, I don't think there's any advantage of plumbing through and saving the file name.

Note that no snapshot version bump is needed, this is a backwards compatible change (old snapshots continue to load and work fine)

please review commit by commit.

Copilot AI review requested due to automatic review settings July 2, 2026 18:07
@ludfjig ludfjig force-pushed the crashdump-pie-entrypoint branch from 3b7d824 to eb959f4 Compare July 2, 2026 18:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to make guest core dumps usable for sandboxes restored from on-disk snapshots by preserving the original ELF entry point across the Initialise -> Call transition and across snapshot save/restore, so AT_ENTRY can be populated correctly for PIE symbol resolution in debuggers (per #1617).

Changes:

  • Rename the snapshot/VM “entrypoint” state to next_action and thread it through snapshot restore and VM setup paths.
  • Persist a new original_entrypoint/original_entrypoint_addr field (with backward-compatible deserialization) so core-dump code can emit a correct AT_ENTRY.
  • Add a GDB-based regression test ensuring symbol resolution works for crash dumps produced from snapshot-created sandboxes.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/hyperlight_host/src/sandbox/uninitialized_evolve.rs Use mgr.original_entrypoint to seed runtime crashdump config; pass mgr.next_action into VM creation.
src/hyperlight_host/src/sandbox/snapshot/mod.rs Rename entrypoint to next_action; add/persist original_entrypoint and accessors.
src/hyperlight_host/src/sandbox/snapshot/file/mod.rs Include original_entrypoint in on-disk config and restore it when loading snapshots.
src/hyperlight_host/src/sandbox/snapshot/file/config.rs Add original_entrypoint_addr with #[serde(default)] for backward-compatible snapshot config reads.
src/hyperlight_host/src/sandbox/initialized_multi_use.rs Update restore/snapshot paths to use next_action and VM get/set_next_action.
src/hyperlight_host/src/mem/mgr.rs Track next_action plus original_entrypoint in the memory manager and propagate into snapshots/restores.
src/hyperlight_host/src/hypervisor/hyperlight_vm/x86_64.rs Rename VM field to next_action; use runtime-config entry point for crashdump AT_ENTRY behavior.
src/hyperlight_host/src/hypervisor/hyperlight_vm/mod.rs Rename VM field and accessor methods to next_action.
src/hyperlight_host/src/hypervisor/hyperlight_vm/aarch64.rs Rename VM field to next_action and update initialization/dispatch logic accordingly.
src/hyperlight_host/examples/crashdump/main.rs Add a new GDB-based test validating symbol resolution for crash dumps generated from snapshot-created sandboxes.

Comment thread src/hyperlight_host/src/sandbox/snapshot/mod.rs Outdated
Comment thread src/hyperlight_host/src/hypervisor/hyperlight_vm/mod.rs Outdated
Comment thread src/hyperlight_host/src/sandbox/snapshot/file/config.rs
Comment thread src/hyperlight_host/examples/crashdump/main.rs
@ludfjig ludfjig force-pushed the crashdump-pie-entrypoint branch from eb959f4 to 86d5129 Compare July 2, 2026 18:20
@ludfjig ludfjig added the kind/bugfix For PRs that fix bugs label Jul 2, 2026
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
@ludfjig ludfjig force-pushed the crashdump-pie-entrypoint branch 2 times, most recently from 84b8d28 to f22567a Compare July 2, 2026 18:34
@ludfjig ludfjig added the ready-for-review PR is ready for (re-)review label Jul 2, 2026
ludfjig added 3 commits July 2, 2026 14:50
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
@ludfjig ludfjig force-pushed the crashdump-pie-entrypoint branch from f22567a to f9c4e58 Compare July 2, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bugfix For PRs that fix bugs ready-for-review PR is ready for (re-)review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support core dumps for sandboxes created from snapshots

2 participants