bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Bruno Haible <bruno@clisp.org>, bug-gnulib@gnu.org
Cc: grep-devel@gnu.org
Subject: Re: grep-3.4-almost.19-ff30 on Solaris 10
Date: Thu, 17 Sep 2020 19:26:26 -0700	[thread overview]
Message-ID: <8bd0613b-5c4c-9c82-6310-a9cd061e9c85@cs.ucla.edu> (raw)
In-Reply-To: <1774887.AL43Kk9qlX@omega>

[-- 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


  reply	other threads:[~2020-09-18  2:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m2imce1gpu.fsf@meyering.net>
     [not found] ` <CAH8yC8n4tmO6__C=zP0JZRmc5_ddg7L6uGAuLfjV_Bm+i3oYsA@mail.gmail.com>
2020-09-17 18:23   ` [platform-testers] new snapshot available: grep-3.4-almost.19-ff30 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 [this message]
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
     [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
2020-09-19 14:21     ` Jeffrey Walton
2020-09-19 19:15       ` Bruno Haible
2020-09-20 19:28     ` Bruno Haible

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8bd0613b-5c4c-9c82-6310-a9cd061e9c85@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    --cc=grep-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).