From 155f00aa8af0200ee091057f222ad1fc2f6a3395 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Sat, 10 Sep 2011 19:13:20 +0200 Subject: [PATCH] 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 --- 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 + 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 + + +2011-09-10 Stefano Lattarini + 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 + # + trap "trap '' 13; fatal_ 'caught signal SIGPIPE'" 13 fi # Create and populate the temporary directory, if and as required. -- 2.7.4