mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:15:51 +01:00
[PR #2306] runtime: a fatal fault's report names its registers and host, and is kept in a crash log (RT-CRASH-LOG) #2310
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2310
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2306
Author: @Tyrannys
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:rt-crash-log📝 Commits (3)
4469914runtime: print the call chain of a fatal fault4be6853runtime: a fatal fault's report names its registers and host, and is kept in a crash log (RT-CRASH-LOG)c2dc711Merge remote-tracking branch 'upstream/main' into rt-crash-log📊 Changes
8 files changed (+573 additions, -6 deletions)
View changed files
📝
runtime/CMakeLists.txt(+4 -0)📝
runtime/README.md(+1 -0)➕
runtime/src/crash_report.h(+150 -0)📝
runtime/src/main.cpp(+6 -2)📝
runtime/src/thread_stacks.cpp(+197 -3)📝
runtime/src/thread_stacks.h(+7 -0)➕
runtime/test/crash_report_test.cpp(+87 -0)📝
runtime/test/thread_stacks_test.cpp(+121 -1)📄 Description
Claimed in the coordination issue as: RT-CRASH-LOG (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7193120655)
Depends on: #2276
What and why
This is @kawaii-shakal's
crash-logbranch (commit4be68530, their finding in #1608), built and tested on Windows. Their commits are kept as they are; this PR adds only a merge of currentmain.kawaii-shakal's work (
4be68530, on top of #2276'sprint_fault_stacks): a fatal fault's report from #2276 went to stderr only, so it was lost once the console closed, and it lacked the registers, the host and what a non-access-violation exception carries. With this:RtlGetVersion, CPU brand from CPUID) are printed as[rt] faultlines;__try), an in-page error's status, or the raw parameters;%LOCALAPPDATA%\Leonida\crashes.log(Win32 calls only), or to the fileLEONIDA_CRASH_LOGnames;LEONIDA_CRASH_LOG=0turns the file off;src/crash_report.hand checked bycrash_report_test;thread_stacks_testpoints the crash log at a temp file and checks its content; the variable is documented inruntime/README.md.Windows fixes on top: none were needed. MSVC 19.52 compiles
thread_stacks.cpp,thread_stacks_test.cpp,crash_report_test.cppandgta6rtwith no errors and no warnings in these files at/W4 /permissive-.Tested
Windows 11 (10.0.26300), MSVC 19.52.37029, Ninja RelWithDebInfo, AMD Ryzen 7 9800X3D:
ctest -R "thread_stacks|crash_report": 2/2 pass.thread_stacks_testtakes a real null read throughprint_fault_stacksand checks the temp crash log holds the dated header, the fault, the faulting thread's chain and the other threads.thread_stacks.cpp, with an unhandled-exception filter callingprint_fault_stacksand returningEXCEPTION_CONTINUE_SEARCH, run withLOCALAPPDATApointed at a temp folder:Leonida\crashes.logunder it with the header,read of 0x14 at host:fault.exe+0x..., the registers,host: Windows 10.0.26300, CPU AMD Ryzen 7 9800X3D 8-Core Processorand the chain;C++ exception: object ..., throw info ..., type .?AUMyError@@;LEONIDA_CRASH_LOG=0the report still goes to stderr and no file is created.tests/test_ctest_registration.pyandscripts/check_no_game_data.pypass.GPUs tested: n/a (CPU tests)
AI-assisted: yes (Claude Code). The original branch was also written with Claude Code, as kawaii-shakal noted in #1608.
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.