[PR #1693] windows-boot: collect private crash dumps and stack traces on request #1705

Open
opened 2026-11-26 20:22:10 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1693
Author: @sodove
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: feat/windows-boot-private-minidump


📝 Commits (1)

  • 1b9e496 windows-boot: capture private minidumps and stacks on abnormal exit

📊 Changes

6 files changed (+427 additions, -2 deletions)

View changed files

📝 runtime/CMakeLists.txt (+9 -0)
➕ runtime/test/windows_crash_fixture.cpp (+38 -0)
📝 scripts/windows-boot/README.md (+12 -0)
📝 scripts/windows-boot/boot.ps1 (+31 -2)
➕ scripts/windows-boot/crash_monitor.cpp (+204 -0)
➕ scripts/windows-boot/test_crash_monitor.py (+133 -0)

📄 Description

Claimed in the coordination issue as WIN-BOOT-PRIVATE-MINIDUMP.

What and why

A Windows boot can exit with a numeric status before the runtime writes a diagnostic. With boot.ps1 -CrashDump, a small native helper observes the child from a separate process. It passes first-chance exceptions through and records the faulting thread on an unhandled exception. An explicit nonzero exit gets an exit-time snapshot even when the exit code happens to match a Windows exception code. This also covers a case that the in-process exception handler in #994 cannot observe.

The helper writes a minidump and a best-effort stack to a fresh directory under the user's external run folder. It uses local symbols. The stack at explicit exit can already be in shutdown, and unwinding can stop in manually mapped code. Each child keeps its original exit code. The harness's own timeout produces no dump. The dump and stack are private and must stay on the machine.

Tested

  • Built the monitor and synthetic fixture with MSVC, Windows x64, RelWithDebInfo. All 10 native monitor tests passed, including two runs through the PowerShell boot entry point.
  • Verified the exception stream's code and thread ID against the stack, resolved the synthetic worker by name, and checked that an explicit exit has no exception stream. Successful runs, handled exceptions and the harness timeout produced no dump.
  • Boot trace tests passed (39), text writer checks passed (3), translator semantic suite passed (6,279 tests across 487 files). The no-game-data check passed on all six changed files.

GPUs tested: n/a (CPU-only synthetic tests).

AI-assisted: yes

Checklist

  • Based on current main and checked for conflicts.
  • One topic.
  • No game data, keys or decryption in the change, tests or report.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1693 **Author:** [@sodove](https://github.com/sodove) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/windows-boot-private-minidump` --- ### 📝 Commits (1) - [`1b9e496`](https://github.com/ubiquitarianism/leonida/commit/1b9e4969a5dc1aefd9823167d52e4325f3f9b0ac) windows-boot: capture private minidumps and stacks on abnormal exit ### 📊 Changes **6 files changed** (+427 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `runtime/CMakeLists.txt` (+9 -0) ➕ `runtime/test/windows_crash_fixture.cpp` (+38 -0) 📝 `scripts/windows-boot/README.md` (+12 -0) 📝 `scripts/windows-boot/boot.ps1` (+31 -2) ➕ `scripts/windows-boot/crash_monitor.cpp` (+204 -0) ➕ `scripts/windows-boot/test_crash_monitor.py` (+133 -0) </details> ### 📄 Description Claimed in the coordination issue as [WIN-BOOT-PRIVATE-MINIDUMP](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7156744122). ### What and why A Windows boot can exit with a numeric status before the runtime writes a diagnostic. With `boot.ps1 -CrashDump`, a small native helper observes the child from a separate process. It passes first-chance exceptions through and records the faulting thread on an unhandled exception. An explicit nonzero exit gets an exit-time snapshot even when the exit code happens to match a Windows exception code. This also covers a case that the in-process exception handler in #994 cannot observe. The helper writes a minidump and a best-effort stack to a fresh directory under the user's external run folder. It uses local symbols. The stack at explicit exit can already be in shutdown, and unwinding can stop in manually mapped code. Each child keeps its original exit code. The harness's own timeout produces no dump. The dump and stack are private and must stay on the machine. ### Tested - Built the monitor and synthetic fixture with MSVC, Windows x64, RelWithDebInfo. All 10 native monitor tests passed, including two runs through the PowerShell boot entry point. - Verified the exception stream's code and thread ID against the stack, resolved the synthetic worker by name, and checked that an explicit exit has no exception stream. Successful runs, handled exceptions and the harness timeout produced no dump. - Boot trace tests passed (39), text writer checks passed (3), translator semantic suite passed (6,279 tests across 487 files). The no-game-data check passed on all six changed files. GPUs tested: n/a (CPU-only synthetic tests). AI-assisted: yes ### Checklist - [x] Based on current main and checked for conflicts. - [x] One topic. - [x] No game data, keys or decryption in the change, tests or report. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1705
No description provided.