Collin Funk <collin.fu...@gmail.com> writes:

>> ../../build-aux/test-driver: line 121: 54: Memory fault(coredump)
>> FAIL test-strerrorname_np (exit status: 267)
>>
>> Do you have time to investigate this?
>
> Sure, I will take a look at it later today.

As promised, I have pushed the attached patch that fixes the test.

The issue is pretty simple. The strerrorname_np function on this OmniOS
version returns NULL when given ERESTART or ESTRPIPE. I created a bug
report for Illumos so hopefully it will get fixed at some point [1].

Collin

[1] https://www.illumos.org/issues/17134

>From 3691a095c1eb6579d32551b2af02550bc3f6cccc Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.fu...@gmail.com>
Date: Fri, 24 Jan 2025 20:38:54 -0800
Subject: [PATCH] strerrorname_np: Work around a bug on Solaris 11 OmniOS.

* m4/strerrorname_np.m4 (gl_CHECK_STRERRORNAME_NP): Test if
strerrorname_np returns NULL when given ERESTART or ESTRPIPE.
* doc/glibc-functions/strerrorname_np.texi: Document the bug.
---
 ChangeLog                                |  7 +++++++
 doc/glibc-functions/strerrorname_np.texi |  3 ++-
 m4/strerrorname_np.m4                    | 11 ++++++++++-
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fd7ce7288c..6f3cd5d7f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2025-01-24  Collin Funk  <collin.fu...@gmail.com>
+
+	strerrorname_np: Work around a bug on Solaris 11 OmniOS.
+	* m4/strerrorname_np.m4 (gl_CHECK_STRERRORNAME_NP): Test if
+	strerrorname_np returns NULL when given ERESTART or ESTRPIPE.
+	* doc/glibc-functions/strerrorname_np.texi: Document the bug.
+
 2025-01-24  Bruno Haible  <br...@clisp.org>
 
 	package-version: Simplify further.
diff --git a/doc/glibc-functions/strerrorname_np.texi b/doc/glibc-functions/strerrorname_np.texi
index ddf4d20726..aacfaf12b2 100644
--- a/doc/glibc-functions/strerrorname_np.texi
+++ b/doc/glibc-functions/strerrorname_np.texi
@@ -23,7 +23,8 @@ @node strerrorname_np
 @c https://sourceware.org/bugzilla/show_bug.cgi?id=26555
 @c https://sourceware.org/bugzilla/show_bug.cgi?id=29545
 @c https://sourceware.org/bugzilla/show_bug.cgi?id=31080
-glibc 2.37.
+@c https://www.illumos.org/issues/17134
+glibc 2.37, Solaris 11 OmniOS.
 @end itemize
 
 Portability problems not fixed by Gnulib:
diff --git a/m4/strerrorname_np.m4 b/m4/strerrorname_np.m4
index 083c367e31..61e11f0ec4 100644
--- a/m4/strerrorname_np.m4
+++ b/m4/strerrorname_np.m4
@@ -1,5 +1,5 @@
 # strerrorname_np.m4
-# serial 7
+# serial 8
 dnl Copyright (C) 2020-2025 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -45,6 +45,9 @@ AC_DEFUN([gl_CHECK_STRERRORNAME_NP]
     dnl In glibc 2.37, strerrorname_np returns NULL for ENOSYM and
     dnl EREMOTERELEASE on hppa platforms.
     dnl See <https://sourceware.org/bugzilla/show_bug.cgi?id=31080>.
+    dnl In Solaris 11 OmniOS, strerrorname_np returns NULL for ERESTART
+    dnl and ESTRPIPE.
+    dnl see <https://www.illumos.org/issues/17134>.
     AC_CACHE_CHECK([whether strerrorname_np works],
       [gl_cv_func_strerrorname_np_works],
       [AC_RUN_IFELSE(
@@ -60,6 +63,12 @@ AC_DEFUN([gl_CHECK_STRERRORNAME_NP]
                 #ifdef ENOSYM
                 || strerrorname_np (ENOSYM) == NULL
                 #endif
+                #ifdef ERESTART
+                || strerrorname_np (ERESTART) == NULL
+                #endif
+                #ifdef ESTRPIPE
+                || strerrorname_np (ESTRPIPE) == NULL
+                #endif
                 ;
             ]])],
          [gl_cv_func_strerrorname_np_works=yes],
-- 
2.48.1

Reply via email to