bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

strerrorname_np: Work around glibc bug on PowerPC, SPARC systems


From: Bruno Haible
Subject: strerrorname_np: Work around glibc bug on PowerPC, SPARC systems
Date: Sun, 25 Jun 2023 18:21:55 +0200

This patch works around a crash of the test-strerrorname_np test, seen on
cfarm105.cfarm.net:

../../build-aux/test-driver: line 112: 3107642 Segmentation fault      "$@" >> 
"$log_file" 2>&1
FAIL: test-strerrorname_np


2023-06-25  Bruno Haible  <bruno@clisp.org>

        strerrorname_np: Work around glibc bug on PowerPC, SPARC systems.
        * m4/strerrorname_np.m4 (gl_FUNC_STRERRORNAME_NP): Test also
        strerrorname_np (EDEADLOCK).
        * doc/glibc-functions/strerrorname_np.texi: Mention that glibc 2.36
        still needs a workaround.

diff --git a/doc/glibc-functions/strerrorname_np.texi 
b/doc/glibc-functions/strerrorname_np.texi
index 59a103e379..b9c6252b15 100644
--- a/doc/glibc-functions/strerrorname_np.texi
+++ b/doc/glibc-functions/strerrorname_np.texi
@@ -20,7 +20,8 @@
 @item
 This function returns wrong values on some platforms:
 @c https://sourceware.org/bugzilla/show_bug.cgi?id=26555
-glibc 2.32.
+@c https://sourceware.org/bugzilla/show_bug.cgi?id=29545
+glibc 2.36.
 @end itemize
 
 Portability problems not fixed by Gnulib:
diff --git a/m4/strerrorname_np.m4 b/m4/strerrorname_np.m4
index 7e68bf7a91..cb160e102d 100644
--- a/m4/strerrorname_np.m4
+++ b/m4/strerrorname_np.m4
@@ -1,4 +1,4 @@
-# strerrorname_np.m4 serial 2
+# strerrorname_np.m4 serial 3
 dnl Copyright (C) 2020-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -15,6 +15,9 @@ AC_DEFUN([gl_FUNC_STRERRORNAME_NP]
     dnl In glibc 2.32, strerrorname_np returns English error descriptions, not
     dnl error names.
     dnl See <https://sourceware.org/bugzilla/show_bug.cgi?id=26555>.
+    dnl In glibc 2.36, strerrorname_np returns NULL for EDEADLOCK on powerpc 
and
+    dnl sparc platforms.
+    dnl See <https://sourceware.org/bugzilla/show_bug.cgi?id=29545>.
     AC_CACHE_CHECK([whether strerrorname_np works],
       [gl_cv_func_strerrorname_np_works],
       [AC_RUN_IFELSE(
@@ -22,7 +25,12 @@ AC_DEFUN([gl_FUNC_STRERRORNAME_NP]
             [[#include <errno.h>
               #include <string.h>
             ]],
-            [[return strcmp (strerrorname_np (EINVAL), "EINVAL") != 0;
+            [[return
+                strcmp (strerrorname_np (EINVAL), "EINVAL") != 0
+                #ifdef EDEADLOCK
+                || strerrorname_np (EDEADLOCK) == NULL
+                #endif
+                ;
             ]])],
          [gl_cv_func_strerrorname_np_works=yes],
          [gl_cv_func_strerrorname_np_works=no],






reply via email to

[Prev in Thread] Current Thread [Next in Thread]