From b0dabcd2993438c7326c44ee76da8c6bf67e8a37 Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Fri, 27 Jun 2014 11:36:17 +0200 Subject: [PATCH] set CPU limit, in case the alarm handler will be ignored, MKWS-157 --- test/bin/bomb.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/bin/bomb.pl b/test/bin/bomb.pl index 6211eab..4ce8590 100755 --- a/test/bin/bomb.pl +++ b/test/bin/bomb.pl @@ -6,6 +6,7 @@ use Getopt::Long; use POSIX ":sys_wait_h"; +use BSD::Resource qw/setrlimit/; use strict; use warnings; @@ -38,6 +39,10 @@ my @system = @ARGV; die usage if $help; die usage if !@system; +# set CPU limit, in case the alarm handler will +# be ignored +setrlimit(RLIMIT_CPU, $timeout, 2*$timeout) or die "Cannot set CPU limit: $!\n"; + # # use fork/exec instead system() # @@ -54,4 +59,3 @@ if ($pid) { else { } 1; - -- 1.7.10.4