Skip Menu |

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

Report information
The Basics
Id: 123637
Status: open
Priority: 0/
Queue: Sys-SigAction

People
Owner: lab [...] lincolnbaxter.com.MAKE.ME.VALID
Requestors: danboo [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.23
Fixed in: (no value)



Subject: Fix for Sys::SigAction::Alarm::ssa_alarm() "too big" comparison and tests
The current code does a lexical comparison, which results in errors for timeouts that are lexically before MAX_INT() but numerically after. For example a 3 hour (10800 second) timeout when compared lexically to MAX_INT()/1_000_000 (about 2147 on my system) passes the test, calls Time::HiRes::ualarm() and fails with: Time::HiRes::ualarm(-2084901888, 0): negative time not invented yet at tmp/Sys/SigAction/Alarm.pm line 20 I've created a patch and pull request on github here: https://github.com/labaxter/sys-sigaction/pull/1 This change uses the numerical comparison operator '<=' and changes the unit test to use the smallest number that is both numerically after and lexically before MAX_INT(). Thanks!
On Wed Nov 15 16:01:47 2017, DANBOO wrote: Show quoted text
> The current code does a lexical comparison, which results in errors > for timeouts that are lexically before MAX_INT() but numerically > after. For example a 3 hour (10800 second) timeout when compared > lexically to MAX_INT()/1_000_000 (about 2147 on my system) passes the > test, calls Time::HiRes::ualarm() and fails with: > > Time::HiRes::ualarm(-2084901888, 0): negative time not invented yet at > tmp/Sys/SigAction/Alarm.pm line 20 > > I've created a patch and pull request on github here: > > https://github.com/labaxter/sys-sigaction/pull/1 > > This change uses the numerical comparison operator '<=' and changes > the unit test to use the smallest number that is both numerically > after and lexically before MAX_INT(). > > Thanks!
Thanks for the patch! ... I try to work on this and get a new version out in the next week or so.