loader(crash): include system commit and available memory in crash reports #254

Manually merged
github merged 1 commit from gh-pr/254/head into gh-pr/254/base 2026-12-01 20:23:10 +00:00
Owner

@⁠Androtim on GitHub · 2026-11-30 12:18 UTC · original
Androtim:feat/iter248-loader-crash-system-memory → main · +42 −0 · 2 files · 1 commits · merged 2026-11-30 13:05 UTC

Summary

  • Enable Win32_System_ProcessStatus in victory-loader and query K32GetPerformanceInfo when writing unhandled crash reports to the log file (to_file).
  • Format and log the system commit total, commit limit, and available physical memory in MiB alongside the exception details to help diagnose host memory/commit exhaustion on crashes.
  • Add unit test system_memory_report_uses_the_reported_page_size covering non-4 KiB page-size scaling.

Verification

  • cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy -> asset policy: 313 files ok
  • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-loader --lib crash:: -> 21 passed; 0 failed
  • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings -> clean
  • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics -- -D warnings -> clean
**@⁠Androtim** on GitHub · 2026-11-30 12:18 UTC · [original](https://github.com/Androtim/MiniVI/pull/254) `Androtim:feat/iter248-loader-crash-system-memory` → `main` · +42 −0 · 2 files · 1 commits · merged 2026-11-30 13:05 UTC ## Summary - Enable `Win32_System_ProcessStatus` in `victory-loader` and query `K32GetPerformanceInfo` when writing unhandled crash reports to the log file (`to_file`). - Format and log the system commit total, commit limit, and available physical memory in MiB alongside the exception details to help diagnose host memory/commit exhaustion on crashes. - Add unit test `system_memory_report_uses_the_reported_page_size` covering non-4 KiB page-size scaling. ## Verification - `cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy` -> `asset policy: 313 files ok` - `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-loader --lib crash::` -> `21 passed; 0 failed` - `cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings` -> clean - `cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics -- -D warnings` -> clean
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 20:23:08 +00:00
github manually merged commit 6072cd5a4a into gh-pr/254/base 2026-12-01 20:23:10 +00:00
Author
Owner

@⁠Androtim on GitHub · 2026-11-30 13:03 UTC · original

Automated triage for the maintainers (not an approval).

Verdict: merge-candidate · CI (check): passing

Review Summary

Clean, minimal addition to unhandled crash reporting in victory-loader.

  • crates/victory-loader/Cargo.toml: Enables Win32_System_ProcessStatus on Windows for K32GetPerformanceInfo and PERFORMANCE_INFORMATION.
  • crates/victory-loader/src/crash.rs:
    • system_memory_line() initializes PERFORMANCE_INFORMATION with cb = size_of::<PERFORMANCE_INFORMATION>() as u32, checks the K32GetPerformanceInfo return value (== 0 -> None), and avoids taking any locks.
    • format_system_memory() scales page counts by info.PageSize with saturating_mul before shifting to MiB, preventing arithmetic overflow.
    • report() gates the query on to_file so benign first-chance exceptions in the VEH do not pay the syscall cost, and emits the memory line before stack unwinding so it is preserved even if unwinding faults.
    • system_memory_report_uses_the_reported_page_size unit test verifies non-4 KiB page-size scaling and output formatting.

CI is passing and no GPU-specific paths are affected. Ready to merge pending maintainer sign-off.


Generated with Antigravity CLI (agy).

**@⁠Androtim** on GitHub · 2026-11-30 13:03 UTC · [original](https://github.com/Androtim/MiniVI/pull/254#issuecomment-7279300744) <!-- minivi-triage v1 head=6072cd5a4a6ad7de9a4e1105b2af92e274672713 verdict=merge-candidate ci=passing at=2026-11-30T13:04:15Z --> Automated triage for the maintainers (not an approval). **Verdict:** `merge-candidate` · **CI (`check`):** `passing` ### Review Summary Clean, minimal addition to unhandled crash reporting in `victory-loader`. - **`crates/victory-loader/Cargo.toml`**: Enables `Win32_System_ProcessStatus` on Windows for `K32GetPerformanceInfo` and `PERFORMANCE_INFORMATION`. - **`crates/victory-loader/src/crash.rs`**: - `system_memory_line()` initializes `PERFORMANCE_INFORMATION` with `cb = size_of::<PERFORMANCE_INFORMATION>() as u32`, checks the `K32GetPerformanceInfo` return value (`== 0` -> `None`), and avoids taking any locks. - `format_system_memory()` scales page counts by `info.PageSize` with `saturating_mul` before shifting to MiB, preventing arithmetic overflow. - `report()` gates the query on `to_file` so benign first-chance exceptions in the VEH do not pay the syscall cost, and emits the memory line before stack unwinding so it is preserved even if unwinding faults. - `system_memory_report_uses_the_reported_page_size` unit test verifies non-4 KiB page-size scaling and output formatting. CI is passing and no GPU-specific paths are affected. Ready to merge pending maintainer sign-off. --- _Generated with Antigravity CLI (`agy`)._
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
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
github/Androtim--MiniVI!254
No description provided.