fix(libkernel): report kern.proc kinfo_proc as the console's 1,096 bytes #22788

Merged
xXPBSXx merged 3 commits from upstream-pr/22788 into main 2026-11-27 15:02:46 +00:00
xXPBSXx commented 2026-11-18 09:21:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-11-18T09:21:44Z.


What

Makes kern.proc.pid, kern.proc.pid_td and kern.proc.proc report the process record, kinfo_proc, with the 1,096 bytes that a PS5 on firmware 11.60 reported to a payload process, where AnyPS5 reported FreeBSD 11 amd64's 1,088 bytes. Four probes on that PS5 only read sysctl; the first comment has the raw output of the two that read kern.proc.pid (first and second probe below), the second comment that of the two that read kern.proc.proc and kern.proc.pid_td (third and fourth probe):

  • kern.proc.pid, own pid. The size query with a null buffer returned 0 with a length of 1096 (first probe, line 18; second probe, line 10). A 1096-byte and a 0x448-byte buffer returned 0 with a length of 1096 and ki_structsize 1096 (second probe, lines 4, 5 and 7); ki_pid equalled getpid() and ki_ppid equalled getppid() (second probe, line 5). A 1088-byte (0x440) buffer returned -1 with errno 12 (ENOMEM), the length after the call was 1088 and 1088 bytes were changed, so the console copies what fits and then reports ENOMEM (first probe, lines 12 and 15; second probe, line 8); the same holds for 512 bytes (first probe line 16, second probe line 9) and 1 byte (first probe line 17). The pids -1 and 0x7fffffff returned -1 with errno 3 (ESRCH) (first probe, lines 21 and 22; second probe, lines 13 and 14), as the Debt entry says for AnyPS5. The console also answered for the parent pid and pid 1 (second probe, lines 11 and 12; third probe, lines 29 and 30); AnyPS5 answers only for its own pid, which the entry already states, and this change does not touch that.
  • The offsets of ki_pid (72), ki_ppid (76) and ki_comm (447) of FreeBSD 11 amd64's kinfo_proc held, so the 8 extra bytes are at the end of the record. The probes do not say what they contain, and this change fills them with 0 like the rest of the unfilled record.
  • kern.proc.proc. A PS5 payload process listed dozens of processes, each a record of 1,096 bytes: the size query returned 104120 in the third probe (line 4) and 105216 in the fourth (line 4), and the read in the fourth returned a length of 99736 with 91 records, all 91 with ki_structsize 1096 (line 5; 91 times 1096 is 99736). The number of records differs between the runs, so no count is taken from them, and no pid or name is printed in either probe. AnyPS5 lists one record.
  • kern.proc.pid_td (KERN_PROC_PID with KERN_PROC_INC_THREAD). The console returned -1 with errno 2 (ENOENT) for the size query, the read, a read with three helper threads running, and the pids of the parent, 1, 0x7fffffff and -1 (third probe, lines 18 to 24). AnyPS5 returns one record per live guest thread. That difference is not changed here; the entry now says that the console answers ENOENT.

