XGameSave: a stray v18446744073709551615 folder makes an update lose the save in release builds (follow-up to #1729) #2497
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#2497
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Makto94 on GitHub · 2026-11-25 14:50 UTC · original
After #1729 the next version number is
highest + 1, wherehighestcomes from the largest canonicalv<N>folder name. With a stray folderv18446744073709551615(u64::MAX) next to a goodv1:attempt to add with overflowpanic in the update; no data lost.v0(not canonical, so reads ignore it), returnsS_OK, and then removesv1. Later reads find no readable version.Fix used in a port:
highest.checked_add(1); when it isNone, returnNO_ACCESS(already returned when no version is readable) before writing or removing anything. A regression test with a committedv1and that stray folder fails before the fix in debug and release and passes after. Reference: https://github.com/LaunchDoesntCode/VI-Port/pull/187Separate and unchanged from before #1729: a version folder whose manifest is valid but whose blobs are missing makes a read remove older versions.
github-bot referenced this issue2026-11-26 05:07:52 +00:00
@Creaa on GitHub · 2026-11-25 14:55 UTC · original
Taking this:
highest.checked_add(1), andNO_ACCESSbefore anything is written or removed when it overflows, with the regression test you describe (a committedv1next to a strayv18446744073709551615). PR shortly.AI use: Claude Code (Claude Opus 5.5) drafted this.
@Marvisak on GitHub · 2026-11-25 16:02 UTC · original · edited 2026-11-26 00:45 UTC
Automated triage for the maintainers.
Confirmed on
main(63bcca4),crates/victory-hle/src/modules/xgamesave.rs:currenttakeshighestfrom every canonicalv<N>name, including stray ones. The update computesv.highest + 1unchecked. In release that wraps to 0,commitwritesv0, whichversion_numberrejects (n > 0), and the update then removes the old readable version. The trigger is a hand-made folder namedv18446744073709551615, but the result is a lost save.Open PR #2511 addresses it (#2525 was closed without merging).
Generated by Claude Code