Skip to content

Loader (diagnostics): VICTORY_STEP_OVER steps over listed title breakpoints (#698) - #2644

Open
Pierrot1398 wants to merge 2 commits into
Marvisak:mainfrom
Pierrot1398:loader/step-over
Open

Pierrot1398 wants to merge 2 commits into
Marvisak:mainfrom
Pierrot1398:loader/step-over

Conversation

@Pierrot1398

Copy link
Copy Markdown

From a tester working with Claude (AI-assisted); measured on my own machine.

Refs #698. The approach is slauko's, described in #698 (a vectored-handler step over the title's own int3); this is an implementation of it on current main.

Problem

In the world, the title stops with 0x80000003 at +0x63966f or +0x5149aec (Series 1.0.2.1), several threads at once, its crash report showing a pool at its limit. Both offsets are a lone int3 on the allocator's own NULL-return path:

Stepped over, the allocation returns NULL and the caller goes on.

Change

Diagnostics builds only, off unless set: VICTORY_STEP_OVER=<hex offset>[,<hex offset>…].

  • The loader's vectored handler (crates/victory-loader/src/crash.rs) checks it right after the AMD-only instruction emulation.
  • A breakpoint is stepped over only when the faulting address lies in a mapped image (VirtualQuery, MEM_IMAGE), its offset from that image's AllocationBase is a listed one, and the byte there really is 0xCC. Rip then moves past it and the handler returns EXCEPTION_CONTINUE_EXECUTION.
  • Each listed offset counts its hits. The first three and every power of two are logged (stepped over the title's breakpoint (VICTORY_STEP_OVER)).
  • The README's diagnostics table lists it.

Nothing else about exceptions changes; with the variable unset the handler does exactly what it did before.

Measured

RTX 5060 Ti 8 GB (driver 621.24), Ryzen 7 5700G, 13.9 GB RAM, Windows 11 26300, diag build, VICTORY_STEP_OVER=63966f,5149aec, on a tree with the open NVIDIA fixes (#1832, #1763, #2332, #1779, #1906, #1922, #233, #2178).

without with
stop 0x80000003 at +0x63966f after 6–12 min, 7 threads none from the trap
world intro prestream the game world, HUD and ambient sound; runs of up to about 19 min in the world
hits – more than 2,048 at each offset

The runs end later on host GPU failures of their own (memory on this 8 GB card, a freed-texture page fault as in #557), not on the trap.

As slauko noted, this is a way around the stop, not its cause: the pool stays full, so what asked for it after that point is not drawn.

cargo xtask policy, cargo clippy -p victory-loader --features diagnostics -- -D warnings and cargo test -p victory-loader --features diagnostics pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_011f6R3kMoarujHzzA1AvSBb

Pierrot1398 and others added 2 commits November 25, 2026 18:28
…points

GTA VI 1.0.2.1's pool allocator traps on an empty pool (int3 at +0x63966f and
+0x5149aec, Marvisak#698) right before returning NULL. Stepped over, the allocation
fails and the title goes on: on an RTX 5060 Ti this reaches the world
(HUD and ambient sound). Off unless the variable is set; only an int3 in a
mapped image at a listed offset is stepped over. After slauko's patch in Marvisak#698.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011f6R3kMoarujHzzA1AvSBb
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011f6R3kMoarujHzzA1AvSBb
@kotekompotek

Copy link
Copy Markdown

Verified live on Series 1.0.2.1 (diag build + this patch): VICTORY_STEP_OVER=1ce6e13,2224517,1d5cc69,22106e0,2219650 walked the boot chain — each site logged with its count, the run continued past all five into a later 0xc0000005 (a different, real failure downstream of the same missing service registration). The offset-via-AllocationBase arithmetic and the 0xCC byte check before stepping both behaved correctly.

Design notes from use: (1) sites listed but never hit stay silent — a 'listed but not hit' summary at exit would help catch typos; (2) stepping over an int3 mid-function continues into whatever follows, which is exactly right for assert-style sites like these (check → int3 → normal path).

This is the right tool for the assert chain in #2613 — poke-free, no writes to RX pages.

anoyarou added a commit to anoyarou/VIctory-RDNA4-linux that referenced this pull request Nov 25, 2026
…r listed title breakpoints

Code part of the PR at head 26bd942f (crates/victory-loader/src/crash.rs,
applied as is; its README section conflicts here and is left out). The
approach is slauko's on Marvisak/VIctory#698.

Runs 10 and 11 here (RX 9070 XT, Proton Experimental, b394ba9 and 1e77d47)
end at 639-643 s in the intro's prestream at the title's own int3 at
+0x63966f, INSTANCE_LIST at 43,817-44,420/45,000; run 7 ended the same way
at 45,000/45,000. With VICTORY_STEP_OVER=63966f,5149aec (diagnostics
builds only, off unless set) the loader's vectored handler steps over that
int3 when it lies in an image at a listed offset and the byte is 0xCC, so
the allocation returns NULL and the title goes on. This works around the
stop, not its cause: the pool stays full.

Tested: cargo test -p victory-loader --features diagnostics under Wine,
23 passed. Not yet tested in the title.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

This adds step_over to the vectored handler in crates/victory-loader/src/crash.rs, compiled only with the diagnostics feature and inert unless VICTORY_STEP_OVER is set: an EXCEPTION_BREAKPOINT is resumed past the int3 only when it lies in a MEM_IMAGE region (the title is loaded with LoadLibraryExW in windows.rs, so AllocationBase is its image base), the offset is listed and the byte is really 0xCC. With the variable unset the handler behaves as before; it adds no dependency and no new unsafe pattern beyond what crash.rs already does. One small point a maintainer may want trimmed: the README table row carries an explanation of #698 that is longer than its neighbours. CI (check) passes.

This is a recommendation for a maintainer to look, not an approval.


Generated by Claude Code

@futurepro62

Copy link
Copy Markdown

Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head 26bd942 (on its base 13f91ca).

Tested

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.

ntgata1-dotcom added a commit to ntgata1-dotcom/VIctory-Linux that referenced this pull request Nov 26, 2026
…s over listed title breakpoints (#698)

From Marvisak/VIctory#2644 (opened by Pierrot1398; original commits and authors kept). Not yet merged upstream.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@fuzeofficlal fuzeofficlal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 26bd942f566c0f28bf30595de4e549528da2913e (merged cleanly onto 63bcca43c6a00a758510398fa43096ce7e4f7df0) and verified on Windows 11 x64 (rustc 1.98.1 MSVC).

Audit

  • crates/victory-loader/src/crash.rs:538, :547, :581, :607:
    • Gated behind #[cfg(feature = "diagnostics")] and short-circuits immediately when VICTORY_STEP_OVER is unset/empty, keeping default builds and normal runs unaffected.
    • step_over verifies EXCEPTION_BREAKPOINT, VirtualQuery returning MEM_IMAGE, RVA match against AllocationBase, and that the byte at ExceptionAddress is literally 0xCC before advancing ctx.Rip += 1 (and only when ctx.Rip as usize == at), with bounded log frequency (n <= 3 || n.is_power_of_two()).
  • Minor non-blocking note: trim_start_matches("0x") skips uppercase 0X prefixes (though 0x, +0x, bare hex, and uppercase hex digits all parse cleanly).

Verification

  • Clean merge onto 63bcca43c6a00a758510398fa43096ce7e4f7df0 + cargo run -p xtask -- policy (191 files ok)
  • cargo clippy -p victory-loader --all-targets -- -D warnings (default & --all-features)
  • cargo test -p victory-loader: 39/39 passed (default), 41/41 passed (--all-features).
  • Additional live MEM_IMAGE probe against the test binary's own .text section verified VICTORY_STEP_OVER parsing (+0x..., uppercase hex, whitespace, empty/invalid/overflow tokens) and confirmed step_over rejects non-breakpoint exceptions, heap 0xCC bytes, and listed MEM_IMAGE RVAs that are not 0xCC, while returning true and advancing ctx.Rip by 1 (without double-advancing when Rip != ExceptionAddress) on a listed 0xCC byte.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants