GNU bug report logs - #77535
timeout treats very short durations as `0`

Previous Next

Package: coreutils;

Reported by: Nicolas Boichat <nicolas <at> boichat.ch>

Date: Fri, 4 Apr 2025 16:13:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Pádraig Brady <P <at> draigBrady.com>
Cc: 77535 <at> debbugs.gnu.org, nicolas <at> boichat.ch
Subject: bug#77535: timeout treats very short durations as `0`
Date: Mon, 7 Apr 2025 01:08:43 -0700
[Message part 1 (text/plain, inline)]
On 2025-04-05 13:56, Pádraig Brady wrote:
> I'm going to apply the attached later to remove the libm dependency.
> It's just too much of a dependency for minimal functionality.

Thanks, agreed about the dependency. Still, 'timeout' (and, now that I 
think about it, 'sleep' and 'tail') should always wait for at least the 
time requested.

After thinking about it I installed the attached further patch, which 
addresses the problem in a different way without needing libm on 
GNU/Linux. Although we could tighten the bounds further in typical cases 
(by using the algorithm 'date' uses to parse seconds, if the string is 
of that form) I tried to keep it simple, as the main point is to not 
sleep for less than the time requested.

Floating point can be such a pain sometimes, even for simple things. 
(Read the cited paper and see....)
[0001-timeout-don-t-sleep-less-than-requested.patch (text/x-patch, attachment)]

This bug report was last modified 42 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.