Subject: | Time-Limit-0.003 - "-group" option produces 'Argument "-TERM" isn't numeric in kill' |
Date: | Thu, 8 Jan 2015 07:09:11 -1000 |
To: | bug-Time-Limit [...] rt.cpan.org |
From: | parv [...] pair.com |
Environment:
Threaded perl here ...
# perl -v
This is perl 5, version 16, subversion 2 (v5.16.2) built for \
x86_64-linux
Copyright 1987-2012, Larry Wall
[...]
# perl -MTime::Limit -e 'print $Time::Limit::VERSION'
0.003
# uanme -a
Linux [...] 2.6.32-504.3.3.el6.x86_64 #1 \
SMP Wed Dec 17 01:55:02 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Description:
Line 47 of Time::Limit is ...
my $signal = ($counter > 1_000_000) ? 'TERM' : 'KILL';
$signal = -$signal if $opts{group};
... that causes error when C<-group> option is used from kill that
...
Argument "-TERM" isn't numeric in kill at \
/local64/perl-5.16/lib/site_perl/5.16.2/Time/Limit.pm line 50
If the situation is any clearer in perl past 5.16.2, then could
you please add perl version check in Time::Limit to be usable. Or,
please update the module to work with perl 5.16.
Reproduction:
After running for more than 2 seconds with perl 5.16.2 ...
# perl -MTime::Limit=-group,-verbose,2 \
-E 'say scalar localtime() while 1' 2>&1 | tee x
... easily notice the the error from kill via ...
# uniq x
... which, for example, was ...
Thu Jan 8 05:26:02 2015
Thu Jan 8 05:26:03 2015
Thu Jan 8 05:26:04 2015
Thu Process 21285 timed out! at -e line 0.
Sending -TERM to 21285 at -e line 0.
Argument "-TERM" isn't numeric in kill at /local64/perl-5.16/lib/site_perl/5.16.2/Time/Limit.pm line 50.
Jan 8 05:26:04 2015
Thu Jan 8 05:26:04 2015
Thu Jan 8 05:26:05 2015
Thu Jan 8 05:26:06 2015
Thu JaSending -TERM to 21285 at -e line 0.
Argument "-TERM" isn't numeric in kill at /local64/perl-5.16/lib/site_perl/5.16.2/Time/Limit.pm line 50.
n 8 05:26:06 2015
Thu Jan 8 05:26:06 2015
Thu Jan 8 05:26:07 2015
...
--