docs(debt): record that a PS5 faults on a null sceSystemServiceInitializePlayerDialogParam #15947

Closed
Destroyers212x wants to merge 1 commit from upstream-pr/15947 into main
Destroyers212x commented 2026-11-05 02:17:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Destroyers212x on 2026-11-05T02:17:21Z.


What

Records the console's answer for a null sceSystemServiceInitializePlayerDialogParam param, which the debt entry listed as unmeasured (Closes when: the null case is measured on a PS5). On a PS5 at firmware 13.60 the call takes a segmentation fault and returns no error code, so the existing throw stays and the entry keeps only what is still unverified (the field names, which follow SharpProspero). No code changes.

Measurement: a payload sent to the console's ELF loader dlopens libSceSystemService.sprx, calls the function once with a 0x100-byte buffer filled with 0xAA and once with NULL, and catches SIGSEGV/SIGBUS with sigsetjmp. Output:

valid: returned, rax=0x8004bb020
valid: last written byte offset 0x3f; first 0x40:
  40 00 00 00 00 00 00 00 00 00 00 00 ff ff ff ff
  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
null: fault signal 11
done

The valid call matches the current implementation and the prosper run: 0x40 bytes written, size 0x40, user ID -1 at 0xC, zeros, nothing past 0x3F.

Overlap: #12848 and #14085 edit neighbouring lines of docs/dev/debt/libSceSystemService.md but not this entry, so whichever lands second needs a one-line rebase; I'll rebase this one if they go first.

Probe source
#include <dlfcn.h>
#include <setjmp.h>
#include <signal.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>

typedef uint64_t (*init_fn)(void*);
static sigjmp_buf g_jmp;
static volatile int g_sig;

static void on_fault(int sig) { g_sig = sig; siglongjmp(g_jmp, 1); }

static void call(init_fn fn, void* arg, const char* label) {
  struct sigaction sa; memset(&sa, 0, sizeof sa); sa.sa_handler = on_fault;
  sigaction(SIGSEGV, &sa, 0); sigaction(SIGBUS, &sa, 0);
  g_sig = 0;
  if (sigsetjmp(g_jmp, 1) == 0) {
    uint64_t rax = fn(arg);
    printf("%s: returned, rax=0x%lx\n", label, (unsigned long)rax);
  } else {
    printf("%s: fault signal %d\n", label, g_sig);
  }
}

int main(void) {
  void* lib = dlopen("libSceSystemService.sprx", RTLD_LAZY);
  if (!lib) { printf("dlopen failed: %s\n", dlerror()); return 1; }
  init_fn fn = (init_fn)dlsym(lib, "sceSystemServiceInitializePlayerDialogParam");
  if (!fn) { printf("dlsym failed: %s\n", dlerror()); return 1; }
  uint8_t buf[0x100]; memset(buf, 0xAA, sizeof buf);
  call(fn, buf, "valid");
  int last = 0; for (int i = 0; i < 0x100; i++) if (buf[i] != 0xAA) last = i;
  printf("valid: last written byte offset 0x%x; first 0x40:", last);
  for (int i = 0; i < 0x40; i++) printf("%s%02x", i % 16 ? " " : "\n  ", buf[i]);
  printf("\n");
  call(fn, NULL, "null");
  printf("done\n");
  return 0;
}

Built with ps5-payload-sdk v0.45 (prospero-clang -Wall -Werror -g -rdynamic).

Tested

