Subject: bug#21061: coreutils-8.24 - Partially reproducible failures of tests/misc/timeout-parameters.sh

From: Pádraig Brady <[email-masked]>
Date: Fri, 17 Jul 2015 09:56:07 +0100

On 17/07/15 04:21, Peter Bray wrote:
> On 16/07/15 05:56 PM, Pádraig Brady wrote:
>> for i in $(seq 20); do time gtimeout 2.34e+5d sleep inf; done
> 
> gtimeout 2.34e+5d gsleep inf  0.00s user 0.00s system 0% cpu 0.015 total
> gtimeout 2.34e+5d gsleep inf  0.00s user 0.00s system 0% cpu 0.009 total
> gtimeout 2.34e+5d gsleep inf  0.00s user 0.00s system 0% cpu 0.010 total
> gtimeout 2.34e+5d gsleep inf  0.00s user 0.00s system 0% cpu 0.010 total
> gtimeout 2.34e+5d gsleep inf  0.00s user 0.00s system 0% cpu 0.010 total
> gtimeout 2.34e+5d gsleep inf  0.00s user 0.00s system 0% cpu 0.010 total
> gtimeout 2.34e+5d gsleep inf  0.00s user 0.00s system 0% cpu 0.010 total
> gtimeout 2.34e+5d gsleep inf  0.00s user 0.00s system 0% cpu 0.010 total
> gtimeout 2.34e+5d gsleep inf  0.00s user 0.00s system 0% cpu 0.010 total
> gtimeout 2.34e+5d gsleep inf  0.00s user 0.00s system 0% cpu 0.010 total
> gtimeout 2.34e+5d gsleep inf  0.00s user 0.00s system 0% cpu 0.010 total
> gtimeout 2.34e+5d gsleep inf  0.00s user 0.00s system 0% cpu 0.010 total
> gtimeout 2.34e+5d gsleep inf  0.00s user 0.00s system 0% cpu 0.010 total
> gtimeout 2.34e+5d gsleep inf  0.00s user 0.00s system 0% cpu 0.010 total
> gtimeout 2.34e+5d gsleep inf  0.00s user 0.00s system 0% cpu 0.010 total
> gtimeout 2.34e+5d gsleep inf  0.00s user 0.00s system 0% cpu 0.010 total
> gtimeout 2.34e+5d gsleep inf  0.00s user 0.00s system 0% cpu 0.010 total
> gtimeout 2.34e+5d gsleep inf  0.00s user 0.00s system 0% cpu 0.010 total
> gtimeout 2.34e+5d gsleep inf  0.00s user 0.00s system 0% cpu 0.010 total
> gtimeout 2.34e+5d gsleep inf  0.00s user 0.00s system 0% cpu 0.010 total
> 
> Sorry, I didn't make that clear, when the command works (like it does 
> mostly on 64-bit on 64-bit systems, as I poorly conveyed in the last 
> post) it never returns and it returns "immediately" on the failure, 
> which (as the above shows) was 20 out of 20 test cases.

Is there ever a failure with non maximal values?
For example is there ever an early return with:

  while true; do time gtimeout 0.1 sleep inf; test $? != 124 && break; done

I'm guessing not, and the kernel is having rounding issues?
Do you still get the problem if you change the clock in timeout.c
from CLOCK_REALTIME to say CLOCK_MONOTONIC?

cheers,
Pádraig.