bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* Re: [platform-testers] new snapshot available: grep-3.4-almost.19-ff30
       [not found] ` <CAH8yC8mn1YMN+fgzJBKEk9+y0qTqfO2zHbWUyO2ekVq-PimX3Q@mail.gmail.com>
@ 2020-09-17 14:40   ` Jim Meyering
  2020-09-17 22:46   ` Bruno Haible
  2020-09-19 13:12   ` Bruno Haible
  2 siblings, 0 replies; 14+ messages in thread
From: Jim Meyering @ 2020-09-17 14:40 UTC (permalink / raw)
  To: Jeffrey Walton, bug-gnulib@gnu.org List
  Cc: platform-testers, GNU grep developers

[-- Attachment #1: Type: text/plain, Size: 702 bytes --]

On Thu, Sep 17, 2020 at 6:37 AM Jeffrey Walton <noloader@gmail.com> wrote:
> Hi Everyone,
>
> grep-3.4-almost.19-ff30 fails self test on Alpine Linux 3.10 with
> BusyBox, triplet x86_64-pc-linux-gnu.
>
>   FAIL: test-dfa-match.sh

Thank you for reporting that. I'll start with that first issue.
That is due to a now-erroneous test for busybox-specific timeout
program which used to require "-t" before the timeout value.
Now, it has aligned with coreutils, since the 31 December 2018 release
of BusyBox 1.30.0 (unstable).
I've fixed it with the attached patch, also just pushed to gnulib.

>   FAIL: test-hard-locale
>   FAIL: test-setlocale_null-mt-all
>
> Attached are config.log and test-suite.log.

[-- Attachment #2: test-dfa-match.sh--busybox-vs-timeout.patch --]
[-- Type: application/octet-stream, Size: 1461 bytes --]

From d7d69621581065274582c78981b58dbce4313d2c Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@fb.com>
Date: Thu, 17 Sep 2020 07:36:26 -0700
Subject: [PATCH] test-dfa-match.sh: port timeout work-around to newer Busybox

* tests/test-dfa-match.sh: Update timeout -t portability test to
accommodate Busybox 1.30.0 and newer.
---
 ChangeLog               | 6 ++++++
 tests/test-dfa-match.sh | 4 +++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index bbd420cb2..e5b50bf55 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2020-09-17  Jim Meyering  <meyering@fb.com>
+
+	test-dfa-match.sh: port timeout work-around to newer Busybox
+	* tests/test-dfa-match.sh: Update timeout -t portability test to
+	accommodate Busybox 1.30.0 and newer.
+
 2020-09-16  Paul Eggert  <eggert@cs.ucla.edu>

 	fnmatch: adjust to match glibc fix
diff --git a/tests/test-dfa-match.sh b/tests/test-dfa-match.sh
index a7285ec0b..d3c434d66 100755
--- a/tests/test-dfa-match.sh
+++ b/tests/test-dfa-match.sh
@@ -22,7 +22,9 @@
 path_prepend_ .

 if (type timeout) >/dev/null 2>&1; then
-  if timeout --help 2>&1 | grep BusyBox; then
+    # Busybox's timeout required -t until its 1.30.0 release on 2018-12-31,
+    # after which it became compatible with coreutils' timeout.
+  if timeout --help 2>&1 | grep BusyBox && timeout -t 0 true; then
     timeout_10='timeout -t 10'
   else
     timeout_10='timeout 10'
-- 
2.28.0.394.ge197136389


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [platform-testers] new snapshot available: grep-3.4-almost.19-ff30
       [not found] ` <CAH8yC8n4tmO6__C=zP0JZRmc5_ddg7L6uGAuLfjV_Bm+i3oYsA@mail.gmail.com>
@ 2020-09-17 18:23   ` Paul Eggert
  0 siblings, 0 replies; 14+ messages in thread
From: Paul Eggert @ 2020-09-17 18:23 UTC (permalink / raw)
  To: noloader; +Cc: platform-testers, Gnulib bugs, grep-devel

[-- Attachment #1: Type: text/plain, Size: 410 bytes --]

On 9/17/20 7:52 AM, Jeffrey Walton wrote:

> grep-3.4-almost.19-ff30 fails to build on Ubuntu 4, triplet i686-pc-linux-gnu.

I installed the attached patch to Gnulib, which I hope works around this issue 
once grep is updated to the latest Gnulib. cc'ing to bug-gnulib.

The comment in the old version didn't match the code (glibc has the same 
mismatch). This patch updates the comment to match the new code.

[-- Attachment #2: 0001-libc-config-port-__THROW-to-Ubuntu-4.patch --]
[-- Type: text/x-patch, Size: 2512 bytes --]

From 8125325281a491de9e0a6edc3c4d40d77c026114 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Thu, 17 Sep 2020 09:45:21 -0700
Subject: [PATCH] libc-config: port __THROW to Ubuntu 4
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lib/cdefs.h (__THROW): Do not use __attribute__ ((__nothrow__))
for GCC 3.3.  Problem reported by Jeffrey Walton in:
https://lists.gnu.org/r/bug-gnulib/2019-07/msg00058.html
The GCC 3.3.4 documentation says the attribute should work, but
apparently it does not work on Ubuntu 4’s GCC 3.3.  There seems
little point or desire to research this circa-2004 platform further,
so just avoid the attribute there.
---
 ChangeLog   | 11 +++++++++++
 lib/cdefs.h |  4 ++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e5b50bf55..b484c8dec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2020-09-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+	libc-config: port __THROW to Ubuntu 4
+	* lib/cdefs.h (__THROW): Do not use __attribute__ ((__nothrow__))
+	for GCC 3.3.  Problem reported by Jeffrey Walton in:
+	https://lists.gnu.org/r/bug-gnulib/2019-07/msg00058.html
+	The GCC 3.3.4 documentation says the attribute should work, but
+	apparently it does not work on Ubuntu 4’s GCC 3.3.  There seems
+	little point or desire to research this circa-2004 platform further,
+	so just avoid the attribute there.
+
 2020-09-17  Jim Meyering  <meyering@fb.com>
 
 	test-dfa-match.sh: port timeout work-around to newer Busybox
diff --git a/lib/cdefs.h b/lib/cdefs.h
index 1ae9ffc77..b4ac4df66 100644
--- a/lib/cdefs.h
+++ b/lib/cdefs.h
@@ -75,11 +75,11 @@
 
 /* GCC can always grok prototypes.  For C++ programs we add throw()
    to help it optimize the function calls.  But this works only with
-   gcc 2.8.x and egcs.  For gcc 3.2 and up we even mark C functions
+   gcc 2.8.x and egcs.  For gcc 3.4 and up we even mark C functions
    as non-throwing using a function attribute since programs can use
    the -fexceptions options for C code as well.  */
 # if !defined __cplusplus \
-     && (__GNUC_PREREQ (3, 3) || __glibc_clang_has_attribute (__nothrow__))
+     && (__GNUC_PREREQ (3, 4) || __glibc_clang_has_attribute (__nothrow__))
 #  define __THROW	__attribute__ ((__nothrow__ __LEAF))
 #  define __THROWNL	__attribute__ ((__nothrow__))
 #  define __NTH(fct)	__attribute__ ((__nothrow__ __LEAF)) fct
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: grep-3.4-almost.19-ff30 on Solaris 10
       [not found] <m2imce1gpu.fsf@meyering.net>
       [not found] ` <CAH8yC8mn1YMN+fgzJBKEk9+y0qTqfO2zHbWUyO2ekVq-PimX3Q@mail.gmail.com>
       [not found] ` <CAH8yC8n4tmO6__C=zP0JZRmc5_ddg7L6uGAuLfjV_Bm+i3oYsA@mail.gmail.com>
@ 2020-09-17 20:53 ` Bruno Haible
  2020-09-18  2:26   ` Paul Eggert
  2020-09-17 21:07 ` [platform-testers] new snapshot available: grep-3.4-almost.19-ff30 Jeffrey Walton
  3 siblings, 1 reply; 14+ messages in thread
From: Bruno Haible @ 2020-09-17 20:53 UTC (permalink / raw)
  To: bug-gnulib; +Cc: Jim Meyering, grep-devel

On Solaris 10, the configuration aborts:

  $ ../configure
  ...
  checking for raise... yes
  checking for sigprocmask... 
  ../configure: test: argument expected

The reason is that gl_cv_func_sigprocmask_v16 is not set in the statement
  if test $gl_cv_func_sigprocmask_v16 != yes; then
(signalblocking.m4 line 28).

Why? Because the Solaris /bin/sh, unlike other shells, does redirected
compound statements in a subshell.

  /bin/sh -c '{ gl_foo=yes; } 6>/dev/null; echo $gl_foo'

produces 'yes' on most platforms, but empty output on Solaris 10.

This patch fixes it.


2020-09-17  Bruno Haible  <bruno@clisp.org>

	sigprocmask: Fix configuration failure on Solaris 10 (regr. 2020-07-25).
	* m4/gnulib-common.m4 (GL_TMP_FD): New macro.
	(gl_SILENT): Use 'exec', not a compound statement, to redirect
	AS_MESSAGE_FD.

diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index 33e56fa..35be4d3 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 57
+# gnulib-common.m4 serial 58
 dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -630,13 +630,18 @@ AC_DEFUN([gl_BIGENDIAN],
   AC_C_BIGENDIAN
 ])
 
+# A temporary file descriptor.
+# Must be less than 10, because dash 0.5.8 does not support redirections
+# with multi-digit file descriptors.
+m4_define([GL_TMP_FD], 9)
+
 # gl_SILENT(command)
 # executes command, but without the normal configure output.
 AC_DEFUN([gl_SILENT],
 [
-  {
-    $1
-  } AS_MESSAGE_FD>/dev/null
+  exec GL_TMP_FD>&AS_MESSAGE_FD AS_MESSAGE_FD>/dev/null
+  $1
+  exec AS_MESSAGE_FD>&GL_TMP_FD AS_MESSAGE_FD>&-
 ])
 
 # gl_CACHE_VAL_SILENT(cache-id, command-to-set-it)



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [platform-testers] new snapshot available: grep-3.4-almost.19-ff30
       [not found] <m2imce1gpu.fsf@meyering.net>
                   ` (2 preceding siblings ...)
  2020-09-17 20:53 ` grep-3.4-almost.19-ff30 on Solaris 10 Bruno Haible
@ 2020-09-17 21:07 ` Jeffrey Walton
  2020-09-18 17:36   ` Paul Eggert
  3 siblings, 1 reply; 14+ messages in thread
From: Jeffrey Walton @ 2020-09-17 21:07 UTC (permalink / raw)
  To: grep-devel; +Cc: platform-testers, bug-gnulib

Hi Everyone,

One failure on Ubuntu 18.04 x86_64 under UBsan (-fsanitize=undefined
-fno-sanitize-recover=all).

FAIL: test-c-stack2.sh

Unfortunately, nothing is being logged:

$ cat grep-3.4-almost.19-ff30/gnulib-tests/test-c-stack2.sh.log
FAIL test-c-stack2.sh (exit status: 1)
$ cat grep-3.4-almost.19-ff30/gnulib-tests/test-c-stack2.sh.trs
:test-result: FAIL
:global-test-result: FAIL
:recheck: yes
:copy-in-global-log: yes
$

Jeff

On Wed, Sep 16, 2020 at 12:37 AM Jim Meyering <jim@meyering.net> wrote:
>
> There have been nontrivial changes and fixes and I think we're
> in a pretty good spot, so I'm planning to release grep-3.5 within
> the next two weeks.
>
> Please build and test this and let us know how it goes.
>
> Thanks to Paul Eggert for making so many of the changes here
> and to Norihiro Tanaka for helping so much with gnulib's dfa.c.
>
> grep snapshot:
>   https://meyering.net/grep/grep-ss.tar.xz      1.6 MB
>   https://meyering.net/grep/grep-ss.tar.xz.sig
>   https://meyering.net/grep/grep-3.4-almost.19-ff30.tar.xz
> ...


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [platform-testers] new snapshot available: grep-3.4-almost.19-ff30
       [not found] ` <CAH8yC8mn1YMN+fgzJBKEk9+y0qTqfO2zHbWUyO2ekVq-PimX3Q@mail.gmail.com>
  2020-09-17 14:40   ` [platform-testers] new snapshot available: grep-3.4-almost.19-ff30 Jim Meyering
@ 2020-09-17 22:46   ` Bruno Haible
  2020-09-19 13:12   ` Bruno Haible
  2 siblings, 0 replies; 14+ messages in thread
From: Bruno Haible @ 2020-09-17 22:46 UTC (permalink / raw)
  To: bug-gnulib, noloader; +Cc: grep-devel

Jeffrey Walton wrote in
<https://lists.gnu.org/archive/html/grep-devel/2020-09/msg00020.html>:

> grep-3.4-almost.19-ff30 fails self test on Alpine Linux 3.10 with
> BusyBox, triplet x86_64-pc-linux-gnu.
> 
>   ...
>   FAIL: test-hard-locale
>   FAIL: test-setlocale_null-mt-all

I reproduce on Alpine Linux 3.10, but the tests succeed on Alpine Linux 3.12.
Investigating...

Bruno



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: grep-3.4-almost.19-ff30 on Solaris 10
  2020-09-17 20:53 ` grep-3.4-almost.19-ff30 on Solaris 10 Bruno Haible
@ 2020-09-18  2:26   ` Paul Eggert
  2020-09-18  9:01     ` Bruno Haible
  0 siblings, 1 reply; 14+ messages in thread
From: Paul Eggert @ 2020-09-18  2:26 UTC (permalink / raw)
  To: Bruno Haible, bug-gnulib; +Cc: grep-devel

[-- Attachment #1: Type: text/plain, Size: 812 bytes --]

On 9/17/20 1:53 PM, Bruno Haible wrote:
> -  {
> -    $1
> -  } AS_MESSAGE_FD>/dev/null
> +  exec GL_TMP_FD>&AS_MESSAGE_FD AS_MESSAGE_FD>/dev/null
> +  $1
> +  exec AS_MESSAGE_FD>&GL_TMP_FD AS_MESSAGE_FD>&-

If a trap occurs during $1 and 'configure' outputs something to stderr before it 
exits, the output could be lost due to this patch.

Looking into it further, gl_SILENT is iffy as a general macro, as discarding 
stderr could make scripts harder to debug. Since gl_SILENT is used in just one 
place in Gnulib and it's used only to prettify the user messages, I took the 
liberty of trying to prettify the messages in a simpler way that doesn't need 
gl_SILENT, by installing the attached patch into Gnulib. I hope this suffices to 
fix the issue with gl_SIGNALBLOCKING and cached configuration variables.

[-- Attachment #2: 0001-signalblocking-simplify-and-remove-gl_SILENT.patch --]
[-- Type: text/x-patch, Size: 3792 bytes --]

From 98aff1ca8e022ef804be746bcac3b43b1f50254e Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Thu, 17 Sep 2020 19:16:07 -0700
Subject: [PATCH] signalblocking: simplify and remove gl_SILENT

gl_SILENT was problematic because if a trap was sprung, stderr
generated during the trap was lost.  Avoid the problem by
removing the need for gl_SILENT.
* m4/gnulib-common.m4 (GL_TMP_FD, gl_SILENT): Remove.
* m4/signalblocking.m4 (gl_SIGNALBLOCKING):
Simplify, avoiding the need for gl_SILENT while preserving the
ability of the user to override the value of the cache variable,
now ac_cv_func_sigprocmask.
---
 ChangeLog            | 12 ++++++++++++
 m4/gnulib-common.m4  | 16 +---------------
 m4/signalblocking.m4 | 19 ++++---------------
 3 files changed, 17 insertions(+), 30 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a489d5fa7..dc585078c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2020-09-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+	signalblocking: simplify and remove gl_SILENT
+	gl_SILENT was problematic because if a trap was sprung, stderr
+	generated during the trap was lost.  Avoid the problem by
+	removing the need for gl_SILENT.
+	* m4/gnulib-common.m4 (GL_TMP_FD, gl_SILENT): Remove.
+	* m4/signalblocking.m4 (gl_SIGNALBLOCKING):
+	Simplify, avoiding the need for gl_SILENT while preserving the
+	ability of the user to override the value of the cache variable,
+	now ac_cv_func_sigprocmask.
+
 2020-09-17  Bruno Haible  <bruno@clisp.org>
 
 	sigprocmask: Fix configuration failure on Solaris 10 (regr. 2020-07-25).
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index c94425cbe..c9f8ca6db 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 58
+# gnulib-common.m4 serial 59
 dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -630,20 +630,6 @@ AC_DEFUN([gl_BIGENDIAN],
   AC_C_BIGENDIAN
 ])
 
-# A temporary file descriptor.
-# Must be less than 10, because dash 0.5.8 does not support redirections
-# with multi-digit file descriptors.
-m4_define([GL_TMP_FD], 9)
-
-# gl_SILENT(command)
-# executes command, but without the normal configure output.
-AC_DEFUN([gl_SILENT],
-[
-  exec GL_TMP_FD>&AS_MESSAGE_FD AS_MESSAGE_FD>/dev/null
-  $1
-  exec AS_MESSAGE_FD>&GL_TMP_FD GL_TMP_FD>&-
-])
-
 # gl_CACHE_VAL_SILENT(cache-id, command-to-set-it)
 # is like AC_CACHE_VAL(cache-id, command-to-set-it), except that it does not
 # output a spurious "(cached)" mark in the midst of other configure output.
diff --git a/m4/signalblocking.m4 b/m4/signalblocking.m4
index cc0ca86bc..b7cff8ddc 100644
--- a/m4/signalblocking.m4
+++ b/m4/signalblocking.m4
@@ -1,4 +1,4 @@
-# signalblocking.m4 serial 16
+# signalblocking.m4 serial 17
 dnl Copyright (C) 2001-2002, 2006-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -13,20 +13,9 @@ AC_DEFUN([gl_SIGNALBLOCKING],
 [
   AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
   AC_REQUIRE([gl_CHECK_TYPE_SIGSET_T])
-  AC_CACHE_CHECK([for sigprocmask],
-    [gl_cv_func_sigprocmask_v16],
-    [if test $gl_cv_type_sigset_t = yes; then
-       gl_SILENT([
-         AC_CHECK_FUNC([sigprocmask],
-           [gl_cv_func_sigprocmask_v16=yes],
-           [gl_cv_func_sigprocmask_v16=no])
-       ])
-     else
-       gl_cv_func_sigprocmask_v16=no
-     fi
-    ])
-  if test $gl_cv_func_sigprocmask_v16 != yes; then
-    HAVE_POSIX_SIGNALBLOCKING=0
+  HAVE_POSIX_SIGNALBLOCKING=0
+  if test "$gl_cv_type_sigset_t" = yes; then
+    AC_CHECK_FUNC([sigprocmask], [HAVE_POSIX_SIGNALBLOCKING=1])
   fi
 ])
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: grep-3.4-almost.19-ff30 on Solaris 10
  2020-09-18  2:26   ` Paul Eggert
@ 2020-09-18  9:01     ` Bruno Haible
  2020-09-18 16:06       ` Paul Eggert
  0 siblings, 1 reply; 14+ messages in thread
From: Bruno Haible @ 2020-09-18  9:01 UTC (permalink / raw)
  To: bug-gnulib; +Cc: Paul Eggert

Hi Paul,

> On 9/17/20 1:53 PM, Bruno Haible wrote:
> > -  {
> > -    $1
> > -  } AS_MESSAGE_FD>/dev/null
> > +  exec GL_TMP_FD>&AS_MESSAGE_FD AS_MESSAGE_FD>/dev/null
> > +  $1
> > +  exec AS_MESSAGE_FD>&GL_TMP_FD AS_MESSAGE_FD>&-

I had a typo in here. Corrected:

  exec GL_TMP_FD>&AS_MESSAGE_FD AS_MESSAGE_FD>/dev/null
  $1
  exec AS_MESSAGE_FD>&GL_TMP_FD GL_TMP_FD>&-

Which expands to:

  exec 9>&6 6>/dev/null
  $1
  exec 6>&9 9>&-

> If a trap occurs during $1 and 'configure' outputs something to stderr before it 
> exits, the output could be lost due to this patch.

No, I don't think so. The file descriptor 2 is unaffected by the file descriptor
reshuffle. Only file descriptor 6 is affected, which is the one used by
AC_MSG_CHECKING/AC_MSG_RESULT. No one is supposed to use this file descriptor
in a 'trap' action.

> Looking into it further, gl_SILENT is iffy as a general macro, as discarding 
> stderr could make scripts harder to debug.

I disagree. I want gl_SILENT for the purpose of doing more complex checks inside
an AC_CACHE_CHECK invocation. Without gl_SILENT, the message output dictates the
structure of the AC_CACHE_CHECKs. This is not good.

> Since gl_SILENT is used in just one place in Gnulib

signalblocking.m4 is only the first one. I want gl_SILENT also to clean up
the getaddrinfo output and others.

> fix the issue with gl_SIGNALBLOCKING and cached configuration variables.

While the gl_SIGNALBLOCKING patch is correct, it does not help solving the
general problem that gl_SILENT is meant to address.

Can you please restore it?

Bruno



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: grep-3.4-almost.19-ff30 on Solaris 10
  2020-09-18  9:01     ` Bruno Haible
@ 2020-09-18 16:06       ` Paul Eggert
  2020-09-19  0:25         ` gl_SILENT Bruno Haible
  0 siblings, 1 reply; 14+ messages in thread
From: Paul Eggert @ 2020-09-18 16:06 UTC (permalink / raw)
  To: Bruno Haible; +Cc: bug-gnulib

On 9/18/20 2:01 AM, Bruno Haible wrote:

> The file descriptor 2 is unaffected by the file descriptor
> reshuffle. Only file descriptor 6 is affected, which is the one used by
> AC_MSG_CHECKING/AC_MSG_RESULT. No one is supposed to use this file descriptor
> in a 'trap' action.

Ah, sorry, I misread it.

>> Looking into it further, gl_SILENT is iffy as a general macro, as discarding
>> stderr could make scripts harder to debug.
> 
> I disagree. I want gl_SILENT for the purpose of doing more complex checks inside
> an AC_CACHE_CHECK invocation. Without gl_SILENT, the message output dictates the
> structure of the AC_CACHE_CHECKs. This is not good.

Agreed, but isn't gl_SILENT an unnecessarily tricky way to go about it? I worry 
we'll eventually need a gl_NOISY macro to counteract the effect of gl_SILENT.

If this approach was that useful in practice, why doesn't C's stdio package have 
a function that does something similar, e.g., stdio_silent (stderr, FOO) calls 
FOO and arranges for FOO's fprintf (stderr, ....) calls to have no effect?

If the problem is that AC_CACHE_CHECK is always noisy, do we simply need a quiet 
variant? Something like gl_CACHE_VAL_SILENT vs AC_CACHE_VAL? Or perhaps we 
should change what Autoconf does (admittedly this is a longer-term project)?

> I want gl_SILENT also to clean up
> the getaddrinfo output and others.

If it's needed then by all means please reinstate it as needed for getaddrinfo etc.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [platform-testers] new snapshot available: grep-3.4-almost.19-ff30
  2020-09-17 21:07 ` [platform-testers] new snapshot available: grep-3.4-almost.19-ff30 Jeffrey Walton
@ 2020-09-18 17:36   ` Paul Eggert
  0 siblings, 0 replies; 14+ messages in thread
From: Paul Eggert @ 2020-09-18 17:36 UTC (permalink / raw)
  To: noloader, grep-devel; +Cc: platform-testers, Gnulib bugs

[-- Attachment #1: Type: text/plain, Size: 348 bytes --]

On 9/17/20 2:07 PM, Jeffrey Walton wrote:

> One failure on Ubuntu 18.04 x86_64 under UBsan (-fsanitize=undefined
> -fno-sanitize-recover=all).
> 
> FAIL: test-c-stack2.sh

That's a Gnulib test failure caused by -fsanitize=undefined getting in the way 
of a test harness self-test. I installed the attached Gnulib patch to work 
around the glitch.

[-- Attachment #2: 0001-c-stack-tests-fix-fsanitize-undefined-false-alarm.patch --]
[-- Type: text/x-patch, Size: 1654 bytes --]

From d4fdfe40ab297fc095b542b6f257c1947ba21067 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Fri, 18 Sep 2020 10:33:02 -0700
Subject: [PATCH] c-stack-tests: fix -fsanitize=undefined false alarm
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* tests/test-c-stack2.sh: Skip the test-harness self-test
if ‘gcc -fsanitize=undefined’ is in use.
---
 ChangeLog              | 6 ++++++
 tests/test-c-stack2.sh | 7 +++++++
 2 files changed, 13 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index dc585078c..703da6058 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2020-09-18  Paul Eggert  <eggert@cs.ucla.edu>
+
+	c-stack-tests: fix -fsanitize=undefined false alarm
+	* tests/test-c-stack2.sh: Skip the test-harness self-test
+	if ‘gcc -fsanitize=undefined’ is in use.
+
 2020-09-17  Paul Eggert  <eggert@cs.ucla.edu>
 
 	signalblocking: simplify and remove gl_SILENT
diff --git a/tests/test-c-stack2.sh b/tests/test-c-stack2.sh
index 2944ff5ba..7f035933f 100755
--- a/tests/test-c-stack2.sh
+++ b/tests/test-c-stack2.sh
@@ -23,6 +23,13 @@ case $? in
         exit 77
       fi
       ;;
+  1)
+      # Dereferencing NULL exits the program with status 1,
+      # so this test doesn't check the c-stack testing harness like it should.
+      # https://lists.gnu.org/r/grep-devel/2020-09/msg00034.html
+      cat t-c-stack2.tmp >&2
+      echo 'skipping test (perhaps gcc -fsanitize=undefined is in use?)'
+      exit 77;;
   0) (exit 1); exit 1 ;;
 esac
 if grep 'program error' t-c-stack2.tmp >/dev/null ; then
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: gl_SILENT
  2020-09-18 16:06       ` Paul Eggert
@ 2020-09-19  0:25         ` Bruno Haible
  0 siblings, 0 replies; 14+ messages in thread
From: Bruno Haible @ 2020-09-19  0:25 UTC (permalink / raw)
  To: Paul Eggert; +Cc: bug-gnulib

Paul Eggert wrote:
> > The file descriptor 2 is unaffected by the file descriptor
> > reshuffle. Only file descriptor 6 is affected, which is the one used by
> > AC_MSG_CHECKING/AC_MSG_RESULT. No one is supposed to use this file descriptor
> > in a 'trap' action.
> 
> Ah, sorry, I misread it.
> 
> >> Looking into it further, gl_SILENT is iffy as a general macro, as discarding
> >> stderr could make scripts harder to debug.
> > 
> > I disagree. I want gl_SILENT for the purpose of doing more complex checks inside
> > an AC_CACHE_CHECK invocation. Without gl_SILENT, the message output dictates the
> > structure of the AC_CACHE_CHECKs. This is not good.

Stated differently: Currently, AC_CACHE_CHECKs cannot be nested. This forces
macro authors to define the checks one after the other, with the lowest level
first and the highest level last. Quite often this is reasonable and sufficient.
But the fact that I invented two different mechanisms to get around it
(1. pushdef/popdef of AC_MSG_CHECKING and AC_MSG_RESULT, 2. gl_SILENT) proves
that it is a persistent thorn.

> Agreed, but isn't gl_SILENT an unnecessarily tricky way to go about it? I worry 
> we'll eventually need a gl_NOISY macro to counteract the effect of gl_SILENT.

If we document clearly that nested AC_CACHE_CHECKs have no output, no gl_NOISY
will be needed - as macro authors can revert to the "inner check first" style.

> If this approach was that useful in practice, why doesn't C's stdio package have 
> a function that does something similar, e.g., stdio_silent (stderr, FOO) calls 
> FOO and arranges for FOO's fprintf (stderr, ....) calls to have no effect?

In C it is natural to introduce function parameters or static variables for this.

> If the problem is that AC_CACHE_CHECK is always noisy, do we simply need a quiet 
> variant? Something like gl_CACHE_VAL_SILENT vs AC_CACHE_VAL?

That is one possible way. We would then have gl_CACHE_CHECK_SILENT,
gl_CHECK_FUNC_SILENT, gl_CHECK_HEADER_SILENT, and maybe more.

> Or perhaps we 
> should change what Autoconf does (admittedly this is a longer-term project)?

This is a longer-term project, yes. There are multiple problems for Autoconf
macro authors:
  - You can't nest AC_CACHE_CHECK, or the configure output will be messy.
  - When investigating problems, I need to look at 4 files: the configure output,
    config.status, config.cache, and config.log. And they are partly redundant.
  - The configure output is so long that most people skip reading it, only
    WARNINGs that stay out get read.
  - Especially the lines with '(cached)' are useless.
  - A summary section that lists the external dependencies and most important
    details (ABI, compiler, compiler options) but not the hundreds of other
    test results is useful. But Autoconf has no standard macro for doing this.

These problems are all somewhat related.

gl_SILENT is only one brick that allows to experiment with solutions of the first
problem.

> If it's needed then by all means please reinstate it as needed for getaddrinfo etc.

Reinstated:


2020-09-18  Bruno Haible  <bruno@clisp.org>

	Add back gl_SILENT.
	* m4/gnulib-common.m4 (GL_TMP_FD, gl_SILENT): New macros.

diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index c9f8ca6..57343e4 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 59
+# gnulib-common.m4 serial 60
 dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -630,6 +630,22 @@ AC_DEFUN([gl_BIGENDIAN],
   AC_C_BIGENDIAN
 ])
 
+# A temporary file descriptor.
+# Must be less than 10, because dash 0.5.8 does not support redirections
+# with multi-digit file descriptors.
+m4_define([GL_TMP_FD], 9)
+
+# gl_SILENT(command)
+# executes command, but without the normal configure output.
+# This is useful when you want to invoke AC_CACHE_CHECK (or AC_CHECK_FUNC etc.)
+# inside another AC_CACHE_CHECK.
+AC_DEFUN([gl_SILENT],
+[
+  exec GL_TMP_FD>&AS_MESSAGE_FD AS_MESSAGE_FD>/dev/null
+  $1
+  exec AS_MESSAGE_FD>&GL_TMP_FD GL_TMP_FD>&-
+])
+
 # gl_CACHE_VAL_SILENT(cache-id, command-to-set-it)
 # is like AC_CACHE_VAL(cache-id, command-to-set-it), except that it does not
 # output a spurious "(cached)" mark in the midst of other configure output.



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [platform-testers] new snapshot available: grep-3.4-almost.19-ff30
       [not found] ` <CAH8yC8mn1YMN+fgzJBKEk9+y0qTqfO2zHbWUyO2ekVq-PimX3Q@mail.gmail.com>
  2020-09-17 14:40   ` [platform-testers] new snapshot available: grep-3.4-almost.19-ff30 Jim Meyering
  2020-09-17 22:46   ` Bruno Haible
@ 2020-09-19 13:12   ` Bruno Haible
  2020-09-19 14:21     ` Jeffrey Walton
  2020-09-20 19:28     ` Bruno Haible
  2 siblings, 2 replies; 14+ messages in thread
From: Bruno Haible @ 2020-09-19 13:12 UTC (permalink / raw)
  To: bug-gnulib, noloader; +Cc: grep-devel

Jeffrey Walton wrote in
<https://lists.gnu.org/archive/html/grep-devel/2020-09/msg00020.html>:

> Hi Everyone,
> 
> grep-3.4-almost.19-ff30 fails self test on Alpine Linux 3.10 with
> BusyBox, triplet x86_64-pc-linux-gnu.
> 
>   ...
>   FAIL: test-hard-locale
>   FAIL: test-setlocale_null-mt-all
> 
> Attached are config.log and test-suite.log.

The cause of these two failures is the wrong triplet: $host_os is
  - on Alpine Linux 3.10: linux-gnu,
  - on Alpine Linux 3.9 and 3.12: linux-musl.
The triplet comes from config.guess. The test there uses ldd ('ldd --version'
in particular). But on Alpine Linux 3.10 /usr/bin/ldd has been replaced with
a shell script that does not understand the --version option.

This patch fixes it. Part of it can be removed once config.guess will have been
corrected.


2020-09-19  Bruno Haible  <bruno@clisp.org>

	Fix recognition of musl libc on Alpine Linux 3.10.
	Reported by Jeffrey Walton <noloader@gmail.com> in
	<https://lists.gnu.org/archive/html/grep-devel/2020-09/msg00020.html>.
	* m4/musl.m4 (gl_MUSL_CANONICAL_HOST): New macro.
	(gl_MUSL_LIBC): Require it.
	* m4/setlocale_null.m4 (gl_FUNC_SETLOCALE_NULL): Likewise.
	* modules/setlocale-null (Files): Add m4/musl.m4.

diff --git a/m4/musl.m4 b/m4/musl.m4
index 252054c..343c71a 100644
--- a/m4/musl.m4
+++ b/m4/musl.m4
@@ -1,4 +1,4 @@
-# musl.m4 serial 1
+# musl.m4 serial 2
 dnl Copyright (C) 2019-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -9,10 +9,40 @@ dnl with or without modifications, as long as this notice is preserved.
 # <https://lists.gnu.org/archive/html/bug-gnulib/2018-02/msg00079.html>.
 # From Bruno Haible.
 
+# There are three ways to test for musl libc:
+# a. Look at the 'ldd --version' output. This is how config.guess
+#    does it. But it fails on Alpine Linux 3.10, because on this system
+#    'ldd' is a shell script that does not understand the '--version'
+#    option.
+# b. Test whether the header file <bits/alltypes.h> exists.
+# c. Test whether the header file <stdarg.h> defines the macro
+#    __DEFINED_va_list.
+# We use a+c.
+
 AC_DEFUN_ONCE([gl_MUSL_LIBC],
 [
-  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_REQUIRE([gl_MUSL_CANONICAL_HOST])
   case "$host_os" in
     *-musl*) AC_DEFINE([MUSL_LIBC], [1], [Define to 1 on musl libc.]) ;;
   esac
 ])
+
+# Like AC_CANONICAL_HOST, except for a fix regarding Alpine Linux 3.10.
+
+AC_DEFUN([gl_MUSL_CANONICAL_HOST],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  case "$host_os" in
+    linux*-gnu*)
+      AC_EGREP_CPP([actually_musl],
+        [#include <stdarg.h>
+         #ifdef __DEFINED_va_list
+          actually_musl
+         #endif
+        ],
+        [host=`echo "$host" | sed -e 's/gnu.*/musl/'`
+         host_os=`echo "$host_os" | sed -e 's/gnu.*/musl/'`
+        ])
+      ;;
+  esac
+])
diff --git a/m4/setlocale_null.m4 b/m4/setlocale_null.m4
index c1ee1f7..20c5c99 100644
--- a/m4/setlocale_null.m4
+++ b/m4/setlocale_null.m4
@@ -1,4 +1,4 @@
-# setlocale_null.m4 serial 2
+# setlocale_null.m4 serial 3
 dnl Copyright (C) 2019-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -6,7 +6,7 @@ dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_FUNC_SETLOCALE_NULL],
 [
-  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_REQUIRE([gl_MUSL_CANONICAL_HOST])
   AC_REQUIRE([gl_PTHREADLIB])
   AC_CHECK_HEADERS_ONCE([threads.h])
 
diff --git a/modules/setlocale-null b/modules/setlocale-null
index 2774004..d8c57a2 100644
--- a/modules/setlocale-null
+++ b/modules/setlocale-null
@@ -7,6 +7,7 @@ lib/setlocale_null.c
 lib/setlocale-lock.c
 lib/windows-initguard.h
 m4/setlocale_null.m4
+m4/musl.m4
 m4/threadlib.m4
 m4/visibility.m4
 



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [platform-testers] new snapshot available: grep-3.4-almost.19-ff30
  2020-09-19 13:12   ` Bruno Haible
@ 2020-09-19 14:21     ` Jeffrey Walton
  2020-09-19 19:15       ` Bruno Haible
  2020-09-20 19:28     ` Bruno Haible
  1 sibling, 1 reply; 14+ messages in thread
From: Jeffrey Walton @ 2020-09-19 14:21 UTC (permalink / raw)
  To: Bruno Haible; +Cc: bug-gnulib, grep-devel

On Sat, Sep 19, 2020 at 9:12 AM Bruno Haible <bruno@clisp.org> wrote:
>
> Jeffrey Walton wrote in
> <https://lists.gnu.org/archive/html/grep-devel/2020-09/msg00020.html>:
> >
> > grep-3.4-almost.19-ff30 fails self test on Alpine Linux 3.10 with
> > BusyBox, triplet x86_64-pc-linux-gnu.
> >
> >   ...
> >   FAIL: test-hard-locale
> >   FAIL: test-setlocale_null-mt-all
> >
> > Attached are config.log and test-suite.log.
>
> The cause of these two failures is the wrong triplet: $host_os is
>   - on Alpine Linux 3.10: linux-gnu,
>   - on Alpine Linux 3.9 and 3.12: linux-musl.
> The triplet comes from config.guess. The test there uses ldd ('ldd --version'
> in particular). But on Alpine Linux 3.10 /usr/bin/ldd has been replaced with
> a shell script that does not understand the --version option.
>
> This patch fixes it. Part of it can be removed once config.guess will have been
> corrected.

I may have contributed to the problem.

I update a package's config.guess and config.sub according to
https://www.gnu.org/software/gettext/manual/html_node/config_002eguess.html.
Each config.guess and config.sub that is found is updated.

Jeff


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [platform-testers] new snapshot available: grep-3.4-almost.19-ff30
  2020-09-19 14:21     ` Jeffrey Walton
@ 2020-09-19 19:15       ` Bruno Haible
  0 siblings, 0 replies; 14+ messages in thread
From: Bruno Haible @ 2020-09-19 19:15 UTC (permalink / raw)
  To: bug-gnulib, noloader

Jeffrey Walton wrote:
> I update a package's config.guess and config.sub according to
> https://www.gnu.org/software/gettext/manual/html_node/config_002eguess.html.
> Each config.guess and config.sub that is found is updated.

It is good to regularly update config.{guess,sub} regularly.

Here the problem was definitely in the upstream config.guess, that is mirrored
in gnulib.

Bruno



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [platform-testers] new snapshot available: grep-3.4-almost.19-ff30
  2020-09-19 13:12   ` Bruno Haible
  2020-09-19 14:21     ` Jeffrey Walton
@ 2020-09-20 19:28     ` Bruno Haible
  1 sibling, 0 replies; 14+ messages in thread
From: Bruno Haible @ 2020-09-20 19:28 UTC (permalink / raw)
  To: bug-gnulib; +Cc: noloader, grep-devel

Yesterday I wrote:
> This patch fixes it. Part of it can be removed once config.guess will have been
> corrected.

Today the config.guess is corrected to work as expected on Alpine Linux 3.10.
I have therefore reverted the override in gnulib:

2020-09-20  Bruno Haible  <bruno@clisp.org>

	Revert now-unnecessary override of config.guess on Alpine Linux 3.10.
	* m4/musl.m4: Revert 2020-09-19 patch.
	* m4/setlocale_null.m4: Likewise.
	* modules/setlocale-null: Likewise.




^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2020-09-20 19:28 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <m2imce1gpu.fsf@meyering.net>
     [not found] ` <CAH8yC8mn1YMN+fgzJBKEk9+y0qTqfO2zHbWUyO2ekVq-PimX3Q@mail.gmail.com>
2020-09-17 14:40   ` [platform-testers] new snapshot available: grep-3.4-almost.19-ff30 Jim Meyering
2020-09-17 22:46   ` Bruno Haible
2020-09-19 13:12   ` Bruno Haible
2020-09-19 14:21     ` Jeffrey Walton
2020-09-19 19:15       ` Bruno Haible
2020-09-20 19:28     ` Bruno Haible
     [not found] ` <CAH8yC8n4tmO6__C=zP0JZRmc5_ddg7L6uGAuLfjV_Bm+i3oYsA@mail.gmail.com>
2020-09-17 18:23   ` Paul Eggert
2020-09-17 20:53 ` grep-3.4-almost.19-ff30 on Solaris 10 Bruno Haible
2020-09-18  2:26   ` Paul Eggert
2020-09-18  9:01     ` Bruno Haible
2020-09-18 16:06       ` Paul Eggert
2020-09-19  0:25         ` gl_SILENT Bruno Haible
2020-09-17 21:07 ` [platform-testers] new snapshot available: grep-3.4-almost.19-ff30 Jeffrey Walton
2020-09-18 17:36   ` Paul Eggert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).