Skip Menu |

This queue is for tickets about the Sys-SigAction CPAN distribution.

Report information
The Basics
Id: 75784
Status: resolved
Priority: 0/
Queue: Sys-SigAction

People
Owner: lab [...] lincolnbaxter.com.MAKE.ME.VALID
Requestors: head [...] daniel-ritter.biz
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.15
Fixed in: (no value)



Subject: Missing flag to disable use of Time::HiRes
Hello, we want to use Sys::SigAction in a perl script which performs long running tasks. Normally these tasks finish within 60 minutes. Which is also the max. allowed runtime. Our issue is that the combination of Sys::SigAction and Time::HiRes can't handle timeout values greater than 2147 well. Reason is that the conversion from seconds to microseconds results in a integer overflow for timeout values greater than 2147. Simple test script: $/usr/bin/perl -e 'use Sys::SigAction; Sys::SigAction::timeout_call(2148, sub { for $i (0 .. 100) { print $i,"\n"}}); done' Time::HiRes::ualarm(-2146967296, 0): negative time not invented yet at /usr/local/perl-5.14.2_64_3/lib/site_perl/5.14.2/Sys/SigAction.pm line 37. What's missing is a switch to disable the use of Time::HiRes in Sys::SigAction. Such a switch would trigger Sys::SigAction to use the Perl alarm() subroutine (which can handle such great values). What do you think about implementing such a switch? Technical data: Sys::SigAction-0.15 Perl 5.14.2 AIX 5.3 Best regards, Daniel Ritter
On Thu Mar 15 08:48:06 2012, https://www.google.com/accounts/o8/id?id=AItOawle7-UJid3GOTXEJL7h2jRWgNehcS8dlfA wrote: Show quoted text
> Hello, > > we want to use Sys::SigAction in a perl script which performs long > running tasks. > Normally these tasks finish within 60 minutes. Which is also the max. > allowed runtime. > Our issue is that the combination of Sys::SigAction and Time::HiRes > can't handle timeout values greater than 2147 well. > Reason is that the conversion from seconds to microseconds results in a > integer overflow for timeout values greater than 2147. > > Simple test script: > $/usr/bin/perl -e 'use Sys::SigAction; > Sys::SigAction::timeout_call(2148, sub { for $i (0 .. 100) { print > $i,"\n"}}); done' > Time::HiRes::ualarm(-2146967296, 0): negative time not invented yet at > /usr/local/perl-5.14.2_64_3/lib/site_perl/5.14.2/Sys/SigAction.pm line 37. > > What's missing is a switch to disable the use of Time::HiRes in > Sys::SigAction. Such a switch would trigger Sys::SigAction to use the > Perl alarm() subroutine (which can handle such great values). > What do you think about implementing such a switch? > > Technical data: > Sys::SigAction-0.15 > Perl 5.14.2 > AIX 5.3 > > Best regards, > > Daniel Ritter
On Sun Jul 21 19:18:45 2013, LBAXTER wrote: Show quoted text
> On Thu Mar 15 08:48:06 2012, > https://www.google.com/accounts/o8/id?id=AItOawle7- > UJid3GOTXEJL7h2jRWgNehcS8dlfA wrote:
> > Hello, > > > > we want to use Sys::SigAction in a perl script which performs long > > running tasks. > > Normally these tasks finish within 60 minutes. Which is also the
> max.
> > allowed runtime. > > Our issue is that the combination of Sys::SigAction and Time::HiRes > > can't handle timeout values greater than 2147 well. > > Reason is that the conversion from seconds to microseconds results
> in a
> > integer overflow for timeout values greater than 2147. > > > > Simple test script: > > $/usr/bin/perl -e 'use Sys::SigAction; > > Sys::SigAction::timeout_call(2148, sub { for $i (0 .. 100) { print > > $i,"\n"}}); done' > > Time::HiRes::ualarm(-2146967296, 0): negative time not invented yet
> at
> > /usr/local/perl-5.14.2_64_3/lib/site_perl/5.14.2/Sys/SigAction.pm
> line 37.
> > > > What's missing is a switch to disable the use of Time::HiRes in > > Sys::SigAction. Such a switch would trigger Sys::SigAction to use
> the
> > Perl alarm() subroutine (which can handle such great values). > > What do you think about implementing such a switch? > > > > Technical data: > > Sys::SigAction-0.15 > > Perl 5.14.2 > > AIX 5.3 > > > > Best regards, > > > > Daniel Ritter
> >
This is fixed in version 0.17. See Changes. No explicit switch was required. We just check to see if we will blow up POXIS::INT_MAX, and if so just call alarm() instead of ualarm().