automake-patches
[Top][All Lists]
Advanced

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

[FYI 2/2] {prove} prove: avoid weird signal-related bug


From: Stefano Lattarini
Subject: [FYI 2/2] {prove} prove: avoid weird signal-related bug
Date: Sat, 10 Sep 2011 19:19:41 +0200

* tests/defs (trap): In the trap code dealing with SIGPIPE
signal, ignore further signals of the same kind.
See also Test::Harness issue [rt.cpan.org #70855], archived at
<https://rt.cpan.org/Ticket/Display.html?id=70855>
---
 ChangeLog  |    8 ++++++++
 tests/defs |   16 ++++++++++++----
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f4aa951..dbd588f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2011-09-10  Stefano Lattarini  <address@hidden>
 
+       prove: avoid weird signal-related bug
+       * tests/defs (trap): In the trap code dealing with SIGPIPE
+       signal, ignore further signals of the same kind.
+       See also Test::Harness issue [rt.cpan.org #70855], archived at
+       <https://rt.cpan.org/Ticket/Display.html?id=70855>
+
+2011-09-10  Stefano Lattarini  <address@hidden>
+
        tests: allow use of `prove' to run automake testsuite
        * tests/prove-runner: New helper script; mostly it wraps
        our `*.test' test scripts to make them runnable by the
diff --git a/tests/defs b/tests/defs
index d50cb39..cf6db69 100644
--- a/tests/defs
+++ b/tests/defs
@@ -944,10 +944,18 @@ if test "$sh_errexit_works" = yes; then
     echo "$me: exit $exit_status"
     exit $exit_status
   ' 0
-  for signal in 1 2 13 15; do
-    trap "fatal_ 'caught signal $signal'" $signal
-  done
-  unset signal
+  trap "fatal_ 'caught signal SIGHUP'" 1
+  trap "fatal_ 'caught signal SIGINIT'" 2
+  trap "fatal_ 'caught signal SIGTERM'" 15
+  # Ignore further SIGPIPE in the trap code.  This is required to avoid
+  # a very weird issue with some shells, at least when the execution of
+  # the automake testsuite is driven by the `prove' utility: if prove
+  # (or the make process that has spawned it) gets interrupted with
+  # Ctrl-C, the shell might go in a loop, continually getting a SIGPIPE,
+  # sometimes finally dumping core, other times hanging indefinitely.
+  # See also Test::Harness bug [rt.cpan.org #70855], archived at
+  # <https://rt.cpan.org/Ticket/Display.html?id=70855>
+  trap "trap '' 13; fatal_ 'caught signal SIGPIPE'" 13
 fi
 
 # Create and populate the temporary directory, if and as required.
-- 
1.7.2.3




reply via email to

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