fix(libc): give strerror_r, perror and strerror_s the strerror texts as measured on a PS5 #11127

Merged
orezraey merged 3 commits from upstream-pr/11127 into main 2026-10-26 16:42:19 +00:00
orezraey commented 2026-10-25 18:57:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by orezraey on 2026-10-25T18:57:13Z.


What

strerror_r and perror now give the texts strerror gives, as the system libSceLibcInternal of a retail PS5 (firmware 13.60) does. Measured with a homebrew probe from a payload process; the source and console log are in this gist (pstrerr).

On the console:

  • strerror: 0 gives "No error", 1 to 94 the FreeBSD texts, and 95, 96, 97, 100, 1000, -1, INT_MAX and INT_MIN give "error_code=0x%08x". This is what AnyPS5 already returns.
  • strerror_r uses the same texts: 0 gives "No error", 95 gives "error_code=0x0000005f", and 1000 and -1 give "error_code=..." with a return of 0, not 22.
  • A buffer of 0, 1, 5 or 16 bytes returns 34 (ERANGE) and leaves every byte alone, for every number tried, including 0 whose "No error" would fit in 16 bytes; 256 bytes returns 0 with the text. AnyPS5 wrote a truncated text.
  • The rule between those sizes comes from the strerror_r of the libc.prx that PPSA31872 ships, read statically (cmp $0x17,%rdx; jb returning 0x22, then strncpy(buffer, text, length - 1) and buffer[length - 1] = 0): under 23 bytes it returns 34 without writing, otherwise it copies at most length - 1 bytes, zero-fills the rest and returns 0, so a text longer than 22 characters is cut. That agrees with every firmware 13.60 row above; 17 to 255 bytes were not run on the console.
  • perror prints "x: No error\n", "No error\n" for a null or empty prefix, and "x: error_code=0x00000060\n". errno is never changed.

Before this change strerror_r used the 97-entry table, giving "No error: 0", "State not recoverable" and "Previous owner died" for 0, 95 and 96, and "Unknown error: %d" with 22 for other numbers. perror and syslog's %m read strerror_r, so they follow it. strerror_s and strerrorlen_s now use the same texts too. A later probe (gist, pstrerrs3) measured them on the console: strerrorlen_s returns the length of the strerror text (8 for 0, 16 for 22, 21 for 95, 96, 97, 1000, -1 and INT_MAX). strerror_s writes that text, and with a buffer of 1 to 16 bytes it truncates, writing "..." over the last three characters when the buffer holds more than 3 bytes ("N..." for 0 in 5 bytes, "Invalid argu..." for 22 in 16), and returns 0, where AnyPS5 returned 34. errno is never changed. So strerror_s reads strerror_r and returns 0 on truncation, and the libc-internal FreeBsdErrorMessage_nid_no_patch and its header are gone. Its constraint cases (null destination, capacity 0 or above RSIZE_MAX) are unchanged: the earlier probes hung after installing a handler, and the debt entry leads with that gap.

The strerror debt entry said the console's system libc answers differently ("No error information" for 0 and unknown numbers, 95 and 96 named). On firmware 13.60 it gives the same texts as the libc.prx titles ship, so the entry now covers all three functions. A null strerror_r buffer returns 34 under 23 bytes, as the length check comes first; at 23 bytes or more the console writes through it, so AnyPS5 throws.

Before and after

Case PS5 AnyPS5 before AnyPS5 now
strerror_r of 0 "No error" "No error: 0" "No error"
strerror_r of 95 "error_code=0x0000005f" "State not recoverable" "error_code=0x0000005f"
strerror_r of 1000 or -1 "error_code=...", returns 0 "Unknown error: ...", returns 22 "error_code=...", returns 0
strerror_r with a 16-byte buffer 34, buffer untouched truncated text 34, buffer untouched
perror("x") with errno 0 "x: No error" "x: No error: 0" "x: No error"
strerror_s of 22 in 16 bytes "Invalid argu...", returns 0 returns 34 "Invalid argu...", returns 0
strerrorlen_s of 95 21 length of "State not recoverable" 21

Tested