In core/libs/prx/libkernel/System/src/SystemConfiguration.cpp (line numbers at main 194964cd3ce, the base of this branch) GuestKinfoProc (:199-218) ended in reserved6[484] with a static_assert on sizeof == 1088. GuestProcessRecord (:221-228) sets structSize = sizeof(process), and the three sysctls build their records from it: kern.proc.proc (:514, its size query (EstimatedExtraProcesses + 1) * sizeof(GuestKinfoProc) at :512), kern.proc.pid (:530) and kern.proc.pid_td, with GuestProcessRecord() per thread (:240) and a length of records.size() * sizeof(GuestKinfoProc) (:547). CopyOut (:39-54) already copies min(capacity, size) bytes and returns -1 with errno 12 when that is less than the size, which is what the console does, so it is unchanged. The fix is reserved6[484] to reserved6[492] and the static_assert to 1096 (2 lines in SystemConfiguration.cpp); the size query, ki_structsize and the process and thread lists follow from it. The six-record size query of kern.proc.proc (from #22014) becomes six times 1096.

Only kern.proc.pid was measured with a buffer of its own size. For kern.proc.proc the record size is measured, the number of records is not copied, and for kern.proc.pid_td the console does not answer, so its 1,096-byte records are not measured. A caller that asks for its own record with a 0x440-byte buffer, as Source Port (PPSA20040) does for the debugger check, now gets ENOMEM with the first 1,088 bytes copied, as on the console; no title was run for this PR.

The test, core/libs/tests/GuestSystemConfiguration.cpp, changes 21 occurrences of 1088 to 1096 (including the six-record size query of #22014) and adds one case: a 1088-byte buffer returns -1 with errno 12, a length of 1088, 1088 bytes copied, the byte after them untouched, ki_structsize 1096 and the right ki_pid. The values pinned are the console's from the probes above; the values of ki_flag and of the other unfilled bytes are not pinned.

Debt: there is no new fragment file. A second fragment on the same entry would be a fold error, which tools/check_conventions.py reports as an error, so the text is edited in the two merged fragments that are not folded yet: docs/dev/debt/changes/fix-libkernel-sysctl-proc-list-size-estimate.md (#22014, kern.proc.proc, 916 to 899 characters) and docs/dev/debt/changes/fix-libkernel-sysctl-proc-pid-thread-id.md (#21986, kern.proc.pid 869 to 997 and kern.proc.pid_td 953 to 995 characters, counted without the leading "- "). They are other authors' files, and the change to them is deliberate. kern.proc.proc now says the record is 1,096 bytes and that a PS5 payload process lists dozens of processes of that size, titles not measured; kern.proc.pid says the record is 1,096 bytes as a firmware 11.60 payload reports it and that here a 1,088-byte buffer gets ENOMEM after a 1,088-byte copy (the console's own result for that buffer is in the raw output, lines 12 and 15 of the first probe, and is not stated in the entry); kern.proc.pid_td says the console answers ENOENT. All three entries are at most 1000 characters. tools/debt_fold.py --check reports nothing for kern.proc.

Tested

Measured on a PS5 with firmware 11.60 (kernel_get_fw_version 0x11600005), from a homebrew payload process (ps5-payload-sdk v0.45, elfldr). First probe 2026-11-17 at 23:35 UTC, second 2026-11-18 at 00:05 UTC, third 2026-11-18 at 04:36 UTC, fourth 2026-11-18 at 05:05 UTC (the console clock printed 01:17:39, 01:47:32, 06:18:05 and 06:47:41 and runs 1 h 42 min ahead of UTC). A title process may differ. In the first comment, the lines that print ki_flag and byte counts of the record (line 14 of the first probe and line 6 of the second) and the value of the first characters of ki_comm are removed and replaced by a note; the other lines keep their numbers. The second comment has the two other probes as printed.

Call PS5, payload process, firmware 11.60 AnyPS5 main before here now
kern.proc.pid size query, own pid 0, length 1096 (first probe line 18) 0, length 1088 (code, :199-228) 0, length 1096 (test)
kern.proc.pid, 1096-byte and 0x448-byte buffers 0, length 1096, ki_structsize 1096 (second probe lines 4, 5, 7) 0, length 1088 0, length 1096 (test)
kern.proc.pid, 1088-byte buffer -1, errno 12, 1088 bytes changed (first probe lines 12, 15) 0, 1088 bytes, no error -1, errno 12, 1088 bytes (new test case)
kern.proc.pid, 512-byte and 1-byte buffers -1, errno 12, 512 and 1 byte changed (first probe lines 16, 17) -1, errno 12, same copy (CopyOut :39-54) unchanged
kern.proc.pid, pid -1 and 0x7fffffff -1, errno 3 (first probe lines 21, 22) -1, errno 3 unchanged
kern.proc.pid, parent pid and pid 1 0 (second probe lines 11, 12) errno 3 (entry states it) unchanged
kern.proc.proc, record size 1096 in all 91 records read (fourth probe line 5) 1088, one record 1096, one record (test)
kern.proc.pid_td, own pid -1, errno 2 (third probe lines 18 to 20) one record per live thread unchanged, entry states the console result

guest_system_configuration fails without the fix and passes with it, on the same main 194964cd3ce: with the test commit alone (78582bdd191b) it fails on Windows (MinGW-w64 g++ 15.2.0, Release, ninja -j4, exit code 0xc0000409, 0.41 s, run at about 06:25 UTC on 2026-11-18) and with the fix and the Debt commit of the earlier head (cf0beca2c0db) it passes (1 of 1, 0.46 s); the branch head e6fa223cbe0 differs from it only in one sentence of a Debt fragment, its code and test trees are the same. On Linux (WSL Ubuntu 24.04, g++ 13.3.0, Release, ninja -j4, run at about 06:30 UTC), with SystemConfiguration.cpp at reserved6[484] and the assert at 1088 (sha256 starting 70f637117fb3) the test reports Subprocess aborted (0% passed, 0.04 s) and with reserved6[492] and 1096 (sha256 starting 5ebb4b6a104f) it passes (0.03 s, 100%). tools/check_conventions.py --base upstream/main reports no error and no warning on the branch. Not tested: macOS, the CI runner, a title process (PPSA20040 or another), the number of processes the console lists, the 1,096-byte records of kern.proc.pid_td, and the contents of the 8 extra bytes.

Overlap: the other open pull requests that change the files of this branch (core/libs/prx/libkernel/System/src/SystemConfiguration.cpp, core/libs/tests/GuestSystemConfiguration.cpp and the two fragments docs/dev/debt/changes/fix-libkernel-sysctl-proc-list-size-estimate.md and docs/dev/debt/changes/fix-libkernel-sysctl-proc-pid-thread-id.md, which are on main and not folded yet) or the debt entries kern.proc.proc, kern.proc.pid and kern.proc.pid_td, found by reading the changed files of all 1761 open pull requests at about 08:32 to 08:54 UTC, by reading what they change in docs/dev/debt/libkernel.md and the fragments under docs/dev/debt/changes/ for kinfo_proc and kern.proc, and by searching their titles and branch names for the same names (one hit, #22483), were checked on 2026-11-18 at about 08:35 UTC against main 1ccc399b171 together with this head (the branch is based on 194964cd3ce, an ancestor of it, merges into main without a conflict, and tools/debt_fold.py --check applies the two changed fragments together with every other fragment on main without an error), and the two that list one of the code files or name the same sysctls were merged with and without this branch at about 08:56 UTC against main b1a1e61f914. No open pull request changes the two fragments or a line of the three entries. #22483 (audit sysctl kern.proc.* process, pathname, env, and vmmap bounds) adds only a test and a CMakeLists.txt line and merges cleanly with and without this branch; its test declares its own TestKinfoProc with a size of 1088 bytes and compares lengths with it, so after this change lands its test fails against the 1,096-byte record (or the other way round, this change makes it fail), and whichever lands second has to change that size; this is not a Depends on. #12315 (feat(libSceLibreSsl3): ..., a branch with many unrelated files) conflicts with main by itself in libSceLibreSsl3, carries older kern.proc.proc code and a test that expects a length of 1088, and does not conflict only with this branch. Fifty-nine pull requests list one of the files or docs/dev/debt/libkernel.md, most of them for other entries; none of the others touches these sysctls. The merge with main was not built or run; the runs below are on the base 194964cd3ce.

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 (no graphics change)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5373229945 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22788). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-11-18T09:21:44Z. --- ### What Makes `kern.proc.pid`, `kern.proc.pid_td` and `kern.proc.proc` report the process record, `kinfo_proc`, with the 1,096 bytes that a PS5 on firmware 11.60 reported to a payload process, where AnyPS5 reported FreeBSD 11 amd64's 1,088 bytes. Four probes on that PS5 only read `sysctl`; the first comment has the raw output of the two that read `kern.proc.pid` (first and second probe below), the second comment that of the two that read `kern.proc.proc` and `kern.proc.pid_td` (third and fourth probe): - `kern.proc.pid`, own pid. The size query with a null buffer returned 0 with a length of 1096 (first probe, line 18; second probe, line 10). A 1096-byte and a 0x448-byte buffer returned 0 with a length of 1096 and `ki_structsize` 1096 (second probe, lines 4, 5 and 7); `ki_pid` equalled `getpid()` and `ki_ppid` equalled `getppid()` (second probe, line 5). A 1088-byte (0x440) buffer returned -1 with errno 12 (`ENOMEM`), the length after the call was 1088 and 1088 bytes were changed, so the console copies what fits and then reports `ENOMEM` (first probe, lines 12 and 15; second probe, line 8); the same holds for 512 bytes (first probe line 16, second probe line 9) and 1 byte (first probe line 17). The pids -1 and 0x7fffffff returned -1 with errno 3 (`ESRCH`) (first probe, lines 21 and 22; second probe, lines 13 and 14), as the Debt entry says for AnyPS5. The console also answered for the parent pid and pid 1 (second probe, lines 11 and 12; third probe, lines 29 and 30); AnyPS5 answers only for its own pid, which the entry already states, and this change does not touch that. - The offsets of `ki_pid` (72), `ki_ppid` (76) and `ki_comm` (447) of FreeBSD 11 amd64's `kinfo_proc` held, so the 8 extra bytes are at the end of the record. The probes do not say what they contain, and this change fills them with 0 like the rest of the unfilled record. - `kern.proc.proc`. A PS5 payload process listed dozens of processes, each a record of 1,096 bytes: the size query returned 104120 in the third probe (line 4) and 105216 in the fourth (line 4), and the read in the fourth returned a length of 99736 with 91 records, all 91 with `ki_structsize` 1096 (line 5; 91 times 1096 is 99736). The number of records differs between the runs, so no count is taken from them, and no pid or name is printed in either probe. AnyPS5 lists one record. - `kern.proc.pid_td` (`KERN_PROC_PID` with `KERN_PROC_INC_THREAD`). The console returned -1 with errno 2 (`ENOENT`) for the size query, the read, a read with three helper threads running, and the pids of the parent, 1, 0x7fffffff and -1 (third probe, lines 18 to 24). AnyPS5 returns one record per live guest thread. That difference is not changed here; the entry now says that the console answers `ENOENT`. In `core/libs/prx/libkernel/System/src/SystemConfiguration.cpp` (line numbers at `main` `194964cd3ce`, the base of this branch) `GuestKinfoProc` (`:199-218`) ended in `reserved6[484]` with a `static_assert` on `sizeof == 1088`. `GuestProcessRecord` (`:221-228`) sets `structSize = sizeof(process)`, and the three sysctls build their records from it: `kern.proc.proc` (`:514`, its size query `(EstimatedExtraProcesses + 1) * sizeof(GuestKinfoProc)` at `:512`), `kern.proc.pid` (`:530`) and `kern.proc.pid_td`, with `GuestProcessRecord()` per thread (`:240`) and a length of `records.size() * sizeof(GuestKinfoProc)` (`:547`). `CopyOut` (`:39-54`) already copies `min(capacity, size)` bytes and returns -1 with errno 12 when that is less than the size, which is what the console does, so it is unchanged. The fix is `reserved6[484]` to `reserved6[492]` and the `static_assert` to 1096 (2 lines in `SystemConfiguration.cpp`); the size query, `ki_structsize` and the process and thread lists follow from it. The six-record size query of `kern.proc.proc` (from #22014) becomes six times 1096. Only `kern.proc.pid` was measured with a buffer of its own size. For `kern.proc.proc` the record size is measured, the number of records is not copied, and for `kern.proc.pid_td` the console does not answer, so its 1,096-byte records are not measured. A caller that asks for its own record with a 0x440-byte buffer, as Source Port (PPSA20040) does for the debugger check, now gets `ENOMEM` with the first 1,088 bytes copied, as on the console; no title was run for this PR. The test, `core/libs/tests/GuestSystemConfiguration.cpp`, changes 21 occurrences of 1088 to 1096 (including the six-record size query of #22014) and adds one case: a 1088-byte buffer returns -1 with errno 12, a length of 1088, 1088 bytes copied, the byte after them untouched, `ki_structsize` 1096 and the right `ki_pid`. The values pinned are the console's from the probes above; the values of `ki_flag` and of the other unfilled bytes are not pinned. Debt: there is no new fragment file. A second fragment on the same entry would be a fold error, which `tools/check_conventions.py` reports as an error, so the text is edited in the two merged fragments that are not folded yet: `docs/dev/debt/changes/fix-libkernel-sysctl-proc-list-size-estimate.md` (#22014, `kern.proc.proc`, 916 to 899 characters) and `docs/dev/debt/changes/fix-libkernel-sysctl-proc-pid-thread-id.md` (#21986, `kern.proc.pid` 869 to 997 and `kern.proc.pid_td` 953 to 995 characters, counted without the leading "- "). They are other authors' files, and the change to them is deliberate. `kern.proc.proc` now says the record is 1,096 bytes and that a PS5 payload process lists dozens of processes of that size, titles not measured; `kern.proc.pid` says the record is 1,096 bytes as a firmware 11.60 payload reports it and that here a 1,088-byte buffer gets `ENOMEM` after a 1,088-byte copy (the console's own result for that buffer is in the raw output, lines 12 and 15 of the first probe, and is not stated in the entry); `kern.proc.pid_td` says the console answers `ENOENT`. All three entries are at most 1000 characters. `tools/debt_fold.py --check` reports nothing for `kern.proc`. ### Tested Measured on a PS5 with firmware 11.60 (`kernel_get_fw_version` 0x11600005), from a homebrew payload process (ps5-payload-sdk v0.45, elfldr). First probe 2026-11-17 at 23:35 UTC, second 2026-11-18 at 00:05 UTC, third 2026-11-18 at 04:36 UTC, fourth 2026-11-18 at 05:05 UTC (the console clock printed 01:17:39, 01:47:32, 06:18:05 and 06:47:41 and runs 1 h 42 min ahead of UTC). A title process may differ. In the first comment, the lines that print `ki_flag` and byte counts of the record (line 14 of the first probe and line 6 of the second) and the value of the first characters of `ki_comm` are removed and replaced by a note; the other lines keep their numbers. The second comment has the two other probes as printed. | Call | PS5, payload process, firmware 11.60 | AnyPS5 `main` before | here now | |---|---|---|---| | `kern.proc.pid` size query, own pid | 0, length 1096 (first probe line 18) | 0, length 1088 (code, `:199-228`) | 0, length 1096 (test) | | `kern.proc.pid`, 1096-byte and 0x448-byte buffers | 0, length 1096, `ki_structsize` 1096 (second probe lines 4, 5, 7) | 0, length 1088 | 0, length 1096 (test) | | `kern.proc.pid`, 1088-byte buffer | -1, errno 12, 1088 bytes changed (first probe lines 12, 15) | 0, 1088 bytes, no error | -1, errno 12, 1088 bytes (new test case) | | `kern.proc.pid`, 512-byte and 1-byte buffers | -1, errno 12, 512 and 1 byte changed (first probe lines 16, 17) | -1, errno 12, same copy (`CopyOut` `:39-54`) | unchanged | | `kern.proc.pid`, pid -1 and 0x7fffffff | -1, errno 3 (first probe lines 21, 22) | -1, errno 3 | unchanged | | `kern.proc.pid`, parent pid and pid 1 | 0 (second probe lines 11, 12) | errno 3 (entry states it) | unchanged | | `kern.proc.proc`, record size | 1096 in all 91 records read (fourth probe line 5) | 1088, one record | 1096, one record (test) | | `kern.proc.pid_td`, own pid | -1, errno 2 (third probe lines 18 to 20) | one record per live thread | unchanged, entry states the console result | `guest_system_configuration` fails without the fix and passes with it, on the same `main` `194964cd3ce`: with the test commit alone (`78582bdd191b`) it fails on Windows (MinGW-w64 g++ 15.2.0, Release, ninja -j4, exit code 0xc0000409, 0.41 s, run at about 06:25 UTC on 2026-11-18) and with the fix and the Debt commit of the earlier head (`cf0beca2c0db`) it passes (1 of 1, 0.46 s); the branch head `e6fa223cbe0` differs from it only in one sentence of a Debt fragment, its code and test trees are the same. On Linux (WSL Ubuntu 24.04, g++ 13.3.0, Release, ninja -j4, run at about 06:30 UTC), with `SystemConfiguration.cpp` at `reserved6[484]` and the assert at 1088 (sha256 starting `70f637117fb3`) the test reports `Subprocess aborted` (0% passed, 0.04 s) and with `reserved6[492]` and 1096 (sha256 starting `5ebb4b6a104f`) it passes (0.03 s, 100%). `tools/check_conventions.py --base upstream/main` reports no error and no warning on the branch. Not tested: macOS, the CI runner, a title process (PPSA20040 or another), the number of processes the console lists, the 1,096-byte records of `kern.proc.pid_td`, and the contents of the 8 extra bytes. Overlap: the other open pull requests that change the files of this branch (`core/libs/prx/libkernel/System/src/SystemConfiguration.cpp`, `core/libs/tests/GuestSystemConfiguration.cpp` and the two fragments `docs/dev/debt/changes/fix-libkernel-sysctl-proc-list-size-estimate.md` and `docs/dev/debt/changes/fix-libkernel-sysctl-proc-pid-thread-id.md`, which are on `main` and not folded yet) or the debt entries `kern.proc.proc`, `kern.proc.pid` and `kern.proc.pid_td`, found by reading the changed files of all 1761 open pull requests at about 08:32 to 08:54 UTC, by reading what they change in `docs/dev/debt/libkernel.md` and the fragments under `docs/dev/debt/changes/` for `kinfo_proc` and `kern.proc`, and by searching their titles and branch names for the same names (one hit, #22483), were checked on 2026-11-18 at about 08:35 UTC against `main` `1ccc399b171` together with this head (the branch is based on `194964cd3ce`, an ancestor of it, merges into `main` without a conflict, and `tools/debt_fold.py --check` applies the two changed fragments together with every other fragment on `main` without an error), and the two that list one of the code files or name the same sysctls were merged with and without this branch at about 08:56 UTC against `main` `b1a1e61f914`. No open pull request changes the two fragments or a line of the three entries. #22483 (`audit sysctl kern.proc.* process, pathname, env, and vmmap bounds`) adds only a test and a `CMakeLists.txt` line and merges cleanly with and without this branch; its test declares its own `TestKinfoProc` with a size of 1088 bytes and compares lengths with it, so after this change lands its test fails against the 1,096-byte record (or the other way round, this change makes it fail), and whichever lands second has to change that size; this is not a `Depends on`. #12315 (`feat(libSceLibreSsl3): ...`, a branch with many unrelated files) conflicts with `main` by itself in `libSceLibreSsl3`, carries older `kern.proc.proc` code and a test that expects a length of 1088, and does not conflict only with this branch. Fifty-nine pull requests list one of the files or `docs/dev/debt/libkernel.md`, most of them for other entries; none of the others touches these sysctls. The merge with `main` was not built or run; the runs below are on the base `194964cd3ce`. ### 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 <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a (no graphics change) <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
PrivacyOnion commented 2026-11-18 09:23:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-18T09:23:34Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against e6fa223cbe:

  • Conventions: tools/check_conventions.py passed.
  • Build: guest_system_configuration_tests built cleanly.
  • CTest (guest_system_configuration):
    1/1 Test #5556: guest_system_configuration .......   Passed    0.03 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: with core/libs/prx/libkernel/System/src/SystemConfiguration.cpp reverted to main and the new tests kept, the suite fails:
    1/1 Test #5556: guest_system_configuration .......Subprocess aborted***Exception:   0.14 sec
    0% tests passed, 1 tests failed out of 1
    
    Restoring the change makes it pass again.
  • Code reading:
    • Verified that GuestKinfoProc structSize was updated from 1088 to 1096 bytes via expanding reserved6 from 484 to 492 bytes, matching console probe measurements on firmware 11.60.
    • Verified static_assert offsets and sizes in core/libs/prx/libkernel/System/src/SystemConfiguration.cpp: pid (72), parentPid (76), flag (368), command (447), threadName (394), moreThreadName (502), threadCount (596), threadId (600), and total sizeof(GuestKinfoProc) == 1096.
    • Verified GuestProcessRecord zero-initialization via {} ensures the newly added trailing reserved bytes are properly zeroed.
    • Verified sysctl implementation handling for partial reads: CopyOut copies min(capacity, size) and correctly sets errno to ENOMEM (12) when capacity < size.
    • Verified GuestSystemConfiguration.cpp unit test updates correctly test size query (1096), exact buffer, undersized buffer (1088 bytes returning -1 and ENOMEM), multi-thread records stride (1096), and kern.proc.proc size estimate (6 * 1096).
    • Verified technical debt fragment updates in docs/dev/debt/changes/ accurately document the 1096-byte behavior observed on firmware 11.60.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5953772137 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22788#pullrequestreview-5953772137). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-18T09:23:34Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `e6fa223cbe`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `guest_system_configuration_tests` built cleanly. - **CTest** (`guest_system_configuration`): ``` 1/1 Test #5556: guest_system_configuration ....... Passed 0.03 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: with `core/libs/prx/libkernel/System/src/SystemConfiguration.cpp` reverted to `main` and the new tests kept, the suite fails: ``` 1/1 Test #5556: guest_system_configuration .......Subprocess aborted***Exception: 0.14 sec 0% tests passed, 1 tests failed out of 1 ``` Restoring the change makes it pass again. - **Code reading**: - Verified that GuestKinfoProc structSize was updated from 1088 to 1096 bytes via expanding reserved6 from 484 to 492 bytes, matching console probe measurements on firmware 11.60. - Verified static_assert offsets and sizes in core/libs/prx/libkernel/System/src/SystemConfiguration.cpp: pid (72), parentPid (76), flag (368), command (447), threadName (394), moreThreadName (502), threadCount (596), threadId (600), and total sizeof(GuestKinfoProc) == 1096. - Verified GuestProcessRecord zero-initialization via {} ensures the newly added trailing reserved bytes are properly zeroed. - Verified sysctl implementation handling for partial reads: CopyOut copies min(capacity, size) and correctly sets errno to ENOMEM (12) when capacity < size. - Verified GuestSystemConfiguration.cpp unit test updates correctly test size query (1096), exact buffer, undersized buffer (1088 bytes returning -1 and ENOMEM), multi-thread records stride (1096), and kern.proc.proc size estimate (6 * 1096). - Verified technical debt fragment updates in docs/dev/debt/changes/ accurately document the 1096-byte behavior observed on firmware 11.60. Looks Good To Me
MarcZX10 commented 2026-11-23 03:41:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T03:41:56Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the inspected implementation and test updates support the reported 1,096-byte process record behavior.

What I ran

  • Reviewed head e6fa223cbe0858368e9b515c76bc88a401667109 using repo_read.py to inspect the prepared review artifacts and targeted source ranges.
  • No build or test command was run during this review; reported test results are from the PR description.

Results

Check Result Note
Changed code review passed Record size and sysctl use inspected
Test review passed Size and short-buffer assertions inspected
Build and tests not run Description reports Windows and Linux test results

Findings

Blocking

None.

Non-blocking

None.

Not verified

No build or test was run independently. The PR description states that the test passed on Windows and Linux and that the convention check passed. The changed code, test, and debt fragments were read; no changed files were excluded. Console behavior and the PR's reported measurements were not independently verified.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6016309687 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22788#pullrequestreview-6016309687). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-23T03:41:56Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the inspected implementation and test updates support the reported 1,096-byte process record behavior. ## What I ran - Reviewed head `e6fa223cbe0858368e9b515c76bc88a401667109` using `repo_read.py` to inspect the prepared review artifacts and targeted source ranges. - No build or test command was run during this review; reported test results are from the PR description. ## Results | Check | Result | Note | |---|---|---| | Changed code review | passed | Record size and sysctl use inspected | | Test review | passed | Size and short-buffer assertions inspected | | Build and tests | not run | Description reports Windows and Linux test results | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified No build or test was run independently. The PR description states that the test passed on Windows and Linux and that the convention check passed. The changed code, test, and debt fragments were read; no changed files were excluded. Console behavior and the PR's reported measurements were not independently verified. ## To get this to a good state Nothing is required.
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!22788
No description provided.