Skip to content

runtime: handle save name allocation failures - #2709

Merged
R0Y00 merged 2 commits into
R0Y00:mainfrom
louisdibiasi:louis/gamesave-name-lock
Nov 26, 2026
Merged

R0Y00 merged 2 commits into
R0Y00:mainfrom
louisdibiasi:louis/gamesave-name-lock

Conversation

@louisdibiasi

Copy link
Copy Markdown
Contributor

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 c4b3be5:

  • 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 ed53c1f failed in unrelated duplicate D3D12 member declarations; the rerun above includes the merged upstream repair #2706.

AI-assisted (Codex). Synthetic fixtures only.

@R0Y00 R0Y00 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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
R0Y00 merged commit 51a198d into R0Y00:main Nov 26, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants