Repository navigation
Conversation
A run that ended in an unhandled exception saved the pipeline caches but said nothing about where the title faulted: the log had the exception code and no call chain. print_fault_stacks names the access and the address, walks the faulting thread's own chain from the exception context (the filter runs on that thread, so its stack is live), and snapshots the other threads as LEONIDA_STACKS does. On the retail package this unwound a faulting chain of six title frames out of the title's worker pool and named the read that faulted, which no earlier log did. thread_stacks_test covers it with a guarded null read captured to a file.
c243bdb to
4469914
Compare
kawaii-shakal
left a comment
There was a problem hiding this comment.
Reviewed by Claude Code (AI-assisted) on my behalf. Approving: this is the report I was missing when the title
faults.
- The fault and the faulting thread are printed first, before the compile waits and the cache write, so they come
out even if the cache write hangs. - The other threads are sampled the safe way: only system calls while a thread is suspended, and labels are
allocated before sampling. - The faulting thread is unwound on its live stack inside the
__tryofunwind_frame. That is fine from the filter.
Non-blocking ideas, which I'm happy to do as a follow-up on top of this:
- Registers of the faulting context (rip, rsp and the GPRs). With
module+RVAalone it is hard to tell which
pointer was bad. - The parameters of exceptions other than access violations, e.g. 0xE06D7363 (a C++ throw) carries the thrown
type's info. - A crash log file next to the saves or logs that keeps the report after the console window closes, plus a line
with the CPU brand and the Windows build. Intel vs AMD decides which emulated Zen 2 instructions run. - The filter now allocates (
std::string,std::vector, module lookup) where before it only printed. If the fault
came from inside the heap or while the loader's lookup mutex was held, that can hang instead of exiting. A nested
fault insidecall_oncewould block too, though that risk was already there. Not a reason to hold the PR, maybe
one comment saying so.
Not built or run here: Windows-only, so this review is from reading the code.
Generated by Claude Code
|
Verified on Windows 11 (
AI-assisted. |
|
Duplicate check (diff reading only, no build): not a duplicate. #2306 is stacked on this PR ( Heads-up: #2276 and #2306 both conflict in AI-assisted (Claude Code). |
timbot103
left a comment
There was a problem hiding this comment.
Static audit of 446991464 only. No builds, tests, or GPU runs.
- [MAJOR]
runtime/src/thread_stacks.cpp:235— If a runtime DLL load takes an unhandled access violation while adding a range underranges_mutex_(runtime/src/pe_loader.cpp:1731), the filter callsmodule_offseton that same thread before unwinding.Loader::find_addressthen waits for shared ownership of the lock the faulting thread already holds exclusively (runtime/src/pe_loader.cpp:1587). This stalls before the fault details, cache save, and filter chaining. Capture raw fault data and frame addresses in fixed storage. Use prepublished immutable data for in-filter names and move heap-allocating thread snapshots outside the filter. - [MINOR]
runtime/test/thread_stacks_test.cpp:246— The prefix assertion passes for both0 threadsandthread list failed. Keep a synchronized helper alive during the fault and verify its thread ID and a known frame in the snapshot.
AI-assisted.
A run that ends in an exception nothing handles saves the session pipeline cache but says nothing about where the fault was: the log has
unhandled exception 0xc0000005and no call chain, so a fault in the title or one of its DLLs stays a guess. This prints the fault and the threads' call chains before the caches are written.Item: none listed yet -- claimed in #1608 (see the comment linked below).
[rt] fault fatal: read of 0xf at <module>+0x...), or the exception code otherwise, with the module named by the sameshims::module_offsetthe other traces use.LEONIDA_STACKSsnapshot (snapshot_threads), so what the title's worker pool and the compile pool were doing at the fault lands in the same log.thread_stacks_testgains a guarded null read with stderr redirected to a temp file: the fault line names the access and the instruction, frame #0 is that same instruction, the chain unwinds out of the function the fault happened in to the function that called it, and the other threads are snapshotted. 19 checks, no game data.thread_stacks_teston Windows (RelWithDebInfo).