bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gawk: sigpipe1.awk:7: fatal: print to "yes | true" failed: Broken pi


From: Andrew J. Schorr
Subject: Re: gawk: sigpipe1.awk:7: fatal: print to "yes | true" failed: Broken pipe
Date: Tue, 2 Jan 2024 09:32:09 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Jan 02, 2024 at 02:16:27PM +0100, Andreas Schwab wrote:
> On Jan 02 2024, arnold@skeeve.com wrote:
> 
> > In the meantime, if that is the only problem from the test suite,
> 
> There are more races:
> 
> ============== _time =============
> --- time.ok   2023-06-14 22:13:40.000000000 +0000
> +++ _time     2023-12-28 16:04:58.299797979 +0000
> @@ -1,4 +1,4 @@
> -gettimeofday - systime = 0
> +gettimeofday - systime = 1
>  sleep(1.3) = 0
>  gettimeofday - systime = 0
>  <Feb 11 13:12:11 1990> <<Feb 11 13:12:11 1990>>
> 
> ============== _timeout =============
> --- timeout.ok        2019-08-28 18:54:15.000000000 +0000
> +++ _timeout  2023-12-31 21:53:13.488354833 +0000
> @@ -6,6 +6,5 @@
>  With timeouts and retries
>  hello
>  1 timed out; trying again
> -2 timed out; trying again
>  goodbye
>  0

This seems odd to me. The code for the first one looks like this:

   res = gettimeofday()
   st = systime()
   printf "gettimeofday - systime = %d\n", res-st

The effect of "%d" should be to round down positive values and round up
negative ones. I'm jet-lagged so probably not thinking clearly, but I'm not
seeing how this can give a result of 1.  The awk gettimeofday() call should
simply map to the gettimeofday() system call, and systime() maps to time(). 
Do you understand how we're getting a result of 1? What type of system
is this? I'd find -1 more plausible on some insanely sluggish VM.

Regards,
Andy



reply via email to

[Prev in Thread] Current Thread [Next in Thread]