""" clr_fatal_triage.py - first look at an x86 acclient crash dump (no debugger needed). Written for the CoreCLR fatal errors of 2026-09-29..10-12 (.NET Runtime event 1023, "internal error in the .NET Runtime at IP coreclr.dll+0x256E19", exit 0x80131506), where dotnet-dump only showed an ExecutionEngineException with no stack. For every thread it finds an exception being dispatched on (the EXCEPTION_RECORD / CONTEXT pair KiUserExceptionDispatcher leaves on the stack), it prints the exception, the faulting registers, and the return addresses on that thread's stack as module+offset. coreclr.dll offsets are named when you pass its public PDB (--pdb, fetched once from https://msdl.microsoft.com/download/symbols/coreclr.pdb//coreclr.pdb; the GUID/age are printed below). Known fatal sites are named even without it. python -I tools\\ClrFatalTriage\\clr_fatal_triage.py [--pdb coreclr.pdb] [--all-threads] [--image Name.dll=C:\\path\\to\\matching\\Name.dll] Needs Python 3 and pefile (only to read code bytes from the module files when the dump has none, which is what tells real return addresses from stale stack values). Read-only. JIT'd code has no module; those addresses print as raw hex (SOS `ip2md` resolves them when the dump holds the code heap: `dotnet-dump analyze` under the x86 dotnet host). """ import argparse import bisect import mmap import os import pickle import struct import sys # Fatal sites by coreclr.dll file version -> offset -> meaning. KNOWN_SITES = { "10.0.1226.42308": { 0x256E19: "ReversePInvokeBadTransition: a reverse P/Invoke (a managed hook/callback) was entered " "on a thread already in cooperative mode, i.e. native code running inside managed " "code's context (an exception handler / VEH on a managed fault) called a function " "with a managed detour. In the listing, the first module frame after " "JIT_ReversePInvokeEnter* (next higher address, past the stub's raw frame) is the " "native code that called the hooked function.", }, } class Dump: def __init__(self, path, images): f = open(path, "rb") self.m = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ) sig, _ver, nstreams, dirrva = struct.unpack_from("> 16, ms & 0xFFFF, ls >> 16, ls & 0xFFFF) self.mods.append((base, sz, self._str(namerva), ts, ver)) self.mods.sort() for _size, rva in self.streams.get(5, []): # MemoryListStream for i in range(struct.unpack_from(" start + dsz: return None return self.m[off + addr - start:off + addr - start + size] def u32(self, addr): b = self.read(addr, 4) return None if b is None else struct.unpack("> 3) & 7 == 2) or (b[4] == 0xFF and (b[5] >> 3) & 7 == 2) or (b[1] == 0xFF and (b[2] >> 3) & 7 == 2) or (b[0] == 0xFF and (b[1] >> 3) & 7 == 2)) def load_pdb_publics(path): """S_PUB32 records of an MSF 7.0 PDB as a sorted [(rva, name)]; cached next to the PDB.""" cache = path + ".publics.pkl" if os.path.exists(cache): return pickle.load(open(cache, "rb")) data = open(path, "rb").read() bs, _fbm, _nb, ndir, _u, bmaddr = struct.unpack_from("= 0: s += " %s+0x%X" % (pubs[i][1], off - pubs[i][0]) if off in known: s += " <== KNOWN FATAL SITE" seen_known.add(off) return s for tid, lo, hi, crva in d.threads: esp = struct.unpack_from("= 2: print(" %s of 0x%08X%s" % ({0: "read", 1: "write", 8: "execute"}.get(info[0], "?"), info[1], " (null page: a NullReferenceException if this is managed code)" if info[1] < 0x10000 else "")) print(" " + " ".join("%s=%08X" % (k, regs[k]) for k in ["eax", "ebx", "ecx", "edx", "esi", "edi", "ebp", "esp", "eip"])) print(" return addresses (esp -> stack base):") a_ = esp while a_ + 4 <= hi: v = d.u32(a_) if v is None: print(" " % a_) break s = sym(v) if s: call = d.after_call(v) if call or call is None: print(" 0x%08X: 0x%08X %s%s" % (a_, v, s, "" if call else " (no code bytes to check)")) a_ += 4 for off in sorted(seen_known): print("\nKNOWN FATAL SITE coreclr.dll+0x%X: %s" % (off, known[off])) if seen_known: print("The 2026-10-12 cause: RynthCore.SehTrampoline.dll's VEH (v1-v4) called CreateFileW while a managed\n" "NullReferenceException was being dispatched; DatFileShareHooks detours CreateFileW in managed code.") if __name__ == "__main__": main()