PS5, firmware 13.60, payload above through the ELF loader. Linux (Arch, kernel 7.2): ctest -R system_service 27/27 passed, including the existing null-throw check in GuestSystemService.cpp; tools/check_conventions.py --base origin/main passed.

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

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5164952841 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15947). Originally posted by [Destroyers212x](https://github.com/Destroyers212x) on 2026-11-05T02:17:21Z. --- ### What Records the console's answer for a null `sceSystemServiceInitializePlayerDialogParam` param, which the debt entry listed as unmeasured (`Closes when: the null case is measured on a PS5`). On a PS5 at firmware 13.60 the call takes a segmentation fault and returns no error code, so the existing throw stays and the entry keeps only what is still unverified (the field names, which follow SharpProspero). No code changes. Measurement: a payload sent to the console's ELF loader `dlopen`s `libSceSystemService.sprx`, calls the function once with a 0x100-byte buffer filled with 0xAA and once with NULL, and catches SIGSEGV/SIGBUS with `sigsetjmp`. Output: ``` valid: returned, rax=0x8004bb020 valid: last written byte offset 0x3f; first 0x40: 40 00 00 00 00 00 00 00 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 null: fault signal 11 done ``` The valid call matches the current implementation and the prosper run: 0x40 bytes written, size 0x40, user ID -1 at 0xC, zeros, nothing past 0x3F. Overlap: #12848 and #14085 edit neighbouring lines of `docs/dev/debt/libSceSystemService.md` but not this entry, so whichever lands second needs a one-line rebase; I'll rebase this one if they go first. <details><summary>Probe source</summary> ```c #include <dlfcn.h> #include <setjmp.h> #include <signal.h> #include <stdint.h> #include <stdio.h> #include <string.h> typedef uint64_t (*init_fn)(void*); static sigjmp_buf g_jmp; static volatile int g_sig; static void on_fault(int sig) { g_sig = sig; siglongjmp(g_jmp, 1); } static void call(init_fn fn, void* arg, const char* label) { struct sigaction sa; memset(&sa, 0, sizeof sa); sa.sa_handler = on_fault; sigaction(SIGSEGV, &sa, 0); sigaction(SIGBUS, &sa, 0); g_sig = 0; if (sigsetjmp(g_jmp, 1) == 0) { uint64_t rax = fn(arg); printf("%s: returned, rax=0x%lx\n", label, (unsigned long)rax); } else { printf("%s: fault signal %d\n", label, g_sig); } } int main(void) { void* lib = dlopen("libSceSystemService.sprx", RTLD_LAZY); if (!lib) { printf("dlopen failed: %s\n", dlerror()); return 1; } init_fn fn = (init_fn)dlsym(lib, "sceSystemServiceInitializePlayerDialogParam"); if (!fn) { printf("dlsym failed: %s\n", dlerror()); return 1; } uint8_t buf[0x100]; memset(buf, 0xAA, sizeof buf); call(fn, buf, "valid"); int last = 0; for (int i = 0; i < 0x100; i++) if (buf[i] != 0xAA) last = i; printf("valid: last written byte offset 0x%x; first 0x40:", last); for (int i = 0; i < 0x40; i++) printf("%s%02x", i % 16 ? " " : "\n ", buf[i]); printf("\n"); call(fn, NULL, "null"); printf("done\n"); return 0; } ``` Built with ps5-payload-sdk v0.45 (`prospero-clang -Wall -Werror -g -rdynamic`). </details> ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> PS5, firmware 13.60, payload above through the ELF loader. Linux (Arch, kernel 7.2): `ctest -R system_service` 27/27 passed, including the existing null-throw check in `GuestSystemService.cpp`; `tools/check_conventions.py --base origin/main` passed. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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 🤖 Generated with [Claude Code](https://claude.com/claude-code)
gabichuuuuu commented 2026-11-10 17:48:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-10T17:48:33Z.

Review: COMMENTED


Read e28eb56242 against main.

Correctness. The code still throws for a null param: Export.cpp:601 is if (param == nullptr) APS5_INVALID_ARG_EX;, and the macro (General.hpp:113) throws std::invalid_argument. For a valid param it writes size 0x40 and user ID -1 (Export.cpp:602-604), as the entry says. The console run (segmentation fault for NULL, rax=0x8004bb020 on 13.60) is in the PR description with its probe output and cannot be re-run here; removing "Closes when" is consistent with it. The rest of the entry is unchanged.

Non-blocking. GitHub reports the PR as conflicting with main in libSceSystemService.md; the entry moved to line 83 on main, so rebase before merging.

Not run here; this is from reading the code.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5846644674 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15947#pullrequestreview-5846644674). Originally posted by [gabichuuuuu](https://github.com/gabichuuuuu) on 2026-11-10T17:48:33Z. **Review:** COMMENTED --- Read `e28eb56242` against `main`. **Correctness.** The code still throws for a null param: `Export.cpp:601` is `if (param == nullptr) APS5_INVALID_ARG_EX;`, and the macro (`General.hpp:113`) throws `std::invalid_argument`. For a valid param it writes size 0x40 and user ID -1 (`Export.cpp:602-604`), as the entry says. The console run (segmentation fault for NULL, `rax=0x8004bb020` on 13.60) is in the PR description with its probe output and cannot be re-run here; removing "Closes when" is consistent with it. The rest of the entry is unchanged. **Non-blocking.** GitHub reports the PR as conflicting with `main` in `libSceSystemService.md`; the entry moved to line 83 on `main`, so rebase before merging. Not run here; this is from reading the code. AI-assisted: yes.
MarcZX10 commented 2026-11-23 05:11:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T05:11:49Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this documentation update; the changed entry records a console fault consistent with the existing null-parameter throw.

What I ran

Reviewed head e28eb56242e57fa5a2a8b02e08ec857b4ffe0d72. Read description.md, commits.md, manifest.json, diff.patch, and the full changed file docs/dev/debt/libSceSystemService.md; also read the relevant implementation and test ranges in Export.cpp and GuestSystemService.cpp through repo_read.py. No commands or tests were run.

Results

Check Result Note
Diff and changed entry passed One documentation line updated
Related implementation and test passed Existing throw and null test agree
Tests not run Author reports console and Linux runs

Findings

Blocking

None.

Non-blocking

None.

Not verified

The reported PS5 firmware 13.60 measurement, Linux test run, and conventions check were supplied by the author and were not independently reproduced. No files were excluded by the manifest.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6016841306 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15947#pullrequestreview-6016841306). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-23T05:11:49Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this documentation update; the changed entry records a console fault consistent with the existing null-parameter throw. ## What I ran Reviewed head `e28eb56242e57fa5a2a8b02e08ec857b4ffe0d72`. Read `description.md`, `commits.md`, `manifest.json`, `diff.patch`, and the full changed file `docs/dev/debt/libSceSystemService.md`; also read the relevant implementation and test ranges in `Export.cpp` and `GuestSystemService.cpp` through `repo_read.py`. No commands or tests were run. ## Results | Check | Result | Note | |---|---|---| | Diff and changed entry | passed | One documentation line updated | | Related implementation and test | passed | Existing throw and null test agree | | Tests | not run | Author reports console and Linux runs | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The reported PS5 firmware 13.60 measurement, Linux test run, and conventions check were supplied by the author and were not independently reproduced. No files were excluded by the manifest. ## To get this to a good state Nothing is required.

Pull request closed

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!15947
No description provided.