use inc::Module::Install 0.67;
use strict;
use warnings;
+use POSIX ();
use 5.006001; # delete this line if you want to send patches for earlier.
exit 0;
}
else {
- wait();
+ eval {
+ local $SIG{ALRM} = sub { die "timeout\n" };
+ alarm 5;
+ wait();
+ alarm 0;
+ };
+ my $exception = $@;
+
my $sig = $? & 127;
- if ($sig == 11) {
+
+# make sure process actually dies
+ $exception && kill POSIX::SIGKILL(), $pid;
+
+ if ($exception || $sig == POSIX::SIGSEGV() || $sig == POSIX::SIGABRT()
+ || $sig == 7) { # 7 == SIGBUS, haven't seen it but just in case
warn (<<EOE);
############################### WARNING #################################