Bug 29545 - strerrorname_np returns NULL for some defined errno values
Summary: strerrorname_np returns NULL for some defined errno values
Status: NEW
Alias: None
Product: glibc
Classification: Unclassified
Component: hurd (show other bugs)
Version: 2.34
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-03 09:00 UTC by Samuel Thibault
Modified: 2023-07-03 20:21 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
testcase (5.70 KB, text/x-csrc)
2022-09-03 09:00 UTC, Samuel Thibault
Details
test case for Linux/powerpc64le (128 bytes, text/x-csrc)
2022-09-08 01:47 UTC, Bruno Haible
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Thibault 2022-09-03 09:00:19 UTC
Created attachment 14314 [details]
testcase

From Bruno Haible <bruno@clisp.org>:

The function strerrorname_np is supposed to return non-NULL for all defined
errno values. https://www.gnu.org/software/libc/manual/html_node/Error-Messages.html

On Hurd, for the errnos with names
  ED_*
  EKERN_*
  EMACH_*
  EMIG_*
it returns NULL.

How to reproduce:
$ gcc -Wall foo.c
$ ./a.out

Seen on Debian GNU/Hurd, with glibc 2.34.
Comment 1 Samuel Thibault 2022-09-03 09:02:59 UTC
I guess it's a matter of completing manual/errno.texi with these, help welcome!
Comment 2 Bruno Haible 2022-09-08 01:47:52 UTC
Created attachment 14323 [details]
test case for Linux/powerpc64le

Similarly, on Linux/powerpc64le: for the errno with name EDEADLOCK strerrorname_np returns NULL.

How to reproduce:
$ gcc -Wall -O foo-ppc.c
$ ./a.out
strerrorname_np (EDEADLOCK) = (null)

Seen on Linux/ppc64le with glibc 2.35.
Comment 3 Andreas Schwab 2022-09-08 07:39:41 UTC
mips, powerpc and sparc use a separate value for EDEADLOCK, while all other architectures alias it to EDEADLK.
Comment 4 Bruno Haible 2023-06-25 16:11:28 UTC
Similarly, on Linux/sparc64: for the errno with name EDEADLOCK strerrorname_np returns NULL.

How to reproduce:
$ gcc -Wall -O foo-ppc.c
$ ./a.out
strerrorname_np (EDEADLOCK) = (null)

Seen on Linux/sparc64 with glibc 2.36.
Comment 5 Adhemerval Zanella 2023-07-03 19:37:08 UTC
Linux missing EDEADLK was already fixed by 3d7d5c10c806ee24f8e35014e41e203002609a3f.
Comment 6 Bruno Haible 2023-07-03 20:21:27 UTC
(In reply to Adhemerval Zanella from comment #5)
> Linux missing EDEADLK was already fixed by
> 3d7d5c10c806ee24f8e35014e41e203002609a3f.

Indeed, 3d7d5c10c806ee24f8e35014e41e203002609a3f (most likely) fixed the case of missing EDEADLOCK on Linux.

So, the only remaining errnos to be added are for Hurd, the errnos with names
  ED_*
  EKERN_*
  EMACH_*
  EMIG_*
(as in the original description).