Support core dump on snapshots created from snapshot/disk#1618
Open
ludfjig wants to merge 4 commits into
Open
Conversation
3b7d824 to
eb959f4
Compare
Contributor
There was a problem hiding this comment.
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_actionand thread it through snapshot restore and VM setup paths. - Persist a new
original_entrypoint/original_entrypoint_addrfield (with backward-compatible deserialization) so core-dump code can emit a correctAT_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. |
eb959f4 to
86d5129
Compare
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
84b8d28 to
f22567a
Compare
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>
f22567a to
f9c4e58
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.