Skip Menu |

This queue is for tickets about the Time-HiRes CPAN distribution.

Report information
The Basics
Id: 87160
Status: resolved
Priority: 0/
Queue: Time-HiRes

People
Owner: Nobody in particular
Requestors: galama [...] mailfish.de
Cc:
AdminCc:

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



Subject: Time::HiRes::alarm() ignores EINVAL from setitimer()
Date: Mon, 22 Jul 2013 18:39:36 +0200
To: bug-Time-HiRes [...] rt.cpan.org
From: Anand Galama <galama [...] mailfish.de>
According to the docs, alarm() is supposed to return undef if an error occurred. This is not the case when setitimer() sets EINVAL: $ strace -e trace=setitimer,write perl -MTime::HiRes=alarm -E '$|=1; say $Time::HiRes::VERSION; say alarm(1); say alarm(3000);' >/dev/null write(1, "1.9725\n", 7) = 7 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={1, 0}}, {it_interval={0, 0}, it_value={0, 0}}) = 0 write(1, "0\n", 2) = 2 setitimer(ITIMER_REAL, {it_interval={0, 0}, it_value={18446744073709550322, 18446744073708584320}}, 0x7fff4a0a6d90) = -1 EINVAL (Invalid argument) write(1, "0\n", 2) = 2 +++ exited with 0 +++ $
From: galama [...] mailfish.de
Moreover, the setitimer() arguments are completely messed up. it_value should actually be {3000, 0}.
Fixed in Time-HiRes-1.9726, now on CPAN.