XGameSave: a bad escape in a save name stays literal instead of panicking (#325) #448
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!448
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-448"
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?
@Amzi-01 on GitHub · 2026-11-24 00:25 UTC · original
Amzi-01:fix-325-gamesave-dec→main· +46 −2 · 1 files · 1 commits · opendecinhle/xgameruntime/gamesave.rssliced the&strby byte index. A save name with%, one ASCII byte and then a multi-byte character, such as a folder copied in by hand or restored from a backup, panicked. Becausedecruns from theextern "system"enumeration calls, that aborted the whole title with 0xC0000409 (confirmed on Windows by @jleybourne in the issue). It now decodes%XYfrom the bytes, and only when both are ASCII hex digits. That also stops%+1decoding to 0x01, becausefrom_str_radixaccepted a sign.Fixes #325
What is in it
dec: ahex_digithelper (char::to_digit(16), ASCII only, no sign) instead ofu8::from_str_radixon a slice. Namesencwrites decode as before.dec_keeps_bad_escapes_literal:%a\u{e9},%\u{e9}a,%+1,%-1xand a truncateda%4stay literal,%41%42cand%c3%A9still decode, anddec(enc(name)) == nameholds for multi-byte,%and Windows-special names.enumerating_a_container_with_a_bad_escape_does_not_abort: the issue's repro. A%a\u{e9}container folder is made by hand, thenXGameSaveEnumerateContainerInfolists it.main'sdec, the first test panics at the slice and the second aborts with "thread caused non-unwinding panic"; with this PR both pass.Tested
cargo build --workspacethencargo test --workspace --no-fail-fast -- --test-threads=4: 678 passed, 0 failed, 41 ignored (SKIPPED GPU tests:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware, both "no wave64")cargo test -p xcl --lib gamesave: 12 passedRegression run
main:
PR:
Not tested
AI use
@futurepro62 on GitHub · 2026-11-24 03:04 UTC · original
Tested exact head
df34b7e(on its basea6f5f7a).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 678 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.Not tested
scripts/smoke.ps1(no title on this machine), AMD, wave64 hardware, a release build.AI use
@MesshM on GitHub · 2026-11-24 05:28 UTC · original
Test run of
df34b7ea057fe570cc30eeb1bf3fb209014843b7on AMD RDNA4. I merged it onto currentmaine50836blocally (clean merge) and tested that tree.Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge: 706 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 665 passed, 0 failed, 21 ignoredSKIPPED;dec_keeps_bad_escapes_literalandenumerating_a_container_with_a_bad_escape_does_not_abortpass.Review: Duplicate of #514 (open), and #325 has had other PRs too; all decode
%XXfrom bytes. This one also has the enumeration-level test (the issue's repro throughXGameSaveEnumerateContainerInfo), which is the stronger of the two. Only one should land.Not tested: no retail title or regression run (I have no unpacked game), no
XCL_SAMPLE_*tests, release build; the PR's head on its old base was not run, only its merge ontomain.Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
@DavidM1911 on GitHub · 2026-11-25 14:15 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.