fix(capture): a crash is a crash report of this game or the engine crash reporter it started (beta.14 PR-5) (#267)

Owner request 2026-10-05 (prevention; example SILENT HILL 2, UE 5.1), and a false crash found on the
owner's ledger: The Witcher 3, 2026-10-04, exit code 0, stored crashed by a WER 1001
RADAR_PRE_LEAK_64 (Windows' memory-leak detector) whose P1 named witcher3.exe.

E1 - CrashEventMatcher (pure): a 1000 from "Application Error" counts only when its AppName [0] equals
the executable's, its AppPath [10] (when given) is the executable's, and its ProcessId [8] (typed)
is the session's pid; a 1001 from "Windows Error Reporting" only when EventName [2] is a crash report
(APPCRASH, BEX, BEX64, CLR20r3, MoAppCrash, MoBEX) and P1 [5] equals the name. EventLogCrashSource
filters by provider in the XPath and asks the matcher; ICrashEventSource.FoundCrash(CrashQuery).
Checked once against the owner's real Application log: the Witcher 3 window no longer matches.

E2 - CrashReporterWitness, fed by the watcher's 1 s snapshots (CaptureOrchestrator.PollOnceAsync):
every on-crash reporter (CrashReporterCatalog: CrashReportClient, CrashReporter, CrashReport,
BsSndRpt/BsSndRpt64) with its parent by pid, image and start (a pid reused by a later process is not
the parent); always-on handlers (UnityCrashHandler64/32, crashpad_handler) never. SessionRecorder asks
at the end (two more polls when the game just left, at most 2.5 s); CrashReporterRule counts it when it
started >= 10 s after the game and the game left within 60 s: crashed, notes crash_reporter=<image>;
otherwise a note crash_reporter_seen=. Unreal's crash (exit code 3, no event) is crashed now. No
process is opened. Formats.ExitText names the reporter (string en/vi/ja).

E4 - ExecutableLocator: "bssndrpt" and "bugsplat" are helper fragments (KCD2 picked its game by rank).

Privacy Policy 2.7 (section 4): the Application log's crash reports about a tracked game, and the names
of programs a tracked game starts (the first was read since P2 and not stated).

Tests: CrashEventMatcherTests (the real RADAR record shape, a hang, a name inside another, pid and path
ties, typed and hex values), CrashReporterWitnessTests, CrashReporterRuleTests, SessionRecorderTests
(exit code 3 + reporter = crashed and named; a game that kept running = note only), ExitStatusMapper,
CaptureNotes, ReasonText (ExitText), ExecutableLocator, EventLogCrashSource.

Docs: 04_CAPTURE (crash classification corrected in place), 19_SAFETY (crash safety), 06_DATA_MODEL
(note slots), LIMITATIONS (When a game crashed), CHANGELOG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
poli0981andClaude Opus 5.5 authored and GitHub committed 2026-10-06 03:54:05 +07:00
1 parent 101b6cf4d3
commit 1f7aebd0a4
39 files changed
+743 -59

No files matched your search

+10
View File
@@ -36,6 +36,16 @@ numeric core and does not move; the heading is the full version — corrected 20
### Fixed
- **A session could read "crashed" when the game had not crashed, and an Unreal game's crash read "ended normally".**
Any Windows report that named the game counted as a crash — on the developer's machine a memory-leak report Windows
writes about large games marked an ordinary The Witcher 3 session *crashed*; hang reports and another program whose
name contains the game's would have done the same. Only a crash report of this game's own process counts now. And
Unreal Engine games handle their own crash: they open their crash reporter and exit with code 3, which said nothing;
FrameLedger now sees the crash reporter a game starts (Unreal's, CD PROJEKT RED's, Capcom's, BugSplat's) and records
the session as crashed when the game exits within a minute of it — the summary names the reporter. Unity's and
Chromium's crash handlers start with their game and are never taken for a crash. Sessions already stored keep their
status. BugSplat's sender (Kingdom Come: Deliverance II) can no longer be picked as a game's executable by the import.
The Privacy Policy (2.7) now says that FrameLedger reads Windows' crash reports and the names of programs a game starts.
- **A game that exited as FrameLedger's anti-cheat check ran could be recorded as "unhooked (safety)"** — and, under a
user-mode anti-cheat exception, end the exception's trial for good. The check reads every process in the game's
tree every 30 s; one that was just starting (an engine's crash reporter as its game dies, any helper the game launched
+12
View File
@@ -39,6 +39,18 @@ Windows, outside the game) and why nothing was measured.** Every
frame-rate, upscaler, frame-generation and ray-tracing value reads **N/A**, never 0. How the game's window was
shown is recorded too, from outside the game. ([Capture](docs/04_CAPTURE.md))
## When a game crashed
- A session reads **crashed** when the game ended with an exception's code, when Windows logged a crash report of it,
or — since 0.1.0-beta.14 — when it started its engine's crash reporter (Unreal's, CD PROJEKT RED's, Capcom's,
BugSplat's) and exited within a minute. A game that handles its own crash quietly, starts no reporter and leaves no
crash report reads **ended normally**, with its exit code.
- A crash reporter is seen from a once-a-second look at running programs: one that opens and closes faster can be
missed, and one started in the game's first 10 seconds is not counted (it could be a monitor that starts with the
game). Unity's crash handler and Chromium's `crashpad_handler` start with every game that has them, so their presence
says nothing. Sessions recorded before 0.1.0-beta.14 keep how they were stored — a few of them may read *crashed*
because Windows logged a memory report about the game. ([details](docs/04_CAPTURE.md))
## Frame rate and frame generation
- **One inflated number is never shown.** When frame generation is measured, the page shows the game's own
+20 -1
View File
@@ -437,7 +437,26 @@ because a layer cannot leave a running game's loader chain.
## Crash & exit classification
- Normal: presenting PID exit code 0 — **and since beta.8 any exit code that is not an exception's** (End task and taskkill leave 1; a program's own error exit; Ctrl+C's `0xC000013A`), kept in `capture_notes` and said as what it is.
- `crashed`: ~~nonzero exit code~~ **an exception's exit code** (`ExitStatusMapper.IsExceptionCode`: NTSTATUS `0xC0000000–0xC0FFFFFF` but `0xC000013A`, `0xE06D7363` C++, `0xE0434352` .NET, `0x80000003` breakpoint), **or** an Application Error (1000) / WER (1001) event log record naming the exe within `[start, end + 30 s]`.
- `crashed`: ~~nonzero exit code~~ **an exception's exit code** (`ExitStatusMapper.IsExceptionCode`: NTSTATUS `0xC0000000–0xC0FFFFFF` but `0xC000013A`, `0xE06D7363` C++, `0xE0434352` .NET, `0x80000003` breakpoint), **or** an Application Error (1000) / WER (1001) event log record ~~naming the exe~~ **that is a crash report of this game** within `[start, end + 30 s]`, **or** (beta.14) an engine's crash reporter the game started before it left.
> **Corrected 2026-10-05 (beta.14, the crash-reporter question): the event-log witness was too broad, and one engine's
> crashes had no witness at all.** A record counted when any of its strings *contained* the executable's name: on the
> owner's machine a WER 1001 `RADAR_PRE_LEAK_64` — Windows' memory-leak detector — named `witcher3.exe` and a session
> that ended with exit code 0 was stored `crashed` (2026-10-04, read from a copy of the ledger and the event log); a hang
> report, another program whose name contains this one's, or a crash of a same-image child would have done the same.
> `CrashEventMatcher` now takes a 1000 from `Application Error` only when its application name equals the executable's,
> its path (when given) is the executable's and its process id is the session's, and a 1001 from `Windows Error
> Reporting` only when it is a crash report (`APPCRASH`, `BEX`, `BEX64`, `CLR20r3`, `MoAppCrash`, `MoBEX`) whose first
> parameter is the executable's name. And Unreal handles its own crash — it starts `CrashReportClient.exe` and exits
> with code 3, no exception code and no event — so it read `normal`. The watcher's once-a-second snapshots now record
> every **on-crash** reporter a process starts (`Watch.CrashReporterCatalog`: Unreal's `CrashReportClient.exe`,
> REDengine's `CrashReporter.exe`, RE Engine's `CrashReport.exe`, BugSplat's `BsSndRpt(64).exe`) with its parent by pid,
> image and start (`CrashReporterWitness` — a pid reused by a later process is not the parent); the recorder asks at the
> end, after two more polls when the game just left. It counts (`CrashReporterRule`) when it started at least 10 s after
> the game and the game left within 60 s of it: `crashed`, with `crash_reporter=<image>` in the notes. A reporter whose
> game kept running is a note (`crash_reporter_seen=`). **Always-on handlers never count** — Unity's
> `UnityCrashHandler64.exe` and `crashpad_handler.exe` start with their game. No process is opened for any of this.
> Sessions stored before beta.14 keep their status.
- `unhooked_safety`: the guard fired mid-session. *(Since beta.14, D48: a re-scan that refused only because it could not
read the game's tree, concluded after the game itself had exited, is the game's exit instead — `normal` or `crashed` by
its exit code — with `scan_at_exit=<reason>` in `capture_notes`; `19_SAFETY` §During a session.)*
+3 -1
View File
@@ -197,7 +197,9 @@ CREATE TABLE sessions (
started_at INTEGER NOT NULL, ended_at INTEGER NOT NULL, duration_s REAL NOT NULL,
capture_tier INTEGER NOT NULL, -- 1 = hooked, 2 = not hooked; CHECK (capture_tier IN (1,2))
capture_notes TEXT, -- why tier degraded, late_attach, etc.
capture_notes TEXT, -- why tier degraded, late_attach, etc.; beta.14 adds crash_reporter= /
-- crash_reporter_seen= (an engine's crash reporter the game started) and
-- scan_at_exit= (D48: a re-scan that could not read as the game exited)
late_attach INTEGER NOT NULL DEFAULT 0,
telemetry_source TEXT, -- composite descriptor, e.g. 'l1+lhm+nvapi' (18_GPU_VENDOR_APIS)
overlay_build_id TEXT, -- native DLL build that produced this data
+5
View File
@@ -1100,6 +1100,11 @@ outlives a rules change, a game update and *Change executable*; §What a finding
## Crash & stability safety
- Two crashes of the same game within 60 s of injection ⇒ hooking auto-disabled for that game, UI explains, Tier-2 takes over. Recorded in `games.hook_autodisabled_reason`. *"Crash" here is any abnormal end: since beta.8 a session whose exit code is not an exception's (End task's 1) is `normal` on its row, and this policy still counts it inside the window — a hang our hook caused, ended by the user, is the case it exists for. The row's reason says "ended abnormally twice within 60 s of injection" (`04_CAPTURE` §Crash & exit classification).*
- **What reads as a crash changed in beta.14, in both directions** (`04_CAPTURE` §Crash & exit classification): a
Windows report that is not a crash (a memory-leak or hang report) no longer makes one, and an engine's crash reporter
started by a game that then left does — Unreal's crash ended with exit code 3 and read `normal`. Both feed this policy,
the D33 lapse and D38's trial as `crashed` always has: an Unreal game that crashes under a user-mode exception ends it
now, where before beta.14 the crash went unseen; a leak report no longer ends one.
- The Overlay DLL self-disables after 3 faults in hook bodies (`17_HOOK_ENGINE` §Fault policy) and reports it.
- Every hooked session writes a breadcrumb file before injection~~; if the game process dies before the first frame record arrives, the next run is recorded as suspect~~ *(corrected 2026-10-04: no "suspect" mark exists; the breadcrumb is the `.partial` file, and an early death counts toward the two-within-60-s auto-disable above)*.
+2 -2
View File
@@ -1,6 +1,6 @@
# FrameLedger — Privacy Policy
**Version:** 2.6 · **Effective:** {{RELEASE_DATE}}
**Version:** 2.7 · **Effective:** {{RELEASE_DATE}}
**Short version: everything stays on your PC. FrameLedger has no accounts, no telemetry, no analytics, and never uploads your data anywhere.**
@@ -39,7 +39,7 @@ An exported session (CSV or JSON) and a bug report can contain your games' names
## 4. What the app can technically observe
To do its job, FrameLedger observes: which of *your tracked* executables — the entries in your library whose recording is on — are running, and their process trees; the parameters your games pass to the graphics APIs it intercepts (presentation, upscaling, ray tracing, pipeline creation); the memory use of a tracked game's process — its dedicated and shared video memory, from Windows' GPU performance counters, and its working sets and commit, from Windows' process-memory information, for which a game it does not inject into is opened with the least access Windows offers and closed again (never its memory's content); loaded module names of a game being captured (for detection and for the anti-cheat safety check); the names of the files in each library game's install folder, the version information of its executable and of the upscaling libraries it ships, the content of its executable file (the markers of the engine and of the graphics libraries it carries, the libraries it imports, and the engine build name an Unreal Engine game carries), and the store files that name it (Steam's and GOG's, on your disk) — to detect its engine, its engine version and its features and to check it for anti-cheat before any injection is possible; the size, position and state of a tracked game's window and the monitor it is on, read from Windows and not from the game, and — for a game FrameLedger injects into — whether the game asked for exclusive full-screen; the NVIDIA driver's settings for your tracked executables (read only: the DLSS and frame-generation overrides the NVIDIA App set); hardware sensor values from your graphics driver's own libraries; and how busy the processor is and how much memory is in use, from Windows' own counters.
To do its job, FrameLedger observes: which of *your tracked* executables — the entries in your library whose recording is on — are running, and their process trees; the parameters your games pass to the graphics APIs it intercepts (presentation, upscaling, ray tracing, pipeline creation); the memory use of a tracked game's process — its dedicated and shared video memory, from Windows' GPU performance counters, and its working sets and commit, from Windows' process-memory information, for which a game it does not inject into is opened with the least access Windows offers and closed again (never its memory's content); loaded module names of a game being captured (for detection and for the anti-cheat safety check); the names of the files in each library game's install folder, the version information of its executable and of the upscaling libraries it ships, the content of its executable file (the markers of the engine and of the graphics libraries it carries, the libraries it imports, and the engine build name an Unreal Engine game carries), and the store files that name it (Steam's and GOG's, on your disk) — to detect its engine, its engine version and its features and to check it for anti-cheat before any injection is possible; the size, position and state of a tracked game's window and the monitor it is on, read from Windows and not from the game, and — for a game FrameLedger injects into — whether the game asked for exclusive full-screen; the NVIDIA driver's settings for your tracked executables (read only: the DLSS and frame-generation overrides the NVIDIA App set); hardware sensor values from your graphics driver's own libraries; how busy the processor is and how much memory is in use, from Windows' own counters; the crash reports Windows keeps in its Application log about a tracked game's executable while it ran (to tell a crash from an ordinary exit — the reports are read, never sent anywhere); and the names of the programs a tracked game starts, so that a game's own crash reporter is recognised.
It does **not** read game memory outside those API parameters, and does not read game saves, chat, input content, network traffic, or anything unrelated to performance measurement. It records only for programs you added to your library and did not switch recording off for — a program whose recording is off is not watched at all — and injects only into games you individually enabled.
@@ -43,6 +43,7 @@ internal sealed class AgentRecording
private readonly IOverlayToleranceChannel _tolerance;
private readonly WindowGeometryProbe _display = new();
private readonly UserModeExceptionLapsePolicy _exceptionLapse;
private readonly ICrashReporterSightings _reporters;
public AgentRecording(
IGameConsentStore store,
@@ -66,8 +67,10 @@ internal sealed class AgentRecording
IDriverProfileSource profiles,
IUserModeExceptionSwitch exceptions,
IOverlayToleranceChannel tolerance,
UserModeExceptionLapsePolicy exceptionLapse)
UserModeExceptionLapsePolicy exceptionLapse,
ICrashReporterSightings reporters)
{
_reporters = reporters;
_profiles = profiles;
_exceptions = exceptions;
_tolerance = tolerance;
@@ -123,7 +126,8 @@ internal sealed class AgentRecording
_observer,
_policy,
_profiles,
_exceptionLapse);
_exceptionLapse,
_reporters);
}
/// <summary>L1 + L2 + L3 under the composite, one poller per session; the poller owns and disposes the layers. The interval is the session's (<c>telemetry.interval_ms</c>, D16).</summary>
@@ -94,14 +94,7 @@ internal static class AgentServices
services.AddSingleton<IRuntimeModuleSnapshot>(static _ => new RuntimeModuleSnapshot(CensusNames.ModuleFileNames));
AddNvidia(services);
// The recorder's adapters (PR-D).
services.AddSingleton<IPartialSessionStore>(_ => new PartialSessionStore(paths.Tmp));
services.AddSingleton<ICrashEventSource, EventLogCrashSource>();
services.AddSingleton<IHardwareSnapshotSource>(static _ => new HardwareSnapshotSource(new DxgiAdapters()));
services.AddSingleton<ISeriesCodec, DeflateSeriesCodec>();
services.AddSingleton<SessionFinalizer>();
services.AddSingleton(static sp => new PartialRecovery(sp.GetRequiredService<IPartialSessionStore>(), sp.GetRequiredService<SessionFinalizer>()));
services.AddSingleton<AgentRecording>();
AddRecording(services, paths);
// The watcher (this PR): snapshots, identity, and the orchestrator over an unbounded recorder.
services.AddSingleton<IProcessSnapshotSource, ToolhelpProcessSnapshotSource>();
@@ -115,6 +108,20 @@ internal static class AgentServices
return services;
}
/// <summary>The recorder's adapters (PR-D), and since beta.14 the witness of engine crash reporters the watcher feeds and the recorder asks.</summary>
private static void AddRecording(IServiceCollection services, AgentPaths paths)
{
services.AddSingleton<IPartialSessionStore>(_ => new PartialSessionStore(paths.Tmp));
services.AddSingleton<ICrashEventSource, EventLogCrashSource>();
services.AddSingleton<CrashReporterWitness>();
services.AddSingleton<ICrashReporterSightings>(static sp => sp.GetRequiredService<CrashReporterWitness>());
services.AddSingleton<IHardwareSnapshotSource>(static _ => new HardwareSnapshotSource(new DxgiAdapters()));
services.AddSingleton<ISeriesCodec, DeflateSeriesCodec>();
services.AddSingleton<SessionFinalizer>();
services.AddSingleton(static sp => new PartialRecovery(sp.GetRequiredService<IPartialSessionStore>(), sp.GetRequiredService<SessionFinalizer>()));
services.AddSingleton<AgentRecording>();
}
/// <summary>
/// D33 (owner decision 2026-09-26): the user-mode exception's option (one row in <c>settings</c>), its channel to the
/// Overlay (<c>Local\FrameLedger.Tolerate.&lt;pid&gt;</c>, created before an injection under it), and the policy that ends
@@ -238,7 +245,8 @@ internal static class AgentServices
static line => Serilog.Log.Information("{Line}", line),
sp.GetRequiredService<ILaunchRecorderFactory>(),
sp.GetRequiredService<ExecutableRelocator>(),
sp.GetRequiredService<LatestProcessSnapshot>()));
sp.GetRequiredService<LatestProcessSnapshot>(),
sp.GetRequiredService<CrashReporterWitness>()));
services.AddSingleton<ILaunchRecorderFactory, AgentLaunches>();
}
+5 -2
View File
@@ -407,13 +407,16 @@ public static class Formats
/// <summary>
/// How a session ended, in words (beta.8): a crash names its exception ("crashed (0xC0000005 access violation)"), an
/// exit code that is not one is an ordinary end with its code — End task's 1 said as what it is — and the other
/// statuses keep their words.
/// statuses keep their words. Since beta.14 a crash witnessed by the engine's crash reporter names it ("crashed (the
/// game started its crash reporter, CrashReportClient.exe)"): the exception's code first, then the reporter, then the log.
/// </summary>
public static string ExitText(ExitStatus status, CaptureNotes notes) => status switch
{
ExitStatus.Crashed => notes.ExitCode is { } code && ExitStatusMapper.IsExceptionCode(code)
? string.Format(CultureInfo.CurrentCulture, Strings.Exit_Crashed_Format, ExceptionName(code))
: Strings.Exit_CrashEvent,
: notes.CrashReporter is { Length: > 0 } reporter
? string.Format(CultureInfo.CurrentCulture, Strings.Exit_CrashReporter_Format, reporter)
: Strings.Exit_CrashEvent,
ExitStatus.Normal => notes.ExitCode switch
{
null or 0 => Strings.Exit_EndedNormally,
+3
View File
@@ -304,6 +304,7 @@ public static class Strings
nameof(Exit_Crashed),
nameof(Exit_Crashed_Format),
nameof(Exit_CrashEvent),
nameof(Exit_CrashReporter_Format),
nameof(Exit_Degraded),
nameof(Exit_EndedNormally),
nameof(Exit_Ex_AccessViolation),
@@ -1538,6 +1539,8 @@ public static class Strings
public static string Exit_CrashEvent => ResourceManager.GetString(nameof(Exit_CrashEvent), Culture) ?? nameof(Exit_CrashEvent);
public static string Exit_CrashReporter_Format => ResourceManager.GetString(nameof(Exit_CrashReporter_Format), Culture) ?? nameof(Exit_CrashReporter_Format);
public static string Exit_Degraded => ResourceManager.GetString(nameof(Exit_Degraded), Culture) ?? nameof(Exit_Degraded);
public static string Exit_EndedNormally => ResourceManager.GetString(nameof(Exit_EndedNormally), Culture) ?? nameof(Exit_EndedNormally);
+4
View File
@@ -3861,4 +3861,8 @@
<value>{0} は FrameLedger が計測したゲームにまだ読み込まれているため、更新は途中で失敗します。そのゲームを終了してから、再起動して更新してください。</value>
<comment>review</comment>
</data>
<data name="Exit_CrashReporter_Format" xml:space="preserve">
<value>クラッシュ(ゲームがクラッシュ レポーター {0} を起動しました)</value>
<comment>review</comment>
</data>
</root>
+3
View File
@@ -2906,4 +2906,7 @@ The documents below are the full terms; this summary does not replace them.</val
<data name="Update_PayloadInUse_Format" xml:space="preserve">
<value>{0} is still loaded in a game FrameLedger measured, and the update would fail half way. Close that game, then restart to update.</value>
</data>
<data name="Exit_CrashReporter_Format" xml:space="preserve">
<value>crashed (the game started its crash reporter, {0})</value>
</data>
</root>
+3
View File
@@ -2901,4 +2901,7 @@ Các văn bản bên dưới là điều khoản đầy đủ; bản tóm tắt
<data name="Update_PayloadInUse_Format" xml:space="preserve">
<value>{0} vẫn đang được nạp trong một game mà FrameLedger đã đo, và bản cập nhật sẽ thất bại giữa chừng. Hãy đóng game đó, rồi khởi động lại để cập nhật.</value>
</data>
<data name="Exit_CrashReporter_Format" xml:space="preserve">
<value>bị crash (game đã mở trình báo lỗi crash của nó, {0})</value>
</data>
</root>
@@ -46,6 +46,12 @@ public readonly record struct CaptureNotes(string? End, string? GuardReason, str
/// </summary>
public string? ScanAtExit { get; init; }
/// <summary>beta.14: the crash reporter the game started that made the session crashed (<c>crash_reporter=</c>), or null.</summary>
public string? CrashReporter { get; init; }
/// <summary>beta.14: a crash reporter the game started that did not count — the game kept running (<c>crash_reporter_seen=</c>).</summary>
public string? CrashReporterSeen { get; init; }
public static CaptureNotes Parse(string? notes)
{
if (string.IsNullOrWhiteSpace(notes))
@@ -53,7 +59,7 @@ public readonly record struct CaptureNotes(string? End, string? GuardReason, str
return default;
}
string? end = null, reason = null, family = null, signal = null, acException = null, scanAtExit = null;
string? end = null, reason = null, family = null, signal = null, acException = null, scanAtExit = null, reporter = null, reporterSeen = null;
int? exitCode = null, launchError = null;
bool crashEvent = false;
foreach (string raw in notes.Split(';'))
@@ -87,6 +93,14 @@ public readonly record struct CaptureNotes(string? End, string? GuardReason, str
{
scanAtExit = Blank(part[_scanAtExitPrefix.Length..]);
}
else if (part.StartsWith(_reporterPrefix, StringComparison.Ordinal))
{
reporter = Blank(part[_reporterPrefix.Length..]);
}
else if (part.StartsWith(_reporterSeenPrefix, StringComparison.Ordinal))
{
reporterSeen = Blank(part[_reporterSeenPrefix.Length..]);
}
}
return new CaptureNotes(end, reason, family, signal)
@@ -96,6 +110,8 @@ public readonly record struct CaptureNotes(string? End, string? GuardReason, str
LaunchError = launchError,
AcExceptionFamily = acException,
ScanAtExit = scanAtExit,
CrashReporter = reporter,
CrashReporterSeen = reporterSeen,
};
}
@@ -145,6 +161,10 @@ public readonly record struct CaptureNotes(string? End, string? GuardReason, str
private const string _scanAtExitPrefix = "scan_at_exit=";
private const string _reporterPrefix = "crash_reporter=";
private const string _reporterSeenPrefix = "crash_reporter_seen=";
private static string Clean(string? s) => string.IsNullOrEmpty(s) ? string.Empty : s.Replace(';', ',');
private static string? Blank(string s) => s.Length > 0 ? s : null;
@@ -0,0 +1,94 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Globalization;
namespace FrameLedger.Application.Recording;
/// <summary>
/// Whether an Application-log record is a crash of THIS session's game (beta.14). Until then a record with id 1000 or 1001
/// counted when any of its strings CONTAINED the executable's name: Windows' memory-leak report (<c>RADAR_PRE_LEAK_64</c>, a
/// WER 1001 naming <c>witcher3.exe</c>) marked a session that ended with exit code 0 as crashed on the owner's machine, and so
/// would a hang report, another program's crash whose name contains this one's (<c>Game.exe</c> in <c>MyGame.exe</c>), or a
/// crash of a same-image child. Now:
/// <list type="bullet">
/// <item>1000 from <c>Application Error</c>: the faulting application's name equals the executable's, its path (when given)
/// is the executable's, and its process id (when the session held one) is the session's.</item>
/// <item>1001 from <c>Windows Error Reporting</c>: the report is a crash (<see cref="CrashReports"/>) and its first parameter
/// equals the executable's name.</item>
/// </list>
/// The indices are Windows' own templates (read on Windows 11 with <c>Get-WinEvent -ListProvider</c>): 1000 [0] AppName,
/// [8] ProcessId, [10] AppPath; 1001 [2] EventName, [5] P1. Pid and creation time are typed values, not strings.
/// </summary>
public static class CrashEventMatcher
{
public const string ApplicationErrorProvider = "Application Error";
public const string WerProvider = "Windows Error Reporting";
/// <summary>The WER event names that are a crash; a hang (<c>AppHangB1</c>) or a leak report (<c>RADAR_PRE_LEAK_*</c>) is not.</summary>
public static IReadOnlySet<string> CrashReports { get; } = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{
"APPCRASH", "BEX", "BEX64", "CLR20r3", "MoAppCrash", "MoBEX",
};
public static bool Matches(CrashLogRecord record, CrashQuery query)
{
ArgumentNullException.ThrowIfNull(record);
ArgumentNullException.ThrowIfNull(query);
return record.EventId switch
{
1000 when string.Equals(record.Provider, ApplicationErrorProvider, StringComparison.OrdinalIgnoreCase) => ApplicationError(record.Properties, query),
1001 when string.Equals(record.Provider, WerProvider, StringComparison.OrdinalIgnoreCase) => WerCrash(record.Properties, query),
_ => false,
};
}
private static bool ApplicationError(IReadOnlyList<object?> p, CrashQuery query)
{
if (!SameName(At(p, 0), query.ExeFileName))
{
return false;
}
if (At(p, 10) is string { Length: > 0 } appPath && !SamePath(appPath, query.ExePath))
{
return false;
}
return query.TargetPid == 0 || Number(At(p, 8)) is not { } pid || pid == (ulong)query.TargetPid;
}
private static bool WerCrash(IReadOnlyList<object?> p, CrashQuery query) =>
At(p, 2) is string eventName && CrashReports.Contains(eventName) && SameName(At(p, 5), query.ExeFileName);
private static object? At(IReadOnlyList<object?> p, int index) => index < p.Count ? p[index] : null;
private static bool SameName(object? value, string exeFileName) =>
value is string s && string.Equals(s.Trim(), exeFileName, StringComparison.OrdinalIgnoreCase);
private static bool SamePath(string a, string b)
{
try
{
return string.Equals(Path.GetFullPath(a.Trim()), Path.GetFullPath(b), StringComparison.OrdinalIgnoreCase);
}
catch (Exception ex) when (ex is ArgumentException or NotSupportedException or PathTooLongException)
{
return false;
}
}
/// <summary>A number as the log gives it: an unsigned or signed integer, or text in decimal or <c>0x</c> hex.</summary>
internal static ulong? Number(object? value) => value switch
{
ulong u => u,
uint u => u,
long l when l >= 0 => (ulong)l,
int i when i >= 0 => (ulong)i,
string s when s.Trim().StartsWith("0x", StringComparison.OrdinalIgnoreCase)
&& ulong.TryParse(s.Trim()[2..], NumberStyles.HexNumber, CultureInfo.InvariantCulture, out ulong hex) => hex,
string s when ulong.TryParse(s.Trim(), NumberStyles.Integer, CultureInfo.InvariantCulture, out ulong dec) => dec,
_ => null,
};
}
@@ -0,0 +1,7 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Application.Recording;
/// <summary>One Application-log record as the matcher reads it: its id, its provider, and its properties in order (typed as the log gives them).</summary>
public sealed record CrashLogRecord(int EventId, string? Provider, IReadOnlyList<object?> Properties);
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Application.Recording;
/// <summary>
/// What a crash witness is asked about one session (beta.14): the executable, the pid the session held (0 when it held
/// none), the window <c>[start, end + grace]</c>, and whether the session ended because the game itself left — a crash
/// reporter only counts for a game that exited.
/// </summary>
public sealed record CrashQuery(string ExePath, int TargetPid, DateTimeOffset WindowStart, DateTimeOffset WindowEnd, bool TargetLeft)
{
/// <summary>The executable's file name, the form the event log names it by.</summary>
public string ExeFileName => Path.GetFileName(ExePath);
}
@@ -0,0 +1,26 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Application.Recording;
/// <summary>
/// When a crash reporter the game started counts as its crash (beta.14). It must have started at least
/// <see cref="StartedWithTheGame"/> after the game — a reporter that starts with its game is a monitor, not a crash, and a
/// crash in the game's first seconds is under-reported rather than a monitor fabricating one — and the game must have left
/// within <see cref="ExitWithin"/> of it: a game that kept running reported an error it survived, which is a note and not
/// a crash.
/// </summary>
public static class CrashReporterRule
{
public static readonly TimeSpan StartedWithTheGame = TimeSpan.FromSeconds(10);
public static readonly TimeSpan ExitWithin = TimeSpan.FromSeconds(60);
public static bool Counts(CrashReporterSighting sighting, CrashQuery query, DateTimeOffset endedAt)
{
ArgumentNullException.ThrowIfNull(sighting);
ArgumentNullException.ThrowIfNull(query);
bool afterStart = sighting.ParentStartedAt is not { } gameStarted || sighting.StartedAt - gameStarted >= StartedWithTheGame;
return query.TargetLeft && afterStart && endedAt - sighting.StartedAt <= ExitWithin;
}
}
@@ -0,0 +1,10 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Application.Recording;
/// <summary>
/// An engine's crash reporter seen starting as a child of a process (beta.14): its image, its parent's pid and — when the
/// watcher had seen the parent — the parent's image and start, and its own start.
/// </summary>
public sealed record CrashReporterSighting(string Image, int ParentPid, string? ParentImagePath, DateTimeOffset? ParentStartedAt, DateTimeOffset StartedAt);
@@ -0,0 +1,7 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Application.Recording;
/// <summary>What the crash witnesses said about one session (beta.14): the Application log, and the crash reporter the game started, counted or only seen.</summary>
internal readonly record struct CrashWitness(bool ApplicationLog, string? Reporter, bool ReporterCounted);
@@ -15,8 +15,9 @@ namespace FrameLedger.Application.Recording;
/// The crash-witness window is <c>[start, end + 30 s]</c>; the caller asks the
/// <see cref="ICrashEventSource"/> with exactly that and hands the answer in. The precedence is
/// the document's: our own safety stop is <c>unhooked_safety</c> whatever the process did next; the
/// capture side stopping on its own is <c>degraded</c>; an exception's exit code (<see cref="IsExceptionCode"/>) or an
/// event is <c>crashed</c> — since beta.8; any non-zero code was until then, End task's 1 included — and anything else,
/// capture side stopping on its own is <c>degraded</c>; an exception's exit code (<see cref="IsExceptionCode"/>), an
/// event, or — since beta.14 — an engine's crash reporter the game started before it left is <c>crashed</c> — since
/// beta.8; any non-zero code was until then, End task's 1 included — and anything else,
/// including a target still running when the session ends, is <c>normal</c> with its code in the notes.
/// </para>
/// <para>
@@ -29,7 +30,12 @@ public static class ExitStatusMapper
/// <summary>How long after the session's end an event may still be attributed to it.</summary>
public static readonly TimeSpan CrashWitnessGrace = TimeSpan.FromSeconds(30);
public static ExitStatus Map(SessionEndReason reason, int? exitCode, bool crashEventFound)
/// <summary>
/// The status from the end, the exit code and the witnesses. <c>crashReporterCounted</c> (beta.14): the game started an
/// engine's crash reporter and left within a minute (<see cref="CrashReporterRule"/>) — Unreal's crash ends with exit
/// code 3 and no event, so this is its only witness.
/// </summary>
public static ExitStatus Map(SessionEndReason reason, int? exitCode, bool crashEventFound, bool crashReporterCounted = false)
{
switch (reason)
{
@@ -44,7 +50,7 @@ public static class ExitStatusMapper
// A crash is an exception's exit code or the Application log's witness (beta.8). Any other non-zero code is
// the program's own exit — End task and taskkill leave 1 — and was a "crash" until 2026-09-25; the code stays
// in the notes, and the crash policy still counts it inside its window (CrashAutoDisablePolicy).
return crashEventFound || exitCode is { } code && IsExceptionCode(code) ? ExitStatus.Crashed : ExitStatus.Normal;
return crashEventFound || crashReporterCounted || exitCode is { } code && IsExceptionCode(code) ? ExitStatus.Crashed : ExitStatus.Normal;
}
}
@@ -68,9 +74,10 @@ public static class ExitStatusMapper
/// <summary>
/// What <c>sessions.capture_notes</c> carries about the end: the fine reason the four statuses
/// collapse, the exit code when there was one, the witness when there was one.
/// collapse, the exit code when there was one, the witness when there was one — and since beta.14 the crash reporter the
/// game started, if one was seen: <c>crash_reporter=</c> when it counted, <c>crash_reporter_seen=</c> when it did not.
/// </summary>
public static string Describe(SessionEndReason reason, int? exitCode, bool crashEventFound)
public static string Describe(SessionEndReason reason, int? exitCode, bool crashEventFound, string? crashReporter = null, bool crashReporterCounted = false)
{
string note = "end=" + reason;
if (exitCode is { } code)
@@ -83,6 +90,11 @@ public static class ExitStatusMapper
note += "; crash_event=application_log";
}
if (crashReporter is { Length: > 0 })
{
note += (crashReporterCounted ? "; crash_reporter=" : "; crash_reporter_seen=") + crashReporter;
}
return note;
}
}
@@ -5,12 +5,13 @@ namespace FrameLedger.Application.Recording;
/// <summary>
/// The second witness for <c>crashed</c> (<c>04_CAPTURE</c> §Crash &amp; exit classification): an
/// Application Error (1000) or WER (1001) event naming the executable inside <c>[start, end + 30 s]</c>.
/// Application Error (1000) or WER (1001) crash report of THIS session's game inside its window
/// (<see cref="CrashEventMatcher"/> since beta.14 — a WER memory-leak report named the game and read as a crash).
/// A process that was killed, or that returned 0 after an unhandled exception's handler, exits with a
/// code that says nothing; the event log still does.
/// </summary>
public interface ICrashEventSource
{
/// <summary>Whether such an event exists; false when the log cannot be read — absence of evidence, not a crash.</summary>
bool FoundCrash(string exeFileName, DateTimeOffset windowStart, DateTimeOffset windowEnd);
bool FoundCrash(CrashQuery query);
}
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Application.Recording;
/// <summary>
/// The engine crash reporters the watcher saw a session's game start (beta.14, <c>Watch.CrashReporterWitness</c>): the third
/// witness for <c>crashed</c>, beside the exit code and the Application log, for the engines that handle a crash themselves —
/// Unreal starts <c>CrashReportClient.exe</c> and exits with code 3, which says nothing and reaches no event log.
/// </summary>
public interface ICrashReporterSightings
{
/// <summary>The first sighting the session's game started inside its window, or null; waits for a poll or two when the game just left.</summary>
Task<CrashReporterSighting?> FindAsync(CrashQuery query, CancellationToken ct = default);
}
@@ -48,12 +48,16 @@ public sealed class SessionRecorder : ISessionRecorder
private readonly ISessionObserver? _observer;
private readonly IDriverProfileSource? _profiles;
private readonly UserModeExceptionLapsePolicy? _exceptionLapse;
private readonly ICrashReporterSightings? _reporters;
public SessionRecorder(ICaptureSessionFactory sessions, IGameRepository games, IHardwareSnapshotRepository snapshots,
IHardwareSnapshotSource hardware, IPartialSessionStore partials, SessionFinalizer finalizer, ICrashEventSource crashes,
Func<RecorderOptions, ITelemetryPoller?> pollers, TimeProvider clock, RecorderOptions? options = null, ISessionObserver? observer = null,
IRecorderPolicy? policy = null, IDriverProfileSource? profiles = null, UserModeExceptionLapsePolicy? exceptionLapse = null)
IRecorderPolicy? policy = null, IDriverProfileSource? profiles = null, UserModeExceptionLapsePolicy? exceptionLapse = null,
ICrashReporterSightings? reporters = null)
{
// beta.14: the engine crash reporters the watcher saw the game start; null where nothing watches (the tests, the console).
_reporters = reporters;
// D33: ends a game's user-mode exception when a session under it ends badly; null in every recorder that has no
// consent store to write to (the tests, the unshipped host), where no exception can be in force either.
_exceptionLapse = exceptionLapse;
@@ -189,10 +193,15 @@ public sealed class SessionRecorder : ISessionRecorder
bool hooked = outcome.AttachRefusal == ShmAttachRefusal.Ok;
// A held Tier-2 session's duration is the game's (2026-09-22), so the Application-log witness applies to it too.
bool hadPid = hooked || outcome.TargetPid != 0 || outcome.HeldUnhooked;
bool crashEvent = hadPid && _crashes.FoundCrash(Path.GetFileName(request.NormalisedExePath), header.StartedAt, endedAt + ExitStatusMapper.CrashWitnessGrace);
ExitStatus exit = ExitStatusMapper.Map(outcome.Reason, outcome.ExitCode, crashEvent);
// beta.14: the query ties every witness to THIS game's process — its pid, its path — inside the session's window.
bool targetLeft = outcome.ExitCode is not null || outcome.Reason is SessionEndReason.TargetExited or SessionEndReason.LaunchTargetExited;
var query = new CrashQuery(request.NormalisedExePath, outcome.TargetPid, header.StartedAt, endedAt + ExitStatusMapper.CrashWitnessGrace, targetLeft);
CrashReporterSighting? reporter = hadPid && _reporters is { } reporters ? await reporters.FindAsync(query, ct).ConfigureAwait(false) : null;
bool reporterCounted = reporter is { } seen && CrashReporterRule.Counts(seen, query, endedAt);
bool crashEvent = hadPid && _crashes.FoundCrash(query);
ExitStatus exit = ExitStatusMapper.Map(outcome.Reason, outcome.ExitCode, crashEvent, reporterCounted);
SessionRow skeleton = Skeleton(header, outcome, endedAt, exit, crashEvent, hooked) with { DriverProfileJson = driverProfile };
SessionRow skeleton = Skeleton(header, outcome, endedAt, exit, new CrashWitness(crashEvent, reporter?.Image, reporterCounted), hooked) with { DriverProfileJson = driverProfile };
var input = new FinalizeInput
{
Skeleton = skeleton,
@@ -241,9 +250,9 @@ public sealed class SessionRecorder : ISessionRecorder
};
}
private static SessionRow Skeleton(PartialHeader h, CaptureOutcome o, DateTimeOffset endedAt, ExitStatus exit, bool crashEvent, bool hooked)
private static SessionRow Skeleton(PartialHeader h, CaptureOutcome o, DateTimeOffset endedAt, ExitStatus exit, CrashWitness crash, bool hooked)
{
string notes = ExitStatusMapper.Describe(o.Reason, o.ExitCode, crashEvent);
string notes = ExitStatusMapper.Describe(o.Reason, o.ExitCode, crash.ApplicationLog, crash.Reporter, crash.ReporterCounted);
if (o.LaunchError is { } launchError)
{
notes += "; launch_error=" + launchError.ToString(System.Globalization.CultureInfo.InvariantCulture);
@@ -63,6 +63,7 @@ public sealed class CaptureOrchestrator
private readonly ILaunchRecorderFactory? _launches;
private readonly ExecutableRelocator? _relocator;
private readonly LatestProcessSnapshot? _latest;
private readonly CrashReporterWitness? _reporters;
private readonly ProcessWatcher _watcher = new();
private readonly Lock _table = new();
private readonly Dictionary<string, Running> _running = new(StringComparer.OrdinalIgnoreCase);
@@ -73,10 +74,12 @@ public sealed class CaptureOrchestrator
public CaptureOrchestrator(ISessionRecorder recorder, IGameRepository games, IProcessSnapshotSource processes,
IExecutableIdentitySource identity, OrchestratorOptions options, Action<string> log, ILaunchRecorderFactory? launches = null,
ExecutableRelocator? relocator = null, LatestProcessSnapshot? latest = null)
ExecutableRelocator? relocator = null, LatestProcessSnapshot? latest = null, CrashReporterWitness? reporters = null)
{
_relocator = relocator;
_latest = latest;
// beta.14: every snapshot also tells the crash-reporter witness who started what (the recorder asks it at a session's end).
_reporters = reporters;
_recorder = recorder ?? throw new ArgumentNullException(nameof(recorder));
_games = games ?? throw new ArgumentNullException(nameof(games));
_processes = processes ?? throw new ArgumentNullException(nameof(processes));
@@ -147,6 +150,7 @@ public sealed class CaptureOrchestrator
IReadOnlyList<GameRow> watchlist = Recorded(library);
IReadOnlyList<ProcessSnapshot> snapshot = _processes.Take();
_latest?.Publish(snapshot);
_reporters?.Observe(snapshot, DateTimeOffset.UtcNow);
IReadOnlyList<WatchEvent> events = _watcher.Poll(snapshot, watchlist);
foreach (WatchEvent e in events)
@@ -0,0 +1,27 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Application.Watch;
/// <summary>
/// The crash reporters engines and crash SDKs start (beta.14), by exact image name. Two kinds, and the difference is the
/// whole point: an <b>on-crash</b> reporter is started BY the crash — Unreal's <c>CrashReportClient.exe</c>, REDengine's
/// <c>CrashReporter.exe</c>, RE Engine's <c>CrashReport.exe</c>, BugSplat's <c>BsSndRpt64.exe</c> — so its start beside a
/// game that then exits is a witness; an <b>always-on</b> handler starts WITH the game and lives beside it — Unity's
/// <c>UnityCrashHandler64.exe</c>, Chromium's and Sentry's <c>crashpad_handler.exe</c> — so its presence says nothing and it
/// never counts. All six were found in the owner's Steam libraries (2026-10-05).
/// </summary>
public static class CrashReporterCatalog
{
public static IReadOnlySet<string> OnCrash { get; } = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{
"CrashReportClient.exe", "CrashReporter.exe", "CrashReport.exe", "BsSndRpt.exe", "BsSndRpt64.exe",
};
public static IReadOnlySet<string> AlwaysOn { get; } = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{
"UnityCrashHandler64.exe", "UnityCrashHandler32.exe", "crashpad_handler.exe",
};
public static bool IsOnCrash(string? imageName) => imageName is not null && OnCrash.Contains(imageName);
}
@@ -0,0 +1,99 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using FrameLedger.Application.Recording;
namespace FrameLedger.Application.Watch;
/// <summary>
/// Which on-crash reporters (<see cref="CrashReporterCatalog"/>) started as a child of which process (beta.14), from the
/// watcher's own once-a-second snapshots — no process is opened and nothing is read from any. A reporter's parent is known by
/// pid, image and start: a pid Windows reused for a process that started AFTER the reporter is not its parent. The recorder
/// asks at a session's end (<see cref="FindAsync"/>); a game that just left gets two more polls, because the reporter it
/// started as it died may not have been in the last snapshot.
/// </summary>
public sealed class CrashReporterWitness : ICrashReporterSightings
{
private static readonly TimeSpan _rememberProcess = TimeSpan.FromMinutes(5);
private static readonly TimeSpan _rememberSighting = TimeSpan.FromMinutes(30);
private static readonly TimeSpan _waitForPolls = TimeSpan.FromSeconds(2.5);
private readonly Lock _lock = new();
private readonly Dictionary<int, (string? Image, DateTimeOffset? Started, DateTimeOffset Seen)> _processes = [];
private readonly List<CrashReporterSighting> _sightings = [];
private readonly HashSet<(int Pid, DateTimeOffset Started)> _sighted = [];
private long _polls;
/// <summary>How many snapshots have been observed — what <see cref="FindAsync"/> waits on.</summary>
public long Polls => Interlocked.Read(ref _polls);
/// <summary>One watcher snapshot: remember who is running, and every on-crash reporter that appeared, with its parent as known.</summary>
public void Observe(IReadOnlyList<ProcessSnapshot> snapshot, DateTimeOffset now)
{
ArgumentNullException.ThrowIfNull(snapshot);
lock (_lock)
{
foreach (ProcessSnapshot p in snapshot)
{
_processes[p.Pid] = (p.ImagePath, p.StartedAt, now);
}
foreach (ProcessSnapshot p in snapshot)
{
if (CrashReporterCatalog.IsOnCrash(p.ImageName) && p.StartedAt is { } started && _sighted.Add((p.Pid, started)))
{
_sightings.Add(Sighting(p, started));
}
}
foreach (int gone in _processes.Where(e => now - e.Value.Seen > _rememberProcess).Select(static e => e.Key).ToList())
{
_ = _processes.Remove(gone);
}
_ = _sightings.RemoveAll(s => now - s.StartedAt > _rememberSighting);
_ = _sighted.RemoveWhere(s => now - s.Started > _rememberSighting);
}
_ = Interlocked.Increment(ref _polls);
}
public async Task<CrashReporterSighting?> FindAsync(CrashQuery query, CancellationToken ct = default)
{
ArgumentNullException.ThrowIfNull(query);
if (query.TargetPid == 0)
{
return null;
}
if (query.TargetLeft && Polls > 0)
{
// The reporter a dying game starts may not be in the last snapshot yet: two more polls, at most 2.5 s.
long target = Polls + 2;
DateTimeOffset deadline = DateTimeOffset.UtcNow + _waitForPolls;
while (Polls < target && DateTimeOffset.UtcNow < deadline)
{
await Task.Delay(100, ct).ConfigureAwait(false);
}
}
lock (_lock)
{
return _sightings.FirstOrDefault(s => s.ParentPid == query.TargetPid
&& s.ParentImagePath is { } parent && string.Equals(parent, query.ExePath, StringComparison.OrdinalIgnoreCase)
&& s.StartedAt >= query.WindowStart && s.StartedAt <= query.WindowEnd);
}
}
/// <summary>The parent as last seen — unless that pid belongs to a process that started after the reporter, which is a reused pid.</summary>
private CrashReporterSighting Sighting(ProcessSnapshot reporter, DateTimeOffset started)
{
if (_processes.TryGetValue(reporter.ParentPid, out (string? Image, DateTimeOffset? Started, DateTimeOffset Seen) parent)
&& (parent.Started is null || parent.Started <= started))
{
return new CrashReporterSighting(reporter.ImageName, reporter.ParentPid, parent.Image, parent.Started, started);
}
return new CrashReporterSighting(reporter.ImageName, reporter.ParentPid, null, null, started);
}
}
@@ -9,7 +9,11 @@ public enum ExitStatus
/// <summary>The presenting process exited 0 and no Application Error / WER record names it.</summary>
Normal = 0,
/// <summary>Non-zero exit code, or an event 1000 / 1001 naming the exe within <c>[start, end + 30 s]</c>.</summary>
/// <summary>
/// An exception's exit code (<c>ExitStatusMapper.IsExceptionCode</c> — "non-zero" until beta.8, corrected 2026-10-05), an
/// Application-log crash report of this game (<c>CrashEventMatcher</c>, beta.14), or an engine's crash reporter the game
/// started before it left (<c>CrashReporterRule</c>, beta.14).
/// </summary>
Crashed,
/// <summary>The guard fired mid-session.</summary>
@@ -47,6 +47,9 @@ public sealed class ExecutableLocator : IExecutableLocator
"crash", "handler", "unins", "setup", "install", "redist", "vc_redist", "dxsetup", "dotnet", "cef", "report", "updater",
"launcher_helper", "easyanticheat", "beservice", "battleye", "steamerrorreporter", "ue4prereq", "uecc", "vcredist", "python", "node",
"browser", "webview", "subprocess", "analyzer", "vconsole",
// beta.14: BugSplat's sender (BsSndRpt64.exe, Kingdom Come: Deliverance II) matches none of the above — its name says
// "report" without the letters; KCD2 picked its game by rank alone.
"bssndrpt", "bugsplat",
];
/// <summary>
@@ -9,7 +9,8 @@ namespace FrameLedger.Infrastructure.Recording;
/// <summary>
/// The Application log's Application Error (1000) and Windows Error Reporting (1001) events, filtered to
/// the window and to records that name the executable (<c>04_CAPTURE</c> §Crash &amp; exit classification).
/// the window and the two providers, and judged by <see cref="CrashEventMatcher"/> (<c>04_CAPTURE</c> §Crash &amp; exit
/// classification) — since beta.14, which counted any such record whose text contained the executable's name.
/// </summary>
/// <remarks>
/// Read-only, unprivileged (the Application log is readable by any interactive user), bounded by the
@@ -20,12 +21,13 @@ public sealed class EventLogCrashSource : ICrashEventSource
{
private const string _log = "Application";
public bool FoundCrash(string exeFileName, DateTimeOffset windowStart, DateTimeOffset windowEnd)
public bool FoundCrash(CrashQuery query)
{
ArgumentException.ThrowIfNullOrWhiteSpace(exeFileName);
string from = windowStart.UtcDateTime.ToString("o", CultureInfo.InvariantCulture);
string to = windowEnd.UtcDateTime.ToString("o", CultureInfo.InvariantCulture);
string xpath = $"*[System[(EventID=1000 or EventID=1001) and TimeCreated[@SystemTime>='{from}' and @SystemTime<='{to}']]]";
ArgumentNullException.ThrowIfNull(query);
string from = query.WindowStart.UtcDateTime.ToString("o", CultureInfo.InvariantCulture);
string to = query.WindowEnd.UtcDateTime.ToString("o", CultureInfo.InvariantCulture);
string xpath = "*[System[Provider[@Name='" + CrashEventMatcher.ApplicationErrorProvider + "' or @Name='" + CrashEventMatcher.WerProvider + "']"
+ $" and (EventID=1000 or EventID=1001) and TimeCreated[@SystemTime>='{from}' and @SystemTime<='{to}']]]";
try
{
using var reader = new EventLogReader(new EventLogQuery(_log, PathType.LogName, xpath));
@@ -33,7 +35,8 @@ public sealed class EventLogCrashSource : ICrashEventSource
{
using (record)
{
if (Names(record, exeFileName))
var read = new CrashLogRecord(record.Id, record.ProviderName, [.. record.Properties.Select(static p => p.Value)]);
if (CrashEventMatcher.Matches(read, query))
{
return true;
}
@@ -47,18 +50,4 @@ public sealed class EventLogCrashSource : ICrashEventSource
return false;
}
}
/// <summary>The executable appears among the event's properties (1000's first field is the faulting application's name).</summary>
private static bool Names(EventRecord record, string exeFileName)
{
foreach (EventProperty property in record.Properties)
{
if (property.Value is string s && s.Contains(exeFileName, StringComparison.OrdinalIgnoreCase))
{
return true;
}
}
return false;
}
}
@@ -98,6 +98,9 @@ public sealed class ReasonTextTests
.Should().Contain("0xC0000006 in-page I/O error", "the owner's failing USB drive, 2026-09-21");
Formats.ExitText(ExitStatus.Crashed, CaptureNotes.Parse("end=TargetExited; exit_code=0; crash_event=application_log"))
.Should().Be("crashed (Windows logged an application error)");
// beta.14: Unreal's own crash handling ends with exit code 3 and the crash reporter it started is the witness.
Formats.ExitText(ExitStatus.Crashed, CaptureNotes.Parse("end=TargetExited; exit_code=3; crash_reporter=CrashReportClient.exe"))
.Should().Be("crashed (the game started its crash reporter, CrashReportClient.exe)");
Formats.ExitText(ExitStatus.Normal, CaptureNotes.Parse("end=TargetExited; exit_code=1")).Should().StartWith("ended with exit code 1 — what End task and taskkill leave");
Formats.ExitText(ExitStatus.Normal, CaptureNotes.Parse("end=TargetExited; exit_code=0")).Should().Be("ended normally");
Formats.ExitText(ExitStatus.Normal, CaptureNotes.Parse("end=TargetExited; exit_code=-1")).Should().Be("ended with exit code -1");
@@ -25,6 +25,16 @@ public sealed class CaptureNotesTests
blocked.GuardSignal.Should().Be("AntiCheatDirectory|Easy Anti-Cheat|EasyAntiCheat", "the signal is the last slot and keeps its own bars");
}
[Fact]
public void TheCrashReporterSlotsReadBack()
{
// beta.14: the reporter that made the session crashed, and one that was only seen.
CaptureNotes counted = CaptureNotes.Parse("end=TargetExited; exit_code=3; crash_reporter=CrashReportClient.exe");
(counted.CrashReporter, counted.CrashReporterSeen).Should().Be(("CrashReportClient.exe", (string?)null));
CaptureNotes seen = CaptureNotes.Parse("end=TargetExited; exit_code=0; crash_reporter_seen=CrashReporter.exe");
(seen.CrashReporter, seen.CrashReporterSeen).Should().Be(((string?)null, "CrashReporter.exe"));
}
[Fact]
public void TheScanAtExitSlotReadsBack()
{
@@ -0,0 +1,63 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using FluentAssertions;
using FrameLedger.Application.Recording;
namespace FrameLedger.Application.Tests.Recording;
/// <summary>
/// beta.14: an Application-log record is a crash of THIS game, or it is not. Until then any record 1000 or 1001 whose text
/// contained the executable's name counted — and on the owner's machine (2026-10-04) Windows' memory-leak report for
/// The Witcher 3, a WER 1001 named <c>RADAR_PRE_LEAK_64</c>, made a session that ended with exit code 0 read "crashed".
/// </summary>
public sealed class CrashEventMatcherTests
{
private const string _witcher = @"D:\SteamLibrary\steamapps\common\The Witcher 3\bin\x64_dx12\witcher3.exe";
private const string _game = @"C:\Games\Title\Game.exe";
private static CrashQuery Query(string exe = _witcher, int pid = 0) =>
new(exe, pid, DateTimeOffset.UnixEpoch, DateTimeOffset.UnixEpoch.AddHours(1), TargetLeft: true);
/// <summary>A WER 1001 as the log types it: [0] bucket, [1] type, [2] event name, [3] response, [4] cab id, [5] P1 …</summary>
private static CrashLogRecord Wer(string eventName, string p1) =>
new(1001, CrashEventMatcher.WerProvider, ["2300524621932593539", "5", eventName, "Not available", "0", p1, "", "", "", "", "", ""]);
/// <summary>An Application Error 1000: [0] AppName … [8] ProcessId, [9] ProcessCreationTime, [10] AppPath.</summary>
private static CrashLogRecord ApplicationError(string appName, object? pid, string? appPath) =>
new(1000, CrashEventMatcher.ApplicationErrorProvider,
[appName, "1.0.0.0", "00000000", "ntdll.dll", "10.0", "00000000", "c0000005", "000000000002f1b0", pid, 0x01DB3F2A0C1E8000UL, appPath, @"C:\Windows\SYSTEM32\ntdll.dll", "id"]);
[Fact]
public void TheWitcherMemoryLeakReportIsNotACrash() =>
CrashEventMatcher.Matches(Wer("RADAR_PRE_LEAK_64", "witcher3.exe"), Query()).Should().BeFalse("RADAR is Windows' leak detector reporting high memory use");
[Fact]
public void AHangReportIsNotACrash() =>
CrashEventMatcher.Matches(Wer("AppHangB1", "witcher3.exe"), Query()).Should().BeFalse("a game the user closed while it hung did not crash");
[Theory]
[InlineData("APPCRASH")]
[InlineData("BEX64")]
[InlineData("CLR20r3")]
public void AWerCrashReportOfThisGameIsACrash(string eventName) =>
CrashEventMatcher.Matches(Wer(eventName, "witcher3.exe"), Query()).Should().BeTrue();
[Fact]
public void AnotherProgramWhoseNameContainsTheGamesIsNotThisGame() =>
CrashEventMatcher.Matches(Wer("APPCRASH", "MyGame.exe"), Query(_game)).Should().BeFalse("the old substring rule found Game.exe inside MyGame.exe");
[Fact]
public void AnApplicationErrorOfThisProcessIsACrashAndOfAnotherProcessIsNot()
{
CrashEventMatcher.Matches(ApplicationError("Game.exe", 0x1234u, _game), Query(_game, 0x1234)).Should().BeTrue();
CrashEventMatcher.Matches(ApplicationError("Game.exe", "0x1234", _game), Query(_game, 0x1234)).Should().BeTrue("the pid may come as hex text");
CrashEventMatcher.Matches(ApplicationError("Game.exe", 0x9999u, _game), Query(_game, 0x1234)).Should().BeFalse("another run of the game, or a same-image child");
CrashEventMatcher.Matches(ApplicationError("Game.exe", 0x1234u, @"D:\Other\Game.exe"), Query(_game, 0x1234)).Should().BeFalse("another executable of the same name");
CrashEventMatcher.Matches(ApplicationError("Game.exe", 0x1234u, null), Query(_game)).Should().BeTrue("a session that held no pid matches on the name and the path the record gives");
}
[Fact]
public void ARecordFromAnotherProviderIsNotACrash() =>
CrashEventMatcher.Matches(new CrashLogRecord(1000, "Application Hang", ["Game.exe"]), Query(_game)).Should().BeFalse();
}
@@ -0,0 +1,34 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using FluentAssertions;
using FrameLedger.Application.Recording;
namespace FrameLedger.Application.Tests.Recording;
/// <summary>beta.14: a crash reporter the game started is its crash only when it started after the game's first seconds and the game left within a minute of it.</summary>
public sealed class CrashReporterRuleTests
{
private static readonly DateTimeOffset _gameStart = new(2026, 10, 5, 20, 0, 0, TimeSpan.Zero);
private static CrashReporterSighting Sighting(TimeSpan afterGameStart) =>
new("CrashReportClient.exe", 100, @"C:\Games\Game.exe", _gameStart, _gameStart + afterGameStart);
private static CrashQuery Query(bool left) => new(@"C:\Games\Game.exe", 100, _gameStart, _gameStart.AddHours(2), left);
[Fact]
public void AReporterAndThenTheGamesExitIsACrash() =>
CrashReporterRule.Counts(Sighting(TimeSpan.FromMinutes(20)), Query(left: true), _gameStart.AddMinutes(20).AddSeconds(8)).Should().BeTrue();
[Fact]
public void AReporterThatStartedWithTheGameIsAMonitorNotACrash() =>
CrashReporterRule.Counts(Sighting(TimeSpan.FromSeconds(3)), Query(left: true), _gameStart.AddSeconds(30)).Should().BeFalse();
[Fact]
public void AGameThatKeptRunningReportedSomethingItSurvived() =>
CrashReporterRule.Counts(Sighting(TimeSpan.FromMinutes(20)), Query(left: true), _gameStart.AddMinutes(45)).Should().BeFalse();
[Fact]
public void ASessionTheUserStoppedWhileTheGameRanIsNoCrash() =>
CrashReporterRule.Counts(Sighting(TimeSpan.FromMinutes(20)), Query(left: false), _gameStart.AddMinutes(20).AddSeconds(8)).Should().BeFalse();
}
@@ -51,4 +51,17 @@ public sealed class ExitStatusMapperTests
ExitStatusMapper.Describe(SessionEndReason.Running, null, false).Should().Be("end=Running");
ExitStatusMapper.CrashWitnessGrace.Should().Be(TimeSpan.FromSeconds(30));
}
/// <summary>beta.14: the engine's crash reporter is the third witness — counted, crashed; only seen, a note.</summary>
[Fact]
public void ACountedCrashReporterIsACrashAndOneOnlySeenIsANote()
{
ExitStatusMapper.Map(SessionEndReason.TargetExited, 3, crashEventFound: false, crashReporterCounted: true).Should().Be(ExitStatus.Crashed);
ExitStatusMapper.Map(SessionEndReason.TargetExited, 3, crashEventFound: false).Should().Be(ExitStatus.Normal, "exit code 3 alone is the program's own");
ExitStatusMapper.Map(SessionEndReason.SafetyUnhook, 3, false, crashReporterCounted: true).Should().Be(ExitStatus.UnhookedSafety, "our own stop still outranks");
ExitStatusMapper.Describe(SessionEndReason.TargetExited, 3, false, "CrashReportClient.exe", crashReporterCounted: true)
.Should().Be("end=TargetExited; exit_code=3; crash_reporter=CrashReportClient.exe");
ExitStatusMapper.Describe(SessionEndReason.TargetExited, 0, false, "CrashReporter.exe")
.Should().Be("end=TargetExited; exit_code=0; crash_reporter_seen=CrashReporter.exe");
}
}
@@ -246,7 +246,18 @@ public sealed class SessionRecorderTests : IAsyncDisposable
private sealed class NoCrashEvents : ICrashEventSource
{
public bool FoundCrash(string exeFileName, DateTimeOffset windowStart, DateTimeOffset windowEnd) => false;
public bool FoundCrash(CrashQuery query) => false;
}
/// <summary>beta.14: a game that started an engine's crash reporter <paramref name="beforeEnd"/> before the session ended, 20 min after it started.</summary>
private sealed class OneReporter(TimeSpan beforeEnd) : ICrashReporterSightings
{
public Task<CrashReporterSighting?> FindAsync(CrashQuery query, CancellationToken ct = default)
{
DateTimeOffset endedAt = query.WindowEnd - ExitStatusMapper.CrashWitnessGrace;
return Task.FromResult<CrashReporterSighting?>(new CrashReporterSighting("CrashReportClient.exe", query.TargetPid, query.ExePath,
endedAt - beforeEnd - TimeSpan.FromMinutes(20), endedAt - beforeEnd));
}
}
private sealed class FixedHardware : IHardwareSnapshotSource
@@ -292,7 +303,7 @@ public sealed class SessionRecorderTests : IAsyncDisposable
private async Task<Harness> MakeAsync(bool consented = true, AntiCheatVerdict? verdict = null, int records = 3_000, FakeLiveness? liveness = null, bool poller = true,
bool clockStepsOnDrain = false, IDriverProfileSource? profiles = null, bool excepted = false, IDisplayProbe? display = null, ulong adapterLuid = 0,
AntiCheatVerdict? rescan = null)
AntiCheatVerdict? rescan = null, ICrashReporterSightings? reporters = null)
{
_db ??= await LedgerDatabase.OpenAsync(Path.Combine(_dir, LedgerPaths.DatabaseFileName), ct: TestContext.Current.CancellationToken).ConfigureAwait(false);
var store = new SqliteGameConsentStore(_db);
@@ -323,7 +334,7 @@ public sealed class SessionRecorderTests : IAsyncDisposable
new SessionFinalizer(sessions, new RawSeriesCodec()), new NoCrashEvents(),
_ => fakePoller, clock,
new RecorderOptions { PartialFlushInterval = TimeSpan.FromSeconds(10), MinimumSessionLength = SteppingClock.Step }, profiles: profiles,
exceptionLapse: new UserModeExceptionLapsePolicy(store, sessions));
exceptionLapse: new UserModeExceptionLapsePolicy(store, sessions), reporters: reporters);
return new Harness { Recorder = recorder, Games = games, Sessions = sessions, Partials = partials, Clock = clock, Store = store, Poller = fakePoller };
}
@@ -588,6 +599,35 @@ public sealed class SessionRecorderTests : IAsyncDisposable
CaptureNotes.Parse(r.Row.CaptureNotes).ScanAtExit.Should().Be("ProcessUnreadable");
}
/// <summary>
/// beta.14: Unreal handles its own crash, starts CrashReportClient.exe and exits with code 3 — no exception code, no event.
/// The reporter the watcher saw is the witness: crashed, and the notes name it.
/// </summary>
[Fact]
public async Task AGameThatStartedItsCrashReporterAndExitedWithinAMinuteCrashed()
{
using var exited = new FakeLiveness(exited: true, exitCode: 3);
Harness h = await MakeAsync(liveness: exited, reporters: new OneReporter(TimeSpan.FromSeconds(6)));
RecordedSession r = await h.Recorder.RecordAsync(Request(), TestContext.Current.CancellationToken);
r.ExitStatus.Should().Be(ExitStatus.Crashed, "exit code 3 alone read 'normal' until beta.14");
r.Row.CaptureNotes.Should().Contain("crash_reporter=CrashReportClient.exe");
CaptureNotes.Parse(r.Row.CaptureNotes).CrashReporter.Should().Be("CrashReportClient.exe");
}
[Fact]
public async Task AReporterWhoseGameKeptRunningIsANoteOnly()
{
using var exited = new FakeLiveness(exited: true, exitCode: 0);
Harness h = await MakeAsync(liveness: exited, reporters: new OneReporter(TimeSpan.FromMinutes(10)));
RecordedSession r = await h.Recorder.RecordAsync(Request(), TestContext.Current.CancellationToken);
r.ExitStatus.Should().Be(ExitStatus.Normal, "the game ran ten more minutes after it reported");
r.Row.CaptureNotes.Should().Contain("crash_reporter_seen=CrashReportClient.exe");
}
[Fact]
public async Task AnEarlyCrashIsCountedAndTheSecondOneDisablesHooking()
{
@@ -0,0 +1,98 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using FluentAssertions;
using FrameLedger.Application.Recording;
using FrameLedger.Application.Watch;
namespace FrameLedger.Application.Tests.Watch;
/// <summary>
/// beta.14: the engine crash reporters a game starts, seen from the watcher's own snapshots. Unreal handles its crash
/// itself, starts <c>CrashReportClient.exe</c> and exits with code 3 — no exception code, no Application-log record — so
/// the reporter is the one witness. Seen as the game's child by pid AND start, never by a reused pid; an always-on handler
/// (Unity's, crashpad) never.
/// </summary>
public sealed class CrashReporterWitnessTests
{
private const string _game = @"C:\Games\SILENT HILL 2\SHProto\Binaries\Win64\SHProto-Win64-Shipping.exe";
private static readonly DateTimeOffset _t0 = new(2026, 10, 5, 20, 0, 0, TimeSpan.Zero);
private static ProcessSnapshot Game(DateTimeOffset started) => new(100, 4, "SHProto-Win64-Shipping.exe", _game, started);
private static ProcessSnapshot Reporter(string image, int parent, DateTimeOffset started) =>
new(200, parent, image, @"C:\Games\SILENT HILL 2\Engine\Binaries\Win64\" + image, started);
private static CrashQuery Query(bool left = false) => new(_game, 100, _t0, _t0.AddHours(1), left);
[Fact]
public async Task AReporterTheGameStartedIsItsChild()
{
var witness = new CrashReporterWitness();
witness.Observe([Game(_t0)], _t0.AddSeconds(1));
witness.Observe([Game(_t0), Reporter("CrashReportClient.exe", 100, _t0.AddMinutes(20))], _t0.AddMinutes(20).AddSeconds(1));
CrashReporterSighting? s = await witness.FindAsync(Query(), TestContext.Current.CancellationToken);
s.Should().NotBeNull();
s!.Image.Should().Be("CrashReportClient.exe");
(s.ParentImagePath, s.ParentStartedAt).Should().Be((_game, (DateTimeOffset?)_t0));
}
[Fact]
public async Task TheGameGoneBeforeTheReporterWasSeenIsRememberedFromTheSnapshotBefore()
{
var witness = new CrashReporterWitness();
witness.Observe([Game(_t0)], _t0.AddMinutes(20));
witness.Observe([Reporter("CrashReportClient.exe", 100, _t0.AddMinutes(20))], _t0.AddMinutes(20).AddSeconds(1));
(await witness.FindAsync(Query(), TestContext.Current.CancellationToken)).Should().NotBeNull("the dying game started it; the snapshot before saw the game");
}
[Fact]
public async Task APidReusedByAProcessThatStartedAfterTheReporterIsNotItsParent()
{
var witness = new CrashReporterWitness();
DateTimeOffset reporterStart = _t0.AddMinutes(20);
witness.Observe([new ProcessSnapshot(100, 4, "notepad.exe", @"C:\Windows\notepad.exe", reporterStart.AddSeconds(5)),
Reporter("CrashReportClient.exe", 100, reporterStart)], reporterStart.AddSeconds(6));
(await witness.FindAsync(Query(), TestContext.Current.CancellationToken)).Should().BeNull();
}
[Theory]
[InlineData("UnityCrashHandler64.exe")]
[InlineData("crashpad_handler.exe")]
public async Task AnAlwaysOnHandlerIsNeverASighting(string image)
{
var witness = new CrashReporterWitness();
witness.Observe([Game(_t0), Reporter(image, 100, _t0.AddSeconds(1))], _t0.AddSeconds(2));
(await witness.FindAsync(Query(), TestContext.Current.CancellationToken)).Should().BeNull("it starts with the game; its presence says nothing");
}
[Fact]
public async Task WithNoPollAtAllTheAnswerIsImmediate()
{
var witness = new CrashReporterWitness();
var started = System.Diagnostics.Stopwatch.StartNew();
(await witness.FindAsync(Query(left: true), TestContext.Current.CancellationToken)).Should().BeNull();
started.Elapsed.Should().BeLessThan(TimeSpan.FromSeconds(1), "the console path never polls, so it never waits");
}
[Fact]
public async Task AGameThatJustLeftGetsTwoMorePollsForItsReporter()
{
var witness = new CrashReporterWitness();
witness.Observe([Game(_t0)], _t0.AddMinutes(20));
Task<CrashReporterSighting?> asked = witness.FindAsync(Query(left: true), TestContext.Current.CancellationToken);
await Task.Delay(150, TestContext.Current.CancellationToken);
witness.Observe([Reporter("CrashReportClient.exe", 100, _t0.AddMinutes(20))], _t0.AddMinutes(20).AddSeconds(1));
await Task.Delay(150, TestContext.Current.CancellationToken);
witness.Observe([], _t0.AddMinutes(20).AddSeconds(2));
(await asked).Should().NotBeNull("the reporter a dying game starts arrives in the next snapshot");
}
}
@@ -112,6 +112,10 @@ public sealed class ExecutableLocatorTests : IDisposable
[InlineData("msedgewebview2")]
[InlineData("QtWebEngineSubprocess")]
[InlineData("vconsole2")]
[InlineData("BsSndRpt64")]
[InlineData("CrashReportClient")]
[InlineData("UnityCrashHandler64")]
[InlineData("crashpad_handler")]
public void TheHelpersThisWasMeasuredOnAreHelpers(string name) =>
ExecutableLocator.IsHelper(name).Should().BeTrue();
}
@@ -15,7 +15,8 @@ public sealed class EventLogCrashSourceTests
var source = new EventLogCrashSource();
DateTimeOffset now = DateTimeOffset.UtcNow;
bool found = source.FoundCrash("fl-nobody-ever-ran-this-" + Guid.NewGuid().ToString("N") + ".exe", now.AddMinutes(-1), now.AddSeconds(30));
string exe = @"C:\Games\fl-nobody-ever-ran-this-" + Guid.NewGuid().ToString("N") + ".exe";
bool found = source.FoundCrash(new Application.Recording.CrashQuery(exe, 0, now.AddMinutes(-1), now.AddSeconds(30), TargetLeft: true));
found.Should().BeFalse();
}