Head ff667ba3b7 on main cceb6c3c41. Windows 11, WinLibs GCC 15.2: guest_errors, guest_safe_errors, guest_syslog and guest_host_standard_error_windows pass 3 times out of 3. Linux (WSL Ubuntu, GCC), on the head before the strerror_s change: guest_errors, guest_safe_errors and guest_syslog passed 3 times out of 3 (guest_host_standard_error_windows is Windows only). guest_errors checks the measured texts for 0 to 96 and the unknown numbers; for 0, 19, 22, 95 and -1 it checks that 0, 1, 5, 16 and 22 bytes return 34 with an 0xcc canary untouched, that 23 bytes return 0 with the text cut to 22 characters and zero-filled ("Operation not supporte" for 19) and the next byte untouched, and that a null buffer returns 34 under 23 bytes and throws at 23. With the previous head's Errors.cpp, guest_errors fails. guest_safe_errors checks strerror_s and strerrorlen_s against the measured texts for 0 to 96 and the unknown numbers at every capacity from 1 to the length plus 2, with the ellipsis, a return of 0 and the canaries. tools/check_conventions.py passes. #10782 also edits perror in Errors.cpp; the two merge cleanly in either order.

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:5007692031 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11127). Originally posted by [orezraey](https://github.com/orezraey) on 2026-10-25T18:57:13Z. --- ### What `strerror_r` and `perror` now give the texts `strerror` gives, as the system `libSceLibcInternal` of a retail PS5 (firmware 13.60) does. Measured with a homebrew probe from a payload process; the source and console log are in [this gist](https://gist.github.com/orezraey/7e18fdb26f6ad19cabec6eaf5b0e6b2f) (`pstrerr`). On the console: - `strerror`: 0 gives "No error", 1 to 94 the FreeBSD texts, and 95, 96, 97, 100, 1000, -1, `INT_MAX` and `INT_MIN` give "error_code=0x%08x". This is what AnyPS5 already returns. - `strerror_r` uses the same texts: 0 gives "No error", 95 gives "error_code=0x0000005f", and 1000 and -1 give "error_code=..." with a return of 0, not 22. - A buffer of 0, 1, 5 or 16 bytes returns 34 (`ERANGE`) and leaves every byte alone, for every number tried, including 0 whose "No error" would fit in 16 bytes; 256 bytes returns 0 with the text. AnyPS5 wrote a truncated text. - The rule between those sizes comes from the `strerror_r` of the `libc.prx` that PPSA31872 ships, read statically (`cmp $0x17,%rdx; jb` returning 0x22, then `strncpy(buffer, text, length - 1)` and `buffer[length - 1] = 0`): under 23 bytes it returns 34 without writing, otherwise it copies at most length - 1 bytes, zero-fills the rest and returns 0, so a text longer than 22 characters is cut. That agrees with every firmware 13.60 row above; 17 to 255 bytes were not run on the console. - `perror` prints "x: No error\n", "No error\n" for a null or empty prefix, and "x: error_code=0x00000060\n". `errno` is never changed. Before this change `strerror_r` used the 97-entry table, giving "No error: 0", "State not recoverable" and "Previous owner died" for 0, 95 and 96, and "Unknown error: %d" with 22 for other numbers. `perror` and syslog's `%m` read `strerror_r`, so they follow it. `strerror_s` and `strerrorlen_s` now use the same texts too. A later probe ([gist](https://gist.github.com/orezraey/e5f3bfc493fa25c479735529c0b10995), `pstrerrs3`) measured them on the console: `strerrorlen_s` returns the length of the `strerror` text (8 for 0, 16 for 22, 21 for 95, 96, 97, 1000, -1 and `INT_MAX`). `strerror_s` writes that text, and with a buffer of 1 to 16 bytes it truncates, writing "..." over the last three characters when the buffer holds more than 3 bytes ("N..." for 0 in 5 bytes, "Invalid argu..." for 22 in 16), and returns **0**, where AnyPS5 returned 34. `errno` is never changed. So `strerror_s` reads `strerror_r` and returns 0 on truncation, and the libc-internal `FreeBsdErrorMessage_nid_no_patch` and its header are gone. Its constraint cases (null destination, capacity 0 or above `RSIZE_MAX`) are unchanged: the earlier probes hung after installing a handler, and the debt entry leads with that gap. The `strerror` debt entry said the console's system libc answers differently ("No error information" for 0 and unknown numbers, 95 and 96 named). On firmware 13.60 it gives the same texts as the `libc.prx` titles ship, so the entry now covers all three functions. A null `strerror_r` buffer returns 34 under 23 bytes, as the length check comes first; at 23 bytes or more the console writes through it, so AnyPS5 throws. **Before and after** | Case | PS5 | AnyPS5 before | AnyPS5 now | |---|---|---|---| | `strerror_r` of 0 | "No error" | "No error: 0" | "No error" | | `strerror_r` of 95 | "error_code=0x0000005f" | "State not recoverable" | "error_code=0x0000005f" | | `strerror_r` of 1000 or -1 | "error_code=...", returns 0 | "Unknown error: ...", returns 22 | "error_code=...", returns 0 | | `strerror_r` with a 16-byte buffer | 34, buffer untouched | truncated text | 34, buffer untouched | | `perror("x")` with `errno` 0 | "x: No error" | "x: No error: 0" | "x: No error" | | `strerror_s` of 22 in 16 bytes | "Invalid argu...", returns 0 | returns 34 | "Invalid argu...", returns 0 | | `strerrorlen_s` of 95 | 21 | length of "State not recoverable" | 21 | ### 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. --> Head `ff667ba3b7` on `main` `cceb6c3c41`. Windows 11, WinLibs GCC 15.2: `guest_errors`, `guest_safe_errors`, `guest_syslog` and `guest_host_standard_error_windows` pass 3 times out of 3. Linux (WSL Ubuntu, GCC), on the head before the `strerror_s` change: `guest_errors`, `guest_safe_errors` and `guest_syslog` passed 3 times out of 3 (`guest_host_standard_error_windows` is Windows only). `guest_errors` checks the measured texts for 0 to 96 and the unknown numbers; for 0, 19, 22, 95 and -1 it checks that 0, 1, 5, 16 and 22 bytes return 34 with an 0xcc canary untouched, that 23 bytes return 0 with the text cut to 22 characters and zero-filled ("Operation not supporte" for 19) and the next byte untouched, and that a null buffer returns 34 under 23 bytes and throws at 23. With the previous head's `Errors.cpp`, `guest_errors` fails. `guest_safe_errors` checks `strerror_s` and `strerrorlen_s` against the measured texts for 0 to 96 and the unknown numbers at every capacity from 1 to the length plus 2, with the ellipsis, a return of 0 and the canaries. `tools/check_conventions.py` passes. #10782 also edits `perror` in `Errors.cpp`; the two merge cleanly in either order. ### 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
thepoppfish commented 2026-10-25 19:39:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by thepoppfish on 2026-10-25T19:39:11Z.

Review: CHANGES_REQUESTED


Reviewed exact head e5ad4813f3d278f629c5806f2b85e69415dfca29. The text changes and the separation of the safe-string APIs check out in my native comparison, but one measured buffer case still disagrees with the implementation and the PR's stated success rule.

In the published pstrerr.console.log at revision ac32b35b38ef0b871b47e975877738add7b4c0b0, firmware metadata is 0x13600007, the internal symbol resolves successfully, and the error-zero/16-byte case is:

pstrerr: case strerror_r lib=internal e=0 n=16 ret=34 errno=1234 text="\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc" len=16 terminated=0 canary_intact=1 byte0=cc

The SDK row records the same result. At capacity 256 the log records successful output of an eight-character message instead. Therefore the console's acceptance rule in this evidence is not simply whether the text and its terminator fit: capacity 16 already fits that message, yet the recorded call rejects it and leaves the observed bytes untouched.

This head computes required = strlen(text) + 1, returns 0 for that call, and overwrites the canary with the message and its terminator. The current GuestErrors cases miss capacity 16 for error zero: they test 0, 1, 5, one byte short of the inferred length, and the inferred exact length. The exact-length success expectation is not established by the supplied console measurements.

Please include the recorded (error=0, capacity=16) case in the regression, measure the acceptance boundary around it (and representative other errors), and reconcile the implementation, tests and debt/description with that result. I have not guessed a fixed minimum or proposed a special case: the existing log only samples 0, 1, 5, 16 and 256, so it cannot identify the general boundary.

Minimal replay, linked against this head's libc or the complete production Errors.cpp in an isolated fixture:

#include "prx/libc/include/Api.hpp"
#include <array>
#include <cstdio>
#include <cstring>

int main() {
    std::array<unsigned char, 32> buffer;
    buffer.fill(0xcc);
    *__error_nid_postfix() = 1234;
    const int result = strerror_r_nid_postfix(0, reinterpret_cast<char*>(buffer.data()), 16);
    bool unchanged = true;
    for (const auto byte : buffer) unchanged = unchanged && byte == 0xcc;
    const int saved = *__error_nid_postfix();
    std::printf("return=%d unchanged=%s errno=%d\n", result, unchanged ? "true" : "false", saved);
    return result == 34 && unchanged && saved == 1234 ? 0 : 1;
}

Actual native output is return=0 unchanged=false errno=1234, exit 1. The check expects the recorded return 34 and unchanged buffer, so it fails on this exact head.

Additional independent Windows 11 build 26200 / GCC 16.2.0 UCRT / C++20 checks:

  • Compiled complete, unchanged Errors.cpp and WideConversion.cpp for this head and parent 8a29e0883470b827f7eb7081196d0518c2aef0ec. The explicit errno adapter is return &errno, identical to Process.cpp; the fixture uses the actual FileStream class for its native stderr object, and its standard-stream preparation adapter requires already-open valid CRT descriptors. An unrelated wcrtomb boundary throws if called. No target error-message or constraint-handler algorithm was mocked.
  • Parsed expected values directly from the pinned log: all 105 strerror records match both variants. Of 35 internal strerror_r records, head differs only in error-zero/capacity-16; the parent differs in 30. The 35 SDK records equal the internal records. Comparisons include the recorded return/errno, exposed text bytes, terminator flag, first byte and eight bytes of recorded tail canary. Bytes the probe did not record are not treated as console observations.
  • Safe-API retention: 9,492 strerror_s calls and 113 strerrorlen_s calls per variant across 113 errors, capacities 0 through 80, null destinations, and constraint callbacks. The complete 1,070,336-byte snapshots (returns, lengths, errno, callback counts and all native buffer/canary bytes) are byte-identical before/after. This is a native preservation comparison, not new console evidence for those APIs.
  • The complete committed GuestErrors fixture passes at head, and the complete committed GuestSafeErrors fixture passes against both head and parent: 3/3 external native CTests pass, zero skips, 0.18 s total. Thus the existing suite passing does not cover the console discrepancy above.
  • Conventions against current main ae7d59258ea77b090c6be392e2eb2872a9744d00, whitespace and clean-checkout checks pass.

I did not run a new PS5 probe, full product/shared-library/NID integration, guest standard-stream/syslog tests, Linux/macOS tests or hosted CI. The referenced console measurements are the author's published evidence. AI-assisted review and native replay (OpenAI Codex).

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5644910083 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11127#pullrequestreview-5644910083). Originally posted by [thepoppfish](https://github.com/thepoppfish) on 2026-10-25T19:39:11Z. **Review:** CHANGES_REQUESTED --- Reviewed exact head `e5ad4813f3d278f629c5806f2b85e69415dfca29`. The text changes and the separation of the safe-string APIs check out in my native comparison, but one measured buffer case still disagrees with the implementation and the PR's stated success rule. In the [published `pstrerr.console.log` at revision `ac32b35b38ef0b871b47e975877738add7b4c0b0`](https://gist.github.com/orezraey/7e18fdb26f6ad19cabec6eaf5b0e6b2f/ac32b35b38ef0b871b47e975877738add7b4c0b0#file-pstrerr-console-log), firmware metadata is `0x13600007`, the internal symbol resolves successfully, and the error-zero/16-byte case is: ```text pstrerr: case strerror_r lib=internal e=0 n=16 ret=34 errno=1234 text="\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xcc" len=16 terminated=0 canary_intact=1 byte0=cc ``` The SDK row records the same result. At capacity 256 the log records successful output of an eight-character message instead. Therefore the console's acceptance rule in this evidence is **not simply whether the text and its terminator fit**: capacity 16 already fits that message, yet the recorded call rejects it and leaves the observed bytes untouched. This head computes `required = strlen(text) + 1`, returns 0 for that call, and overwrites the canary with the message and its terminator. The current `GuestErrors` cases miss capacity 16 for error zero: they test 0, 1, 5, one byte short of the inferred length, and the inferred exact length. The exact-length success expectation is not established by the supplied console measurements. Please include the recorded `(error=0, capacity=16)` case in the regression, measure the acceptance boundary around it (and representative other errors), and reconcile the implementation, tests and debt/description with that result. I have not guessed a fixed minimum or proposed a special case: the existing log only samples 0, 1, 5, 16 and 256, so it cannot identify the general boundary. Minimal replay, linked against this head's libc or the complete production `Errors.cpp` in an isolated fixture: ```cpp #include "prx/libc/include/Api.hpp" #include <array> #include <cstdio> #include <cstring> int main() { std::array<unsigned char, 32> buffer; buffer.fill(0xcc); *__error_nid_postfix() = 1234; const int result = strerror_r_nid_postfix(0, reinterpret_cast<char*>(buffer.data()), 16); bool unchanged = true; for (const auto byte : buffer) unchanged = unchanged && byte == 0xcc; const int saved = *__error_nid_postfix(); std::printf("return=%d unchanged=%s errno=%d\n", result, unchanged ? "true" : "false", saved); return result == 34 && unchanged && saved == 1234 ? 0 : 1; } ``` Actual native output is `return=0 unchanged=false errno=1234`, exit 1. The check expects the recorded return 34 and unchanged buffer, so it fails on this exact head. Additional independent Windows 11 build 26200 / GCC 16.2.0 UCRT / C++20 checks: - Compiled complete, unchanged `Errors.cpp` and `WideConversion.cpp` for this head and parent `8a29e0883470b827f7eb7081196d0518c2aef0ec`. The explicit errno adapter is `return &errno`, identical to `Process.cpp`; the fixture uses the actual `FileStream` class for its native stderr object, and its standard-stream preparation adapter requires already-open valid CRT descriptors. An unrelated `wcrtomb` boundary throws if called. No target error-message or constraint-handler algorithm was mocked. - Parsed expected values directly from the pinned log: all **105 `strerror` records** match both variants. Of **35 internal `strerror_r` records**, head differs only in error-zero/capacity-16; the parent differs in 30. The 35 SDK records equal the internal records. Comparisons include the recorded return/errno, exposed text bytes, terminator flag, first byte and eight bytes of recorded tail canary. Bytes the probe did not record are not treated as console observations. - Safe-API retention: **9,492 `strerror_s` calls and 113 `strerrorlen_s` calls per variant** across 113 errors, capacities 0 through 80, null destinations, and constraint callbacks. The complete 1,070,336-byte snapshots (returns, lengths, errno, callback counts and all native buffer/canary bytes) are byte-identical before/after. This is a native preservation comparison, not new console evidence for those APIs. - The complete committed `GuestErrors` fixture passes at head, and the complete committed `GuestSafeErrors` fixture passes against both head and parent: **3/3 external native CTests pass**, zero skips, 0.18 s total. Thus the existing suite passing does not cover the console discrepancy above. - Conventions against current main `ae7d59258ea77b090c6be392e2eb2872a9744d00`, whitespace and clean-checkout checks pass. I did not run a new PS5 probe, full product/shared-library/NID integration, guest standard-stream/syslog tests, Linux/macOS tests or hosted CI. The referenced console measurements are the author's published evidence. AI-assisted review and native replay (OpenAI Codex).
thepoppfish commented 2026-10-25 20:23:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by thepoppfish on 2026-10-25T20:23:36Z.

Review: APPROVED


Re-reviewed exact head 7b9fb0e20472b85267abf79b53e954e01240c991. Approve: my recorded error-zero/16-byte discrepancy is fixed, and the description/debt now distinguish console observations from the statically derived boundary rule.

The new guard rejects every length below 23 before touching the destination. Accepted buffers use the stated length-minus-one copy, zero-fill and final terminator; a null accepted-size destination throws explicitly. The 23-byte rule is attributed to the author's static reading of PPSA31872's bundled libc, rather than a new console run. I have not independently read that private binary, and the text correctly leaves 17–255-byte console behavior unmeasured.

Fresh Windows 11 build 26200 / GCC 16.2.0-6 UCRT native checks, compiling the complete revised Errors.cpp and WideConversion.cpp:

  • All 105 strerror and 35 strerror_r rows in the previously pinned console log (ac32b35b38ef0b871b47e975877738add7b4c0b0) now match. The specific (0,16) replay returns 34, preserves the buffer, and retains errno1234. The old-head executable still returns 0 and writes, so the negative control remains effective.
  • 28,140 additional calls check the documented source contract: 105 recorded error texts across capacities 0–260, 420 null/short calls and 315 null/accepted-size exception cases. Zero failures, including full buffer/canary contents, truncation, zero-fill and errno. These intermediate-size checks validate the stated contract locally; they are not new console measurements.
  • 5/5 external native CTests pass, zero skips, 0.36s total. These include the complete committed GuestErrors and GuestSafeErrors fixtures, the recorded-row comparison, original minimal reproduction and additional boundary matrix.
  • Safe-API retention: 9,492 strerror_s calls plus 113 strerrorlen_s calls produce a 1,070,336-byte snapshot identical to both prior-head and original-main snapshots, including all recorded buffer bytes, returns, lengths, errno and 452 callbacks.
  • Conventions against main 2f506cacac52cc58887236582b96338c5ad51f62, whitespace and clean-checkout checks pass.

The isolated harness retains the disclosed errno adapter (return &errno, as in Process.cpp), actual FileStream class with already-open CRT-standard-descriptor preparation, and an unused wide-conversion boundary that throws if reached. No error-message algorithm was replaced. I did not run a full shared libc/NID/guest-standard-stream/syslog build, new PS5 probe, Linux/macOS execution or hosted CI. The author's separate full guest-test reports are not my runs.

The corrected inline thread remains unresolved/outdated; please resolve it from the author/maintainer side. No remaining finding from my review. AI-assisted re-review (OpenAI Codex).

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5645055040 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11127#pullrequestreview-5645055040). Originally posted by [thepoppfish](https://github.com/thepoppfish) on 2026-10-25T20:23:36Z. **Review:** APPROVED --- Re-reviewed exact head `7b9fb0e20472b85267abf79b53e954e01240c991`. Approve: my recorded error-zero/16-byte discrepancy is fixed, and the description/debt now distinguish console observations from the statically derived boundary rule. The new guard rejects every length below 23 before touching the destination. Accepted buffers use the stated length-minus-one copy, zero-fill and final terminator; a null accepted-size destination throws explicitly. The 23-byte rule is attributed to the author's static reading of PPSA31872's bundled libc, rather than a new console run. I have not independently read that private binary, and the text correctly leaves 17–255-byte console behavior unmeasured. Fresh Windows 11 build 26200 / GCC 16.2.0-6 UCRT native checks, compiling the complete revised `Errors.cpp` and `WideConversion.cpp`: - **All 105 `strerror` and 35 `strerror_r` rows** in the previously pinned console log (`ac32b35b38ef0b871b47e975877738add7b4c0b0`) now match. The specific `(0,16)` replay returns **34**, preserves the buffer, and retains errno1234. The old-head executable still returns 0 and writes, so the negative control remains effective. - **28,140 additional calls** check the documented source contract: 105 recorded error texts across capacities 0–260, 420 null/short calls and 315 null/accepted-size exception cases. Zero failures, including full buffer/canary contents, truncation, zero-fill and errno. These intermediate-size checks validate the stated contract locally; they are not new console measurements. - **5/5 external native CTests pass**, zero skips, 0.36s total. These include the complete committed `GuestErrors` and `GuestSafeErrors` fixtures, the recorded-row comparison, original minimal reproduction and additional boundary matrix. - Safe-API retention: **9,492 `strerror_s` calls plus 113 `strerrorlen_s` calls** produce a 1,070,336-byte snapshot identical to both prior-head and original-main snapshots, including all recorded buffer bytes, returns, lengths, errno and 452 callbacks. - Conventions against main `2f506cacac52cc58887236582b96338c5ad51f62`, whitespace and clean-checkout checks pass. The isolated harness retains the disclosed errno adapter (`return &errno`, as in `Process.cpp`), actual `FileStream` class with already-open CRT-standard-descriptor preparation, and an unused wide-conversion boundary that throws if reached. No error-message algorithm was replaced. I did not run a full shared libc/NID/guest-standard-stream/syslog build, new PS5 probe, Linux/macOS execution or hosted CI. The author's separate full guest-test reports are not my runs. The corrected inline thread remains unresolved/outdated; please resolve it from the author/maintainer side. No remaining finding from my review. AI-assisted re-review (OpenAI 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!11127
No description provided.