loader: report the module and cause behind a guest fault #563
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!563
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/563/head"
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?
@psnwd on GitHub · 2026-09-11 16:45 UTC · original
psnwd:fix/runtime-linker-fault-diagnostics→main· +107 −28 · 3 files · 1 commits · closed without mergingThe fatal line for an unhandled host exception printed raw enum ordinals and a bare address, so reports arrived unusable: "access=1" means AccessViolationType::Read, not a write, and a guest pc means nothing without the module it belongs to. The guest fault context collected just above it -- thread, registers, faulting code bytes, stack top -- went to std::printf only, so it never reached the log file people attach to bug reports and was lost entirely for launcher-started runs.
Route that block through Log::WriteFatal, the path the fatal error already takes, leaving console output as it was. Resolve both the faulting pc and the faulted address to module+offset, print the exception and access types by name with the native code in hex, and call out an all-ones address as a -1 sentinel used as a pointer.
Resolving an address from the handler needs a lookup that cannot block: add RuntimeLinker::TryFindProgramByAddr, which gives up rather than wait if the thread faulted while holding the linker lock. The shared segment scan no longer asserts on a half-built program, since aborting inside a fault handler would destroy the diagnostic being collected.
Also name the unwind boundary constant in KernelGetModuleInfoForUnwind and record where it sits in the guest address space. Its value is unchanged: it has never been tied to a specific host allocation, so narrowing it without a reproduction would risk titles that currently unwind correctly.
issue: #495
@Nmzik on GitHub · 2026-10-03 13:43 UTC · original
This is debugging/dev. Lets not overcomplicate :)
Pull request closed