Repository navigation
fix(libc): use FreeBSD's strerror message texts - #2727
Closed
husseinkad wants to merge 2 commits into
Closed
husseinkad wants to merge 2 commits into
husseinkad wants to merge 2 commits into
Conversation
Twenty-five of the ninety-seven errno messages differed from FreeBSD releng/11.4 lib/libc/gen/errlst.c (for example errno 0, 30, 47, 62, 70 and 84).
|
Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes. |
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.
What
The guest
strerrorandstrerror_rreturned message texts that differ from FreeBSD'slib/libc/gen/errlst.cfor 25 of the 97 errno values 0 to 96 (the numbering was already right). Examples: 0 "No error" (FreeBSD: "No error: 0"), 30 "Read-only filesystem" ("Read-only file system"), 47 "Address family not supported" ("Address family not supported by protocol family"), 62 "Too many symbolic links" ("Too many levels of symbolic links"), 69 "Disk quota exceeded" ("Disc quota exceeded"), 70 "Stale file handle" ("Stale NFS file handle"), 84 "Value too large" ("Value too large to be stored in data type"). The other differing entries are 49, 52, 53, 58, 59, 71 to 76, 79, 81, 83, 86, 91, 93 and 94. A title or library that prints or compares these texts (the guest syslog%mgoes throughstrerror_r) saw a different string than on the console.The message table in
Errors.cppis now the one in FreeBSD's releng/11.4errlst.c(the repo pins the FreeBSD 11 ABI; the texts for 0 to 96 are identical in releng/9.0, 10, 11.4 and 12, which differ only in how many entries the table has). The unknown-error text (Unknown error: N), the errno handling and the buffer logic are unchanged.Tested
Windows 11 (10.0.26200), WinLibs GCC 15.2.0 r7, Release:
guest_errorsnow checksstrerror_randstrerroragainst a 97-entry FreeBSD table for every errno from 0 to 96, and the exact unknown-error texts for -1, 97,INT_MAXandINT_MIN; it fails without the change (exit0xc0000409) and passes with it.ctest -R guest_errorspasses.sys_errlist[]from the FreeBSD 11.4 source (and from 9.3) against the built exports: all 97 texts match in bothErrors.cppand the test table (the 25 changed ones, and the other 72 unchanged), unknown errnos from -5 to 120 andINT_MIN/INT_MAXgiveUnknown error: N,strerror_rtruncation and NUL termination match a model of FreeBSD's for 1032 (errno, size) calls with no write outside the buffer, and 8 threads callingstrerrorandstrerror_rfor 2 seconds (16 million calls) never saw a torn string.strerror_rreturnsERANGEwhere FreeBSD returnsEINVAL.tools/check_conventions.py --base origin/mainpasses;tools/pr_overlap.py --branchreports no overlap.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository