From: Stefano Lattarini Date: Sat, 10 Sep 2011 17:13:20 +0000 (+0200) Subject: prove: avoid weird signal-related bug X-Git-Tag: ng-0.5a~89^2~52^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=155f00aa8af0200ee091057f222ad1fc2f6a3395;p=thirdparty%2Fautomake.git 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 --- diff --git a/ChangeLog b/ChangeLog index f4aa951c4..dbd588fee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +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 diff --git a/tests/defs b/tests/defs index d50cb393a..cf6db6924 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.