fix(libc): name the extended errno values in strerror as titles' libc.prx does #12527
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12527"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-28T17:35:18Z.
What
strerror,strerror_r,strerror_sandstrerrorlen_snow name eight error numbers above the FreeBSD range the way thelibc.prxthat PS5 titles ship does.mainanswerederror_code=0x%08xfor them.perrorand syslog's%mreadstrerror_r, so they follow. Every other number already matched.This doesn't contradict the measurements in the debt entry:
INT_MAXandINT_MIN.libc.prxmeasurement covered a similar sample.Neither tried these eight numbers. The entry now says which numbers each source covered, and that the eight extra names weren't run on a console.
Tested
Windows 11 Enterprise 10.0.22621, Ryzen 9 5950X, WinLibs GCC 15.2.0 UCRT r7, Ninja, Release,
BUILD_TESTING=ON, head603fccf608onmain470a562903.libc.prxof PPSA05916, PPSA07923 and PPSA13934 natively. It calls theirstrerrorby NID for every number from -2000 to 2000, plusINT_MAX,INT_MIN, 65535, 65536, 0x10000000 and -65536 (4,007 numbers).main: 8 differences in each title, exactly the eight numbers above; the three titles agree.strerror_randstrerror_s(texts and return values) andstrerrorlen_sgive the same results as the titles in all three for 95, 96, the eight numbers, and 1075.guest_errorsnow checks the eight texts throughstrerrorandstrerror_r, and checks that their neighbours (106, 109, 151, 153, 1039, 1041, 1075) keeperror_code=…. Withmain'sErrors.cppand the new test,guest_errorsfails.guest_errors,guest_safe_errors,guest_syslog,guest_host_standard_error_windowsandguest_errpass 3/3. Conventions pass.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T18:07:03Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The added errno mappings and focused assertions look sound, but the debt entry for the related Annex K functions now overstates what was verified against firmware 13.60.
What I ran
Reviewed head
603fccf60833c4a363625191a485cc77432dd0c5against the PR base2199ee0d478096a794c933321cdad7c0ec2ea94e; also checked the head against currentmaine4da19aff06e25ae16b90f460dff22e8ac1eb786. It merges cleanly with currentmain(merge tree72a049ec7df2762d33d49a234f7eb153dbe26e6d). Environment: Debian 12, GCC 12.2.0, QEMU TCG. The focused Linux test used the exact PRErrors.cppandGuestErrors.cppblobs in an existing build based on470a5629036c987e6a141979b9dc576c736f4193; those touched code/test files have no intervening changes through currentmain.Results
72a049ec7df2762d33d49a234f7eb153dbe26e6dgit diff --checkguest_error_testssource/test blobsmainErrors.cppand the PR test unchanged, the test aborted with exit 134, as expectedcheck_main_sync,debt_split,hardware_oracle, andpr_overlap_branch_scanUnedited focused test output
PR build output:
The PR test executable exited 0 under QEMU and printed no output.
Negative-control output:
Hosted relinker CTest summary:
Negative control
Errors.cpp; kept the PR's newGuestErrors.cppunchangedFindings
Blocking
strerror_s/strerrorlen_sdebt note has stale provenance. At this head, both functions obtain text throughReadErrorMessage, which callsstrerror_r; they therefore now return the eight new title-derived messages as well. The neighboring debt entry says those eight were not run on a console, while thestrerror_s/strerrorlen_sentry still says their text matches PS5 firmware 13.60. The PR reports checking the added values against three shipped titlelibc.prxfiles, not firmware 13.60. Please update that entry to distinguish the title measurements from the firmware measurements and say that firmware behavior for the eight added values is unverified.Non-blocking
perrororientation line and a separate debt-doc entry. I manually checked both hunks; they do not overlap this change’s lines.perrorwill consume the newstrerror_rtext through its existing call.Sources
strerror_s/strerrorlen_simplementation at the reviewed headNot verified
I did not run the three-title native loader comparison, Windows 11, macOS, or PS5 console tests. The author reports the native comparison and Windows regression suite as passing. I independently ran only the focused
guest_error_testssource/test pair under QEMU; the normal hosted Windows job skipped its selective build and CTest steps.To get this to a good state
Please update the
strerror_s/strerrorlen_sdebt entry to distinguish which extended values were measured on titles and which were measured on firmware 13.60. I’ll re-review the new head and rerun the focused test and negative control.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T18:31:17Z.
Review: APPROVED
Re-checked — new head, looks good
The new debt wording now separates the firmware measurements from the eight title-derived names, and the unchanged focused test still passes with the PR implementation while detecting the upstream implementation.
What I ran
Re-checked head
e80f7d8048d29ca9e640129f9e05ca799ae20171against current basef21ef7c99c5af648c5a41bddb18ce118b8e60c46; the PR merges cleanly. Environment: Debian 12 x86_64, GCC 12.2, QEMU user-mode x86_64. The new commit updates documentation; theErrors.cppandGuestErrors.cppblobs are unchanged from the previously tested head. I rebuilt those exact PR blobs in the existing Linux test build and reran the focused test and negative control.The test binaries used the exact
Errors.cppandGuestErrors.cppblobs at this head. The build directory is a temporary preconfigured Linux build; no tracked workspace files were modified.Results
git diff --checkguest_error_testswith PR implementationErrors.cppand PR test unchangedUnedited focused build and test output
Negative control
Errors.cppsource blob with currentmain; left the PRGuestErrors.cpptest unchangedFindings
Blocking
None remain from my previous review.
Non-blocking
Hosted Linux product tests were skipped, and hosted macOS jobs were pending when checked. The native title comparison remains author-reported; I did not reproduce it.
Sources
Not verified
I did not run the title-native comparison, hosted macOS jobs, other operating systems, or a PS5 console. The Windows hosted workflow passed but skipped CTest; the Linux product job was skipped.
To get this to a good state
No follow-up is needed for the issue raised in my previous review. If the head changes, I will re-check the documentation and rerun the focused test and negative control.