fix(libSceGameCustomDataDialog): return ARG_NULL from sceGameCustomDataDialogGetResultA for unwritable result #15392

Merged
szambonurek-88 merged 1 commit from upstream-pr/15392 into main 2026-11-07 09:15:18 +00:00
szambonurek-88 commented 2026-11-03 04:55:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by szambonurek-88 on 2026-11-03T04:55:22Z.


What

Return COMMON_DIALOG_ERROR_ARG_NULL (0x80B8000D) from sceGameCustomDataDialogGetResultA when destination memory cannot be written, rather than crashing with SIGSEGV in host space.

  • Copy output data to destination pointer via GuestCopyOut_nid_no_patch.
  • Preserve caller errno across copy check.
  • Add regression coverage in core/libs/tests/GuestGameCustomDataDialog.cpp asserting that sceGameCustomDataDialogGetResultA returns expected error and preserves errno when passed 0x10.
  • Document host-safety fallback in docs/dev/debt/libSceGameCustomDataDialog.md.

Tested

  • Windows 11 (AMD Ryzen 7 7800X3D, MSVC 19.51 / VS 2026, Python 3.14).
  • python tools/check_conventions.py --base origin/main: passed with 0 findings.
  • Negative control: on unmodified main, passing reinterpret_cast<void*>(0x10) to sceGameCustomDataDialogGetResultA faults on direct pointer dereference.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • 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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5132112737 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15392). Originally posted by [szambonurek-88](https://github.com/szambonurek-88) on 2026-11-03T04:55:22Z. --- ### What Return COMMON_DIALOG_ERROR_ARG_NULL (`0x80B8000D`) from `sceGameCustomDataDialogGetResultA` when destination memory cannot be written, rather than crashing with SIGSEGV in host space. - Copy output data to destination pointer via `GuestCopyOut_nid_no_patch`. - Preserve caller `errno` across copy check. - Add regression coverage in `core/libs/tests/GuestGameCustomDataDialog.cpp` asserting that `sceGameCustomDataDialogGetResultA` returns expected error and preserves `errno` when passed `0x10`. - Document host-safety fallback in `docs/dev/debt/libSceGameCustomDataDialog.md`. ### Tested - Windows 11 (AMD Ryzen 7 7800X3D, MSVC 19.51 / VS 2026, Python 3.14). - `python tools/check_conventions.py --base origin/main`: passed with 0 findings. - Negative control: on unmodified `main`, passing `reinterpret_cast<void*>(0x10)` to `sceGameCustomDataDialogGetResultA` faults on direct pointer dereference. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [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
MarcZX10 commented 2026-11-03 05:25:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-03T05:25:50Z.

Review: APPROVED


Reviewed — looks good

The exact reviewed head safely copies the dialog result to guest memory, preserves errno, and passes its focused hosted test.

What I ran

Reviewed all three changed files at head 95514547ed5458729d6840402264e807d86012c3 against PR base f6232fcfda70644495273f6b8dd88cf0603463d6. The no-build merge preview was clean against current main d1ae628bc2f62459cce1e9872ba5632c938c71f2. Local environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0. I did not compile locally; the Windows build and test are hosted CI results.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15392
git diff --check f6232fcfda70644495273f6b8dd88cf0603463d6...95514547ed5458729d6840402264e807d86012c3
gh pr checks 15392 -R boykopovar/AnyPS5
gh run view 41580884383 -R boykopovar/AnyPS5 --job 125735220145 --log
git show 95514547ed5458729d6840402264e807d86012c3:core/libs/prx/libSceGameCustomDataDialog/CMakeLists.txt

Results

Check Result Note
Diff and conventions passed Exact-head checks passed.
Current-main merge preview passed Clean against d1ae628.
Windows focused build and CTest passed guest_game_custom_data_dialog passed 1/1.
Hosted policy and portability checks passed All applicable checks completed successfully.
Test registration passed CMake registers the changed test executable.
Optional precheck audits not run Reviewer helper scripts are absent from the isolated PR snapshot.
Local build and CTest not run No local compilation or runtime test.
Linux and specialized jobs not applicable Skipped by the workflow.
Precheck results and raw output
Check Status Command / reason
build_and_compile not_applicable The precheck deliberately does not configure, build, or compile AnyPS5.
diff_check passed git diff --check f6232fcfda70644495273f6b8dd88cf0603463d6...95514547ed5458729d6840402264e807d86012c3
conventions_and_pr_template passed /usr/bin/python3 tools/check_conventions.py --base f6232fcfda70644495273f6b8dd88cf0603463d6 --head 95514547ed5458729d6840402264e807d86012c3 --title fix(libSceGameCustomDataDialog): return ARG_NULL from sceGameCustomDataDialogGetResultA for unwritable result --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15392-95514547ed54/pr-body.md
changed_export_abi_audit failed /usr/bin/python3 tools/pr_abi_audit.py --base f6232fcfda70644495273f6b8dd88cf0603463d6 --head 95514547ed5458729d6840402264e807d86012c3 --json
python_syntax not_applicable No changed Python implementation files.
related_python_unit_tests not_applicable No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.
python_test_registration not_applicable No changed test_*.py files.
live_dependency_and_mergeability_check passed /usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 15392 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15392-95514547ed54/stack
build_dependent_cpp_tests not_applicable Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.
test_quality_heuristics failed /usr/bin/python3 /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15392-95514547ed54/head-95514547ed54-cea41b25/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15392-95514547ed54/head-95514547ed54-cea41b25 --json core/libs/prx/libSceGameCustomDataDialog/Export.cpp core/libs/tests/GuestGameCustomDataDialog.cpp docs/dev/debt/libSceGameCustomDataDialog.md
negative_controls not_applicable No changed Python test module in tools/ can be run as a no-build source control.

The two failed helper invocations could not launch because the corresponding scripts are absent from the isolated PR snapshot; they did not report code findings. Raw precheck output:

/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15392-95514547ed54/report.md
/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15392-95514547ed54/report.json
Conclusion: checks failed
All conventions checks passed.
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15392-95514547ed54/head-95514547ed54-cea41b25/tools/pr_abi_audit.py': [Errno 2] No such file or directory
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15392-95514547ed54/head-95514547ed54-cea41b25/tools/pr_test_quality.py': [Errno 2] No such file or directory

gh pr checks output:

edge-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41580884383/job/125735221475
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41580884383/job/125735221464
register-context	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41580884383/job/125735221854
windows	pass	2m58s	https://github.com/boykopovar/AnyPS5/actions/runs/41580884383/job/125735220145
relinker-asan	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41580884383/job/125735221676
write-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41580884383/job/125735221619
conventions	pass	15s	https://github.com/boykopovar/AnyPS5/actions/runs/41580884189/job/125735181915
relinker	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41580884383/job/125735222215
eligibility	pass	6s	https://github.com/boykopovar/AnyPS5/actions/runs/41580884383/job/125735181563
intake	pass	22s	https://github.com/boykopovar/AnyPS5/actions/runs/41580884224/job/125735181973
labels	pass	7s	https://github.com/boykopovar/AnyPS5/actions/runs/41580884192/job/125735181709
library-portability	pass	1m47s	https://github.com/boykopovar/AnyPS5/actions/runs/41580884335/job/125735181072
report	pass	56s	https://github.com/boykopovar/AnyPS5/actions/runs/41580884256/job/125735180828

Unedited hosted Windows log lines:

windows	Build and run changed guest core/libs tests	2026-11-03T04:58:27.1455690Z [2/4] Building CXX object core/libs/prx/libSceGameCustomDataDialog/CMakeFiles/guest_game_custom_data_dialog_tests.dir/__/__/tests/GuestGameCustomDataDialog.cpp.obj
windows	Build and run changed guest core/libs tests	2026-11-03T04:58:27.2036895Z [3/4] Linking CXX executable tests\guest_game_custom_data_dialog_tests.exe
windows	Build and run changed guest core/libs tests	2026-11-03T04:58:27.8244330Z     Start 2482: guest_game_custom_data_dialog
windows	Build and run changed guest core/libs tests	2026-11-03T04:58:27.8356210Z 1/1 Test #2482: guest_game_custom_data_dialog ....   Passed    0.01 sec
windows	Build and run changed guest core/libs tests	2026-11-03T04:58:27.8364237Z Total Test time (real) =   0.09 sec

Negative control

The assertion is that an unwritable non-null result pointer returns COMMON_DIALOG_ERROR_ARG_NULL and leaves errno unchanged. The author reports that the old direct-write path faults on unmodified main; I did not independently run that control.

Findings

Blocking

None found in the complete three-file diff.

Non-blocking

The new invalid-pointer return is documented as a host-safety fallback; its console behavior remains unmeasured.

Sources

Not verified

No local build, CTest, negative control, Linux runtime or console behavior was run. The negative control is author-reported only; Linux and specialized hosted jobs were skipped.

To get this to a good state

No code change is requested. If the head changes, I will rerun the same precheck and diff checks and review the new diff.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5747604444 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15392#pullrequestreview-5747604444). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-03T05:25:50Z. **Review:** APPROVED --- # Reviewed — looks good The exact reviewed head safely copies the dialog result to guest memory, preserves `errno`, and passes its focused hosted test. ## What I ran Reviewed all three changed files at head `95514547ed5458729d6840402264e807d86012c3` against PR base `f6232fcfda70644495273f6b8dd88cf0603463d6`. The no-build merge preview was clean against current `main` `d1ae628bc2f62459cce1e9872ba5632c938c71f2`. Local environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0. I did not compile locally; the Windows build and test are hosted CI results. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15392 git diff --check f6232fcfda70644495273f6b8dd88cf0603463d6...95514547ed5458729d6840402264e807d86012c3 gh pr checks 15392 -R boykopovar/AnyPS5 gh run view 41580884383 -R boykopovar/AnyPS5 --job 125735220145 --log git show 95514547ed5458729d6840402264e807d86012c3:core/libs/prx/libSceGameCustomDataDialog/CMakeLists.txt ``` ## Results | Check | Result | Note | |---|---|---| | Diff and conventions | passed | Exact-head checks passed. | | Current-main merge preview | passed | Clean against `d1ae628`. | | Windows focused build and CTest | passed | `guest_game_custom_data_dialog` passed 1/1. | | Hosted policy and portability checks | passed | All applicable checks completed successfully. | | Test registration | passed | CMake registers the changed test executable. | | Optional precheck audits | not run | Reviewer helper scripts are absent from the isolated PR snapshot. | | Local build and CTest | not run | No local compilation or runtime test. | | Linux and specialized jobs | not applicable | Skipped by the workflow. | <details><summary>Precheck results and raw output</summary> | Check | Status | Command / reason | |---|---|---| | build_and_compile | not_applicable | `The precheck deliberately does not configure, build, or compile AnyPS5.` | | diff_check | passed | `git diff --check f6232fcfda70644495273f6b8dd88cf0603463d6...95514547ed5458729d6840402264e807d86012c3` | | conventions_and_pr_template | passed | `/usr/bin/python3 tools/check_conventions.py --base f6232fcfda70644495273f6b8dd88cf0603463d6 --head 95514547ed5458729d6840402264e807d86012c3 --title fix(libSceGameCustomDataDialog): return ARG_NULL from sceGameCustomDataDialogGetResultA for unwritable result --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15392-95514547ed54/pr-body.md` | | changed_export_abi_audit | failed | `/usr/bin/python3 tools/pr_abi_audit.py --base f6232fcfda70644495273f6b8dd88cf0603463d6 --head 95514547ed5458729d6840402264e807d86012c3 --json` | | python_syntax | not_applicable | `No changed Python implementation files.` | | related_python_unit_tests | not_applicable | `No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.` | | python_test_registration | not_applicable | `No changed test_*.py files.` | | live_dependency_and_mergeability_check | passed | `/usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 15392 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15392-95514547ed54/stack` | | build_dependent_cpp_tests | not_applicable | `Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.` | | test_quality_heuristics | failed | `/usr/bin/python3 /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15392-95514547ed54/head-95514547ed54-cea41b25/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15392-95514547ed54/head-95514547ed54-cea41b25 --json core/libs/prx/libSceGameCustomDataDialog/Export.cpp core/libs/tests/GuestGameCustomDataDialog.cpp docs/dev/debt/libSceGameCustomDataDialog.md` | | negative_controls | not_applicable | `No changed Python test module in tools/ can be run as a no-build source control.` | The two `failed` helper invocations could not launch because the corresponding scripts are absent from the isolated PR snapshot; they did not report code findings. Raw precheck output: ```text /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15392-95514547ed54/report.md /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15392-95514547ed54/report.json Conclusion: checks failed All conventions checks passed. /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15392-95514547ed54/head-95514547ed54-cea41b25/tools/pr_abi_audit.py': [Errno 2] No such file or directory /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15392-95514547ed54/head-95514547ed54-cea41b25/tools/pr_test_quality.py': [Errno 2] No such file or directory ``` `gh pr checks` output: ```text edge-watch skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41580884383/job/125735221475 linux skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41580884383/job/125735221464 register-context skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41580884383/job/125735221854 windows pass 2m58s https://github.com/boykopovar/AnyPS5/actions/runs/41580884383/job/125735220145 relinker-asan skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41580884383/job/125735221676 write-watch skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41580884383/job/125735221619 conventions pass 15s https://github.com/boykopovar/AnyPS5/actions/runs/41580884189/job/125735181915 relinker skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41580884383/job/125735222215 eligibility pass 6s https://github.com/boykopovar/AnyPS5/actions/runs/41580884383/job/125735181563 intake pass 22s https://github.com/boykopovar/AnyPS5/actions/runs/41580884224/job/125735181973 labels pass 7s https://github.com/boykopovar/AnyPS5/actions/runs/41580884192/job/125735181709 library-portability pass 1m47s https://github.com/boykopovar/AnyPS5/actions/runs/41580884335/job/125735181072 report pass 56s https://github.com/boykopovar/AnyPS5/actions/runs/41580884256/job/125735180828 ``` Unedited hosted Windows log lines: ```text windows Build and run changed guest core/libs tests 2026-11-03T04:58:27.1455690Z [2/4] Building CXX object core/libs/prx/libSceGameCustomDataDialog/CMakeFiles/guest_game_custom_data_dialog_tests.dir/__/__/tests/GuestGameCustomDataDialog.cpp.obj windows Build and run changed guest core/libs tests 2026-11-03T04:58:27.2036895Z [3/4] Linking CXX executable tests\guest_game_custom_data_dialog_tests.exe windows Build and run changed guest core/libs tests 2026-11-03T04:58:27.8244330Z Start 2482: guest_game_custom_data_dialog windows Build and run changed guest core/libs tests 2026-11-03T04:58:27.8356210Z 1/1 Test #2482: guest_game_custom_data_dialog .... Passed 0.01 sec windows Build and run changed guest core/libs tests 2026-11-03T04:58:27.8364237Z Total Test time (real) = 0.09 sec ``` </details> ## Negative control The assertion is that an unwritable non-null result pointer returns `COMMON_DIALOG_ERROR_ARG_NULL` and leaves `errno` unchanged. The author reports that the old direct-write path faults on unmodified `main`; I did not independently run that control. ## Findings ### Blocking None found in the complete three-file diff. ### Non-blocking The new invalid-pointer return is documented as a host-safety fallback; its console behavior remains unmeasured. ## Sources - [Result-copy implementation at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/95514547ed5458729d6840402264e807d86012c3/core/libs/prx/libSceGameCustomDataDialog/Export.cpp#L52-L63) - [Regression assertion at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/95514547ed5458729d6840402264e807d86012c3/core/libs/tests/GuestGameCustomDataDialog.cpp#L40-L54) - [Guest copy-out helper at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/95514547ed5458729d6840402264e807d86012c3/core/libs/prx/libc/src/General.cpp#L823-L852) - [Documented host-safety limitation at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/95514547ed5458729d6840402264e807d86012c3/docs/dev/debt/libSceGameCustomDataDialog.md#L3-L7) ## Not verified No local build, CTest, negative control, Linux runtime or console behavior was run. The negative control is author-reported only; Linux and specialized hosted jobs were skipped. ## To get this to a good state No code change is requested. If the head changes, I will rerun the same precheck and diff checks and review the new diff.
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!15392
No description provided.