runtime: handle save name allocation failures #2709

Manually merged
github merged 2 commits from gh-pr/2709/head into gh-pr/2709/base 2026-11-27 01:17:08 +00:00
Owner

@⁠louisdibiasi on GitHub · 2026-11-26 03:02 UTC · original
louisdibiasi:louis/gamesave-name-lock → main · +32 −6 · 3 files · 2 commits · merged 2026-11-26 03:18 UTC

Change

Follow-up to #2697. An allocation failure while copying a long container name in update_container returns E_OUTOFMEMORY through the save-action handler, but leaves its shared save lock held. Release the lock on that exception so later operations can proceed.

valid_name is also noexcept yet allocates when a name has a long stem; an allocation failure there terminates the process. Compare the reserved device-name stem through a string_view instead, preserving the existing validation rules without an allocation.

The source-built fixture injects failure into the container-name copy, checks the error and takes the lock exclusively without blocking, then retries the update. It also verifies validation of a long name without allocating. On the merged #2697 code, the lock check failed (fixture exit 24); the old allocating validator terminated the isolated child (exit 3). Existing tests cover accepted and rejected names, including reserved device names and the length limit. No application occurrence is claimed.

Verification

Windows x64, MSVC 19.44; head c4b3be58:

  • cmake --build --preset dev --target startup_gamesave_submit startup_gamesave_persist and ctest --preset dev --no-tests=error -R '^startup_gamesave_(submit_|persist)' --output-on-failure: 3 passed.
  • The same focused build and CTest filter with --preset release: 3 passed before the unrelated upstream merge; the affected files did not change in that merge.
  • cmake --build --preset pr and ctest --preset pr --no-tests=error: 34 passed, 4 MinLOD capability skips.
  • git diff --check upstream/main...HEAD: clean.

The first PR build attempt on upstream ed53c1fe failed in unrelated duplicate D3D12 member declarations; the rerun above includes the merged upstream repair #2706.

AI-assisted (Codex). Synthetic fixtures only.

**@⁠louisdibiasi** on GitHub · 2026-11-26 03:02 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2709) `louisdibiasi:louis/gamesave-name-lock` → `main` · +32 −6 · 3 files · 2 commits · merged 2026-11-26 03:18 UTC ## Change Follow-up to #2697. An allocation failure while copying a long container name in `update_container` returns `E_OUTOFMEMORY` through the save-action handler, but leaves its shared save lock held. Release the lock on that exception so later operations can proceed. `valid_name` is also `noexcept` yet allocates when a name has a long stem; an allocation failure there terminates the process. Compare the reserved device-name stem through a `string_view` instead, preserving the existing validation rules without an allocation. The source-built fixture injects failure into the container-name copy, checks the error and takes the lock exclusively without blocking, then retries the update. It also verifies validation of a long name without allocating. On the merged #2697 code, the lock check failed (fixture exit 24); the old allocating validator terminated the isolated child (exit 3). Existing tests cover accepted and rejected names, including reserved device names and the length limit. No application occurrence is claimed. ## Verification Windows x64, MSVC 19.44; head c4b3be58: - `cmake --build --preset dev --target startup_gamesave_submit startup_gamesave_persist` and `ctest --preset dev --no-tests=error -R '^startup_gamesave_(submit_|persist)' --output-on-failure`: 3 passed. - The same focused build and CTest filter with `--preset release`: 3 passed before the unrelated upstream merge; the affected files did not change in that merge. - `cmake --build --preset pr` and `ctest --preset pr --no-tests=error`: 34 passed, 4 MinLOD capability skips. - `git diff --check upstream/main...HEAD`: clean. The first PR build attempt on upstream ed53c1fe failed in unrelated duplicate D3D12 member declarations; the rerun above includes the merged upstream repair #2706. AI-assisted (Codex). Synthetic fixtures only.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:17:05 +00:00
github manually merged commit c4b3be581f into gh-pr/2709/base 2026-11-27 01:17:08 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-26 03:18 UTC · original · approved these changes

Verified from this head with MSVC Debug and /O2, using both the synthetic scheduler and the system Immediate queue (4/4). The long-name allocation injection returns E_OUTOFMEMORY, an exclusive lock is immediately available, and retrying the same update writes the data. The reserved-name stem comparison keeps its ASCII folding and space trimming without allocating.

**@⁠R0Y00** on GitHub · 2026-11-26 03:18 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2709#pullrequestreview-6068099289) · **approved these changes** Verified from this head with MSVC Debug and /O2, using both the synthetic scheduler and the system Immediate queue (4/4). The long-name allocation injection returns E_OUTOFMEMORY, an exclusive lock is immediately available, and retrying the same update writes the data. The reserved-name stem comparison keeps its ASCII folding and space trimming without allocating.
This discussion has been locked. Commenting is limited to contributors.
No description provided.