fix(libSceSigninDialog): return ARG_NULL from sceSigninDialogGetResult for unwritable result #15391

Merged
szambonurek-88 merged 1 commit from upstream-pr/15391 into main 2026-11-07 08:58:30 +00:00
szambonurek-88 commented 2026-11-03 04:55:11 +00:00 (Migrated from github.com)

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


What

Return COMMON_DIALOG_ERROR_ARG_NULL (0x80B8000D) from sceSigninDialogGetResult 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/GuestSigninDialog.cpp asserting that sceSigninDialogGetResult returns expected error and preserves errno when passed 0x10.
  • Document host-safety fallback in docs/dev/debt/libSceSigninDialog.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 sceSigninDialogGetResult 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:5132111272 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15391). Originally posted by [szambonurek-88](https://github.com/szambonurek-88) on 2026-11-03T04:55:11Z. --- ### What Return COMMON_DIALOG_ERROR_ARG_NULL (`0x80B8000D`) from `sceSigninDialogGetResult` 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/GuestSigninDialog.cpp` asserting that `sceSigninDialogGetResult` returns expected error and preserves `errno` when passed `0x10`. - Document host-safety fallback in `docs/dev/debt/libSceSigninDialog.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 `sceSigninDialogGetResult` 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:26:43 +00:00 (Migrated from github.com)

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

Review: APPROVED


Reviewed — looks good

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

What I ran

Reviewed all three changed files at head 5ba917e89a8b78d950b46b69ed3cc06650384065 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. No local compilation or CTest was run; the Windows build/test below are hosted CI evidence.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15391
git diff --check f6232fcfda70644495273f6b8dd88cf0603463d6...5ba917e89a8b78d950b46b69ed3cc06650384065
gh pr checks 15391 -R boykopovar/AnyPS5
gh run view 41580866481 -R boykopovar/AnyPS5 --job 125735161552 --log
git show 5ba917e89a8b78d950b46b69ed3cc06650384065:core/libs/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_signin_dialog passed 1/1.
Hosted policy and portability checks passed All applicable checks completed successfully.
Test registration passed CMake registers the changed test.
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...5ba917e89a8b78d950b46b69ed3cc06650384065
conventions_and_pr_template passed /usr/bin/python3 tools/check_conventions.py --base f6232fcfda70644495273f6b8dd88cf0603463d6 --head 5ba917e89a8b78d950b46b69ed3cc06650384065 --title fix(libSceSigninDialog): return ARG_NULL from sceSigninDialogGetResult for unwritable result --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15391-5ba917e89a8b/pr-body.md
changed_export_abi_audit failed /usr/bin/python3 tools/pr_abi_audit.py --base f6232fcfda70644495273f6b8dd88cf0603463d6 --head 5ba917e89a8b78d950b46b69ed3cc06650384065 --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 15391 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15391-5ba917e89a8b/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-15391-5ba917e89a8b/head-5ba917e89a8b-c19b3dcf/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15391-5ba917e89a8b/head-5ba917e89a8b-c19b3dcf --json core/libs/prx/libSceSigninDialog/Export.cpp core/libs/tests/GuestSigninDialog.cpp docs/dev/debt/libSceSigninDialog.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 those scripts are absent from the isolated PR snapshot; they did not report code findings. Raw precheck output:

/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15391-5ba917e89a8b/report.md
/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15391-5ba917e89a8b/report.json
Conclusion: checks failed
All conventions checks passed.
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15391-5ba917e89a8b/head-5ba917e89a8b-c19b3dcf/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-15391-5ba917e89a8b/head-5ba917e89a8b-c19b3dcf/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/41580866481/job/125735163223
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41580866481/job/125735163573
register-context	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41580866481/job/125735162973
relinker	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41580866481/job/125735162708
relinker-asan	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41580866481/job/125735163746
write-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41580866481/job/125735163242
conventions	pass	21s	https://github.com/boykopovar/AnyPS5/actions/runs/41580866636/job/125735127949
eligibility	pass	5s	https://github.com/boykopovar/AnyPS5/actions/runs/41580866481/job/125735125793
intake	pass	18s	https://github.com/boykopovar/AnyPS5/actions/runs/41580866690/job/125735128410
labels	pass	5s	https://github.com/boykopovar/AnyPS5/actions/runs/41580866543/job/125735127134
library-portability	pass	1m49s	https://github.com/boykopovar/AnyPS5/actions/runs/41580866608/job/125735126217
report	pass	34s	https://github.com/boykopovar/AnyPS5/actions/runs/41580866576/job/125735126189
windows	pass	4m11s	https://github.com/boykopovar/AnyPS5/actions/runs/41580866481/job/125735161552

Unedited hosted Windows log lines:

windows	Build and run changed guest core/libs tests	2026-11-03T04:59:21.5145439Z [3/4] Linking CXX executable tests\guest_signin_dialog_tests.exe
windows	Build and run changed guest core/libs tests	2026-11-03T04:59:22.4440052Z 1/1 Test #609: guest_signin_dialog ..............   Passed    0.02 sec
windows	Build and run changed guest core/libs tests	2026-11-03T04:59:22.4451738Z Total Test time (real) =   0.15 sec

Negative control

The assertion is that an unwritable 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 reproduce that control.

Findings

Blocking

None found in the complete three-file diff.

Non-blocking

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

Sources

Not verified

No local build, CTest, independent 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:5747609748 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15391#pullrequestreview-5747609748). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-03T05:26:43Z. **Review:** APPROVED --- # Reviewed — looks good The exact reviewed head safely copies the complete sign-in result to guest memory, preserves `errno`, and passes its focused hosted test. ## What I ran Reviewed all three changed files at head `5ba917e89a8b78d950b46b69ed3cc06650384065` 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. No local compilation or CTest was run; the Windows build/test below are hosted CI evidence. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15391 git diff --check f6232fcfda70644495273f6b8dd88cf0603463d6...5ba917e89a8b78d950b46b69ed3cc06650384065 gh pr checks 15391 -R boykopovar/AnyPS5 gh run view 41580866481 -R boykopovar/AnyPS5 --job 125735161552 --log git show 5ba917e89a8b78d950b46b69ed3cc06650384065:core/libs/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_signin_dialog` passed 1/1. | | Hosted policy and portability checks | passed | All applicable checks completed successfully. | | Test registration | passed | CMake registers the changed test. | | 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...5ba917e89a8b78d950b46b69ed3cc06650384065` | | conventions_and_pr_template | passed | `/usr/bin/python3 tools/check_conventions.py --base f6232fcfda70644495273f6b8dd88cf0603463d6 --head 5ba917e89a8b78d950b46b69ed3cc06650384065 --title fix(libSceSigninDialog): return ARG_NULL from sceSigninDialogGetResult for unwritable result --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15391-5ba917e89a8b/pr-body.md` | | changed_export_abi_audit | failed | `/usr/bin/python3 tools/pr_abi_audit.py --base f6232fcfda70644495273f6b8dd88cf0603463d6 --head 5ba917e89a8b78d950b46b69ed3cc06650384065 --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 15391 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15391-5ba917e89a8b/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-15391-5ba917e89a8b/head-5ba917e89a8b-c19b3dcf/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15391-5ba917e89a8b/head-5ba917e89a8b-c19b3dcf --json core/libs/prx/libSceSigninDialog/Export.cpp core/libs/tests/GuestSigninDialog.cpp docs/dev/debt/libSceSigninDialog.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 those 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-15391-5ba917e89a8b/report.md /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15391-5ba917e89a8b/report.json Conclusion: checks failed All conventions checks passed. /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15391-5ba917e89a8b/head-5ba917e89a8b-c19b3dcf/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-15391-5ba917e89a8b/head-5ba917e89a8b-c19b3dcf/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/41580866481/job/125735163223 linux skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41580866481/job/125735163573 register-context skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41580866481/job/125735162973 relinker skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41580866481/job/125735162708 relinker-asan skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41580866481/job/125735163746 write-watch skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41580866481/job/125735163242 conventions pass 21s https://github.com/boykopovar/AnyPS5/actions/runs/41580866636/job/125735127949 eligibility pass 5s https://github.com/boykopovar/AnyPS5/actions/runs/41580866481/job/125735125793 intake pass 18s https://github.com/boykopovar/AnyPS5/actions/runs/41580866690/job/125735128410 labels pass 5s https://github.com/boykopovar/AnyPS5/actions/runs/41580866543/job/125735127134 library-portability pass 1m49s https://github.com/boykopovar/AnyPS5/actions/runs/41580866608/job/125735126217 report pass 34s https://github.com/boykopovar/AnyPS5/actions/runs/41580866576/job/125735126189 windows pass 4m11s https://github.com/boykopovar/AnyPS5/actions/runs/41580866481/job/125735161552 ``` Unedited hosted Windows log lines: ```text windows Build and run changed guest core/libs tests 2026-11-03T04:59:21.5145439Z [3/4] Linking CXX executable tests\guest_signin_dialog_tests.exe windows Build and run changed guest core/libs tests 2026-11-03T04:59:22.4440052Z 1/1 Test #609: guest_signin_dialog .............. Passed 0.02 sec windows Build and run changed guest core/libs tests 2026-11-03T04:59:22.4451738Z Total Test time (real) = 0.15 sec ``` </details> ## Negative control The assertion is that an unwritable 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 reproduce that control. ## Findings ### Blocking None found in the complete three-file diff. ### Non-blocking The invalid-pointer return is documented as a host-safety fallback; console behavior remains unmeasured. ## Sources - [Checked result-copy path at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/5ba917e89a8b78d950b46b69ed3cc06650384065/core/libs/prx/libSceSigninDialog/Export.cpp#L40-L50) - [Invalid-pointer regression at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/5ba917e89a8b78d950b46b69ed3cc06650384065/core/libs/tests/GuestSigninDialog.cpp#L55-L67) - [CMake registration at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/5ba917e89a8b78d950b46b69ed3cc06650384065/core/libs/CMakeLists.txt#L839-L845) - [Guest copy-out helper at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/5ba917e89a8b78d950b46b69ed3cc06650384065/core/libs/prx/libc/src/General.cpp#L823-L852) - [Documented host-safety limitation at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/5ba917e89a8b78d950b46b69ed3cc06650384065/docs/dev/debt/libSceSigninDialog.md#L4-L8) ## Not verified No local build, CTest, independent 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!15391
No description provided.