Bug 20687 - Non-conformant error description in errlist.c
Summary: Non-conformant error description in errlist.c
Status: RESOLVED INVALID
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.24
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-12 05:41 UTC by Igor Liferenko
Modified: 2016-10-12 11:09 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed: 2016-10-12 00:00:00
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Liferenko 2016-10-12 05:41:03 UTC
The standard[1] says:

    EILSEQ          Illegal byte sequence

but glibc-2.24/sysdeps/gnu/errlist.c has this:

    [ERR_REMAP (EILSEQ)] = N_("Invalid or incomplete multibyte or wide character")

glibc tries to conform to the standard[2], so this should be fixed.


[1]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html

[2]: as said, e.g., in the comment to commit https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=1fc0e33153186a90140c3d25f5d9b4537890d7cc
Comment 1 Carlos O'Donell 2016-10-12 05:50:47 UTC
(In reply to Igor Liferenko from comment #0)
> The standard[1] says:
> 
>     EILSEQ          Illegal byte sequence
> 
> but glibc-2.24/sysdeps/gnu/errlist.c has this:
> 
>     [ERR_REMAP (EILSEQ)] = N_("Invalid or incomplete multibyte or wide
> character")
> 
> glibc tries to conform to the standard[2], so this should be fixed.

Where does it say in the standard that the text needs to be exactly as it is in the standard? Not to mention that strerror_l can be used to return localization specific error messages which will never be the exact American English text written into the standard.

Without any further justification I'd say this is RESOLVED/INVALID.
Comment 2 Dmitry V. Levin 2016-10-12 06:21:45 UTC
This wording was chosen on purpose.  GNU Coding Standards (see e.g. https://www.gnu.org/prep/standards/html_node/GNU-Manuals.html) say:
"Please do not use the term “illegal” to refer to erroneous input to a computer program. Please use “invalid” for this, and reserve the term “illegal” for activities prohibited by law."
Comment 3 Carlos O'Donell 2016-10-12 07:13:01 UTC
(In reply to Dmitry V. Levin from comment #2)
> This wording was chosen on purpose.  GNU Coding Standards (see e.g.
> https://www.gnu.org/prep/standards/html_node/GNU-Manuals.html) say:
> "Please do not use the term “illegal” to refer to erroneous input to a
> computer program. Please use “invalid” for this, and reserve the term
> “illegal” for activities prohibited by law."

Thanks Dmitry. I agree, and in this case I'm going to close this as RESOLVED/INVALID. There is no rationale I see in POSIX that requires any specific text, and the GNU Coding Standards clarify why we chose the text we did.