XGameSave: a stray v18446744073709551615 folder makes an update lose the save in release builds (follow-up to #1729) #2495
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?
Imported from Marvisak/VIctory. Originally posted by Makto94 on 2026-11-25T14:50:10Z.
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.
Imported from Marvisak/VIctory. Originally posted by Creaa on 2026-11-25T14:55:34Z.
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.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T16:02:27Z.
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