Repository navigation
fix(libc): preserve invalid strerror error precedence - #2057
Closed
STUPIDCONTEM wants to merge 1 commit into
Closed
STUPIDCONTEM wants to merge 1 commit into
STUPIDCONTEM wants to merge 1 commit into
Conversation
MarcZX10
approved these changes
Oct 9, 2026
MarcZX10
left a comment
Contributor
There was a problem hiding this comment.
Reviewed the complete diff and checked the cited FreeBSD stable/11 implementation: unknown error numbers keep EINVAL, while ERANGE is returned for truncation only on known errors. The new test covers precedence, truncation, NUL termination, sentinel safety, and guest errno. I built and ran the exact head on Linux with GCC 12; guest_strerror_r passed (1/1), and conventions/diff checks pass. Upstream has no check results for this fork head; the Windows full-suite evidence is reported in the PR description.
9 tasks done
This was referenced Oct 10, 2026
9 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Evidence review (2026-10-09)
Game/title evidence has not been established. Validation below is host regression/build evidence only; it does not establish title compatibility. Older checked items and test results describe their stated revisions, not current merge readiness.
Game/title ID: none verified. No PS5 title execution is claimed.
What
strerror_rreplaced EINVAL with ERANGE when the error number was unknown and the output buffer was also too short. Preserve EINVAL for unknown numbers, matching FreeBSD stable/11 strerror_r, which checks buffer truncation for valid error numbers only. Known errors still return ERANGE when their messages do not fit. Existing truncation, NUL termination, and errno preservation remain intact.Tested
Windows 10 Pro 19045, WinLibs GCC 15.2.0 UCRT/posix/SEH r7, Ninja Release, BUILD_TESTING=ON, SPIRV-Tools disabled. Independent branch from
f145139676a48306681d3a4d5fabf83938759daf.guest_strerror_rfails against unchanged upstream atshort unknown buffer still returns EINVAL.libsbuilds passed; full CTest: 489/489 passed, 31.78 s.The separate regression leaves
GuestErrors.cppunchanged, avoiding the test-only change in #1712. #1729 uses strerror_r in syslog but does not change this implementation. Linux and PS5 hardware/titles were not run.Checklist
main; no other open PR implements the same change (historical base; current readiness not asserted)