windows-boot: recover private stacks for manually mapped images #1772
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1772"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by sodove on 2026-11-25T11:48:06Z.
Claimed in the coordination issue as WIN-BOOT-MAPPED-IMAGE-STACK.
Depends on: #1693 (produces the private exception dump).
What and why
The initial stack can stop inside a PE that the runtime mapped outside the Windows module list. A new offline command takes the private dump and the exact mapped PE. It matches captured instructions to a unique location in an executable section, derives the actual base, and checks for a file-backed x64 unwind entry at the exception RIP. Available header and unwind bytes must agree with the local image.
The tool gives x64 CDB a fixed staging name, disables network symbols and shell commands, selects the saved exception context, and writes the recovered frames to a new private file. Console output contains the outcome and frame count. The Windows boot README documents the command and its limits, including exit-only snapshots and dumps with insufficient instruction bytes.
Tested
ed94fbef9and the current #1693 head.GPUs tested: n/a (CPU-only synthetic Windows debugging).
AI-assisted: yes
Checklist
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T11:53:18Z.
#1772 | head
056e682321(merged cleanly with main24549bdb1) |python -I tests/test_mapped_stack.py| red on main:ModuleNotFoundError: No module named 'mapped_stack'(rc=1) | green on PR+main:8 tests OK (skipped=1)| Windows 11, Python 3.12.10 | AI-assisted: yesAudited
scripts/windows-boot/mapped_stack.py,scripts/windows-boot/README.md, andtests/test_mapped_stack.py(validating local-only drive/path checks viaGetDriveTypeW, checkout-outside enforcement, minidump stream/bounds parsing, relocated mapping-base inference,.pdata/.xdatacorroboration, sanitized CDB environment/command construction, and exclusiverenamepublication;cdb.exeis not installed on this host so the 7 synthetic PE32+/minidump tests ran and the optionalLEONIDA_TEST_CDBtest skipped cleanly). Also verifiedtests/test_docs_encoding.py(1 OK),tests/test_ci_registration.py(18 OK),tests/test_runner_calls_all_tests.py(3 OK),tests/test_text_write_line_endings.py(3 OK), andscripts/check_no_game_data.py.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T13:26:13Z.
Merged after local re-verification: this PR merged onto
main1a0e77ecbwithout conflict, and its test file(s) (tests/test_mapped_stack.py) pass there. Earlier today the same tests failed onmainwithout the PR (red/green) and a bundle with other open PRs showed no new failures.check_no_game_data.pyis clean. Windows 11, Python 3.14; no GPU needed for these tests.AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes.