Skip to content

crash: write one report per fault, not one per dispatch - #19

Draft
arthurprudenteres wants to merge 1 commit into
integration/fps-syncfrom
fix/issue-16-prologue-crash
Draft

arthurprudenteres wants to merge 1 commit into
integration/fps-syncfrom
fix/issue-16-prologue-crash

Conversation

@arthurprudenteres

@arthurprudenteres arthurprudenteres commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Refs #16. One report per fault, not one per dispatch.

What this fixes

When title code asserts inside a pool allocator that several threads are in, each of those threads reaches the same int3, and each dispatch runs the unhandled-exception filter victory-loader installs. Every dispatch then appended its own full report (registers and a 40-frame unwind) to crashes.log.

The prologue crash this issue isolates shows it: the first run's crashes.log holds six identical reports of one breakpoint — same unix time 1795569532, same process, same faulting address victory-image-b99f876b74d4a77f.dll+0x5149aec, 12 lines each. That is 72 lines for one fault, and it buries the record that says what failed first, which is exactly what the issue needed to read.

crates/victory-loader/src/crash.rs now writes one full report per kind of report (first-chance, unhandled) per exception code and faulting address. A later dispatch of the same fault is one line in the console and in the file:

VIctory: unhandled exception 0x80000003 at victory-image-....dll+0x63966f again (the same fault, reported above; no stack)

The REPORTED lock is tried, never waited for: a fault raised inside this handler is still reported in full rather than dropped.

Before and after

crash::tests::one_fault_is_in_the_crash_log_once raises one breakpoint three times through report_unhandled in a child process, as three threads of one stuck allocator do:

  • with the de-duplication disabled: (whole reports, "again" lines) = (3, 0) — three complete register and unwind dumps for one fault;
  • with it: (1, 2) — one complete report, then two one-line notes.

The field evidence is the same shape: the run behind issue #16 has six complete reports of one 0x80000003.

Tests

cargo test -p victory-loader --offline --locked --lib crash::tests
test result: ok. 16 passed; 0 failed; 0 ignored

Also cargo build --profile diag -p victory --features diagnostics, run four times on the prologue with revision 481837bd2c7d5b5f6bf43744014e05901916e26e as the base.

Base

Targets integration/fps-sync at 481837b, the revision the issue pins for the repro, so the diff is this one commit. If the integration draft (#14) lands on main first, the base follows it; the change itself is independent.

What this does not change

The crash itself. 0x80000003 is a title-side int3, not a fault in our code: the faulting address is a title RVA (victory-image-<hash>.dll is the name victory-loader gives the mapped title image), the byte there is 0xCC, and the allocator's empty-freelist sentinel (0x1fffe) is in rax in both runs that crashed, at two different inlined copies of the same allocator (+0x5149aec and +0x63966f). It is reported here unchanged, so the original failure stays observable in the repro.

The isolation and the two matched passes are in #16.

AI-assisted investigation and validation.

A title that asserts inside a pool allocator several threads are in reaches
the same `int3` in each, and every one of those dispatches runs the
unhandled-exception filter: the first prologue run's crashes.log holds six
identical reports of one breakpoint (unix time 1795569532, process 9408, at
victory-image-b99f876b74d4a77f.dll+0x5149aec), which buries the report that
says what failed first.

One full report is written per kind of report (first-chance, unhandled) per
exception code and faulting address; a later dispatch of the same fault is
one line. The lock is tried, never waited for, so a fault inside this handler
is still reported rather than dropped.

Test: crash::tests::one_fault_is_in_the_crash_log_once dispatches one fault
three times in a child process and finds one full report and two "again"
lines; with the de-duplication disabled the same test finds three full
reports and none.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant