mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-18 23:59:59 -04:00
Keep the crash report's exception filter in place, and write the game's exit code into its log from the launcher.
The last-chance exception filter is set at the start, before the GPU driver and the other DLLs load. A DLL that sets its own filter later takes its place, and a fault in that DLL then ends the game with no FATAL line in the log. Two 0.6.0 logs from an RX 7800 XT end that way on the title screen. Once a second the filter is now put back and the module that replaced it is logged (NX2NAVI_CRASH_FILTER_GUARD, default 1). When the game ends with a nonzero code, the launcher adds that code, in hex with its meaning, to the end of logs\nx2navi.log, so a fail-fast exit that no handler in the process can see still shows in the log a player sends. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -498,8 +498,24 @@ static void cpu_placement(void) {
|
||||
plat_process_affinity(on ? one : all);
|
||||
}
|
||||
|
||||
// NX2NAVI_CRASH_FILTER_GUARD (default 1; 0 off): once a second, the crash report's last-chance exception filter is put
|
||||
// back if a DLL loaded after the start (a GPU driver, an overlay) set its own in its place. Without it, a fault in such
|
||||
// a DLL ends the process with no FATAL line in the log. The first eight replacements are logged with the module.
|
||||
static void crash_filter_guard(uint64_t frame) {
|
||||
static int on = -1, logged;
|
||||
if (on < 0) on = rt_knob("CRASH_FILTER_GUARD", "1");
|
||||
if (!on || frame % 60) return;
|
||||
char who[160];
|
||||
if (plat_crash_filter_reassert(who, sizeof who) && logged < 8) {
|
||||
logged++;
|
||||
rt_log("diag: frame %llu: an exception filter from %s had replaced the crash report's; the crash report's is "
|
||||
"back (NX2NAVI_CRASH_FILTER_GUARD)", (unsigned long long)frame, who);
|
||||
}
|
||||
}
|
||||
|
||||
void perf_present(uint64_t frame) {
|
||||
static uint64_t last, sum, max, n, win_start, ab_b;
|
||||
crash_filter_guard(frame);
|
||||
static int64_t win_prev[PERF_CNT_N];
|
||||
prof_render_tid = plat_thread_id();
|
||||
if (rt_trace & RT_TRACE_SCHED) kern_sched_report(frame);
|
||||
|
||||
Reference in New Issue
Block a user