fix(libSceAppContent): guard mount output #18598

Merged
DonRyuzaki merged 3 commits from upstream-pr/18598 into main 2026-11-12 13:20:40 +00:00
DonRyuzaki commented 2026-11-11 22:40:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by DonRyuzaki on 2026-11-11T22:40:58Z.


What

sceAppContentTemporaryDataMount2 now checks its guest mount-point output before creating or formatting temporary storage, registering /temp0, or changing mount state. If the non-null output is inaccessible, it returns SCE_APP_CONTENT_ERROR_PARAMETER, consistent with the other checked copy-out in this module. The technical debt entry identifies that return as a host-safety fallback; the console's invalid-memory result has not been measured. A later host filesystem failure could still leave the output set without a completed mount.

The focused test covers initialization, option validation and BUSY precedence, the inaccessible-output error, unchanged pre-existing files, no alias or mount after failure, and a later valid mount. This addresses Dean's review without changing Addcont or AppParam mount output behavior.

Tested

Committed head 59ccf512f0d622789d17c53a21023e627f425cb4 includes upstream 81a6da926403aedd2d5f88d0324c52dfe854e0e0; branch working tree clean. tools/check_conventions.py --base origin/main and git diff --check pass. An earlier Windows GCC 15.2 object compilation and separate baseline reproduction are described in the prior revision of this PR; they were not rerun on this head.

Ubuntu 24.04 WSL2, Release, BUILD_TESTING=ON: with the exact branch versions of Export.cpp, GuestAppContent.cpp, and the debt entry overlaid on clean pinned upstream 81a6da9, the full libs target and guest_appcontent_tests built successfully (1,307 Ninja steps, including NID-patched libSceAppContent.prx). guest_appcontent passed three consecutive CTest runs, no skips. SHA-256: unpatched libSceAppContent.prx 8336b9a75f0f366fdc2a39c162c1f1f1e172b6213547f4235646b1d89b4d376f; patched 76b743bad5c7e2cfce7a7442072b307b8601d697b510514e4c89d78d2d08345e. The temporary build source was restored clean after validation.

The overlap bot could not compare #14212's debt file because that PR conflicts with main. I compared its patch manually: it edits separate AppContent debt entries and does not implement or modify sceAppContentTemporaryDataMount2. Open #18516, #17955 and #18116 change other AppContent exports in the same files; their patches and discussion were reviewed. Full project CTest, console behavior and game behavior are not claimed.

Checklist

  • Based on recent main; no other open PR implements the same function
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; silent stubs are listed in technical debt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes (Codex)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5267856637 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18598). Originally posted by [DonRyuzaki](https://github.com/DonRyuzaki) on 2026-11-11T22:40:58Z. --- ### What `sceAppContentTemporaryDataMount2` now checks its guest mount-point output before creating or formatting temporary storage, registering `/temp0`, or changing mount state. If the non-null output is inaccessible, it returns `SCE_APP_CONTENT_ERROR_PARAMETER`, consistent with the other checked copy-out in this module. The technical debt entry identifies that return as a host-safety fallback; the console's invalid-memory result has not been measured. A later host filesystem failure could still leave the output set without a completed mount. The focused test covers initialization, option validation and BUSY precedence, the inaccessible-output error, unchanged pre-existing files, no alias or mount after failure, and a later valid mount. This addresses [Dean's review](https://github.com/boykopovar/AnyPS5/pull/18598#issuecomment-6811577290) without changing Addcont or AppParam mount output behavior. ### Tested Committed head `59ccf512f0d622789d17c53a21023e627f425cb4` includes upstream `81a6da926403aedd2d5f88d0324c52dfe854e0e0`; branch working tree clean. `tools/check_conventions.py --base origin/main` and `git diff --check` pass. An earlier Windows GCC 15.2 object compilation and separate baseline reproduction are described in the prior revision of this PR; they were not rerun on this head. Ubuntu 24.04 WSL2, Release, `BUILD_TESTING=ON`: with the exact branch versions of `Export.cpp`, `GuestAppContent.cpp`, and the debt entry overlaid on clean pinned upstream `81a6da9`, the full `libs` target and `guest_appcontent_tests` built successfully (1,307 Ninja steps, including NID-patched `libSceAppContent.prx`). `guest_appcontent` passed three consecutive CTest runs, no skips. SHA-256: unpatched `libSceAppContent.prx` `8336b9a75f0f366fdc2a39c162c1f1f1e172b6213547f4235646b1d89b4d376f`; patched `76b743bad5c7e2cfce7a7442072b307b8601d697b510514e4c89d78d2d08345e`. The temporary build source was restored clean after validation. The overlap bot could not compare #14212's debt file because that PR conflicts with main. I compared its patch manually: it edits separate AppContent debt entries and does not implement or modify `sceAppContentTemporaryDataMount2`. Open #18516, #17955 and #18116 change other AppContent exports in the same files; their patches and discussion were reviewed. Full project CTest, console behavior and game behavior are not claimed. ### Checklist <!-- Rules: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on recent `main`; no other open PR implements the same function - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw; silent stubs are listed in technical debt - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes (Codex)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!18598
No description provided.