automake-patches
[Top][All Lists]
Advanced

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

[FYI 2/2] {test-protocols} tap/awk: account for unusual korn shell signa


From: Stefano Lattarini
Subject: [FYI 2/2] {test-protocols} tap/awk: account for unusual korn shell signal handling behaviour
Date: Wed, 28 Sep 2011 16:34:14 +0200

This change has been motivated by a testsuite failure on Debian
with the AT&T Korn Shell version 93u-1.

* lib/tap-driver.sh: Temporarily ignore some common signals when
waiting for the test command to complete, to avoid premature exit
in Korn shells that propagate to themselves signals that have
killed a child process.

See also related commit `v1.11-1342-g6321ad3'.
---
 ChangeLog         |   11 +++++++++++
 lib/tap-driver.sh |   17 +++++++++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ad6e9d6..a6779c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2011-09-28  Stefano Lattarini  <address@hidden>
 
+       tap/awk: account for unusual korn shell signal handling behaviour
+       This change has been motivated by a testsuite failure on Debian
+       with the AT&T Korn Shell version 93u-1.
+       * lib/tap-driver.sh: Temporarily ignore some common signals when
+       waiting for the test command to complete, to avoid premature exit
+       in Korn shells that propagate to themselves signals that have
+       killed a child process.
+       See also related commit `v1.11-1342-g6321ad3'.
+
+2011-09-28  Stefano Lattarini  <address@hidden>
+
        tap/awk: handle exit statuses > 256 (seen on few korn shells)
        Some Korn shells, when a child process die due to signal number
        n, can leave in $? an exit status of 256+n instead of the more
diff --git a/lib/tap-driver.sh b/lib/tap-driver.sh
index e30c803..e9f1037 100755
--- a/lib/tap-driver.sh
+++ b/lib/tap-driver.sh
@@ -116,14 +116,27 @@ else
 fi
 
 {
-  { if test $merge -gt 0; then
+  (
+    # Ignore common signals (in this subshell only!) to avoid potential
+    # problems with Korn shells.  Some Korn shells are known to propagate
+    # to themselves signals that have killed a child process they were
+    # waiting for (this is done at least for SIGINT -- and usually only
+    # for it in truth); this would cause a premature exit in this subshell,
+    # so that the awk script would never seen the exit status it expects
+    # on its last input line (and which is displayed below by the last
+    # `echo $?' command), and would thus die reporting an internal error.
+    # For more information, see the Autoconf manual and the threads:
+    # <http://lists.gnu.org/archive/html/bug-autoconf/2011-09/msg00004.html>
+    # 
<http://mail.opensolaris.org/pipermail/ksh93-integration-discuss/2009-February/004121.html>
+    trap : 1 3 2 13 15
+    if test $merge -gt 0; then
       exec 2>&1
     else
       exec 2>&3
     fi
     "$@"
     echo $?
-  } | LC_ALL=C ${AM_TAP_AWK-awk} \
+  ) | LC_ALL=C ${AM_TAP_AWK-awk} \
         -v me="$me" \
         -v test_script_name="$test_name" \
         -v log_file="$log_file" \
-- 
1.7.2.3




reply via email to

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