GNU bug report logs - #19581
'sleep' return value is incorrectly rounded

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guile; Reported by: ludo@HIDDEN (Ludovic Courtès); dated Tue, 13 Jan 2015 12:59:02 UTC; Maintainer for guile is bug-guile@HIDDEN.

Message received at 19581 <at> debbugs.gnu.org:


Received: (at 19581) by debbugs.gnu.org; 27 Jun 2016 08:10:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 27 04:10:23 2016
Received: from localhost ([127.0.0.1]:57447 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bHRcd-0008Sm-47
	for submit <at> debbugs.gnu.org; Mon, 27 Jun 2016 04:10:23 -0400
Received: from pb-sasl1.pobox.com ([64.147.108.66]:63275
 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <wingo@HIDDEN>) id 1bHRcc-0008Sf-E0
 for 19581 <at> debbugs.gnu.org; Mon, 27 Jun 2016 04:10:22 -0400
Received: from sasl.smtp.pobox.com (unknown [127.0.0.1])
 by pb-sasl1.pobox.com (Postfix) with ESMTP id 13AB7206B7;
 Mon, 27 Jun 2016 04:10:22 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc
 :subject:references:date:in-reply-to:message-id:mime-version
 :content-type; s=sasl; bh=IHSo1nwFOcIGjqGiHH0e9W7eoiw=; b=a5/OeA
 ze3wa2VNusNrTvoWV+8rI+cQY67MpeVubIGqrBsXqexa5z/4KnfRxeT5ea62zD05
 a5GMBYzZOUk/bNfsW71ArSNlug0GNVhL62qa+6N+/rq3zb83HtWXIK8TMz241+8Z
 9WdMMJspmSqjJDwzgu3zWTEa1euBbaH8/0WLE=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc
 :subject:references:date:in-reply-to:message-id:mime-version
 :content-type; q=dns; s=sasl; b=RrrA0eTBJ8Q9fl+xQdyGuqHOo+VeyzjZ
 7DVw2LvkJm4DdX2CpMSTLYPDXIXcw1kfDAmRQoL7hW1y+3MxqAp9//Liq/SVPu4D
 FEMlypAUK3anfV9NIhMPVm67sStK0z0XwcBRewA21/wToN4SBzPHK4Bo/fGaQKIv
 q2O+tbSnXpg=
Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1])
 by pb-sasl1.pobox.com (Postfix) with ESMTP id 0A41E206B6;
 Mon, 27 Jun 2016 04:10:22 -0400 (EDT)
Received: from clucks (unknown [88.160.190.192])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by pb-sasl1.pobox.com (Postfix) with ESMTPSA id 27264206B4;
 Mon, 27 Jun 2016 04:10:21 -0400 (EDT)
From: Andy Wingo <wingo@HIDDEN>
To: Arne Babenhauserheide <arne_bab@HIDDEN>
Subject: Re: [PATCH] Allow giving floating point values to (sleep).
References: <8c8510a889e2d3b9f57f.1463767657@HIDDEN>
 <871t3j3a44.fsf@HIDDEN>
Date: Mon, 27 Jun 2016 10:10:13 +0200
In-Reply-To: <871t3j3a44.fsf@HIDDEN> (Arne Babenhauserheide's message of "Sun, 
 26 Jun 2016 23:37:15 +0200")
Message-ID: <87mvm7832y.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Pobox-Relay-ID: 97D6265E-3C3E-11E6-ACCA-C1836462E9F6-02397024!pb-sasl1.pobox.com
X-Spam-Score: -1.0 (-)
X-Debbugs-Envelope-To: 19581
Cc: guile-devel@HIDDEN, arne.babenhauserheide@HIDDEN, 19581 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Sun 26 Jun 2016 23:37, Arne Babenhauserheide <arne_bab@HIDDEN> writes:

> ping?

Let's follow up on bug #19581.

Thanks,

Andy




Information forwarded to bug-guile@HIDDEN:
bug#19581; Package guile. Full text available.

Message received at 19581 <at> debbugs.gnu.org:


Received: (at 19581) by debbugs.gnu.org; 23 Jun 2016 13:09:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 23 09:09:35 2016
Received: from localhost ([127.0.0.1]:51926 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bG4Nz-00016z-DK
	for submit <at> debbugs.gnu.org; Thu, 23 Jun 2016 09:09:35 -0400
Received: from eggs.gnu.org ([208.118.235.92]:45904)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1bG4Nx-00016m-K6
 for 19581 <at> debbugs.gnu.org; Thu, 23 Jun 2016 09:09:33 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ludo@HIDDEN>) id 1bG4Np-0004B2-98
 for 19581 <at> debbugs.gnu.org; Thu, 23 Jun 2016 09:09:28 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35195)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1bG4Np-0004Ay-5M; Thu, 23 Jun 2016 09:09:25 -0400
Received: from pluto.bordeaux.inria.fr ([193.50.110.57]:52118 helo=pluto)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1bG4No-0006YT-Fb; Thu, 23 Jun 2016 09:09:24 -0400
From: ludo@HIDDEN (Ludovic =?utf-8?Q?Court=C3=A8s?=)
To: Andy Wingo <wingo@HIDDEN>
Subject: Re: bug#19581: 'sleep' return value is incorrectly rounded
References: <87a91mkfc3.fsf@HIDDEN> <87shw4p9ai.fsf@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 6 Messidor an 224 de la =?utf-8?Q?R=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-unknown-linux-gnu
Date: Thu, 23 Jun 2016 15:09:22 +0200
In-Reply-To: <87shw4p9ai.fsf@HIDDEN> (Andy Wingo's message of "Thu, 23 Jun
 2016 11:02:45 +0200")
Message-ID: <87fus4oxvh.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -6.4 (------)
X-Debbugs-Envelope-To: 19581
Cc: 19581 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.4 (------)

Hello,

Andy Wingo <wingo@HIDDEN> skribis:

> On Tue 13 Jan 2015 13:58, ludo@HIDDEN (Ludovic Court=C3=A8s) writes:
>
>> I just noticed that =E2=80=98sleep=E2=80=99 essentially always rounds do=
wn its return
>> value, which makes it unreliable, as in this example:
>>
>> $ time guile -c '(sigaction SIGINT +) (call-with-new-thread (lambda () (=
let loop () (kill (getpid) SIGINT) (loop)))) (let loop ((n 3)) (when (> n 0=
) (loop (sleep (pk "s" n)))))'
>>
>> ;;; ("s" 3)
>>
>> ;;; ("s" 2)
>>
>> ;;; ("s" 1)
>>
>> real	0m0.039s
>> user	0m0.052s
>> sys	0m0.017s
>>
>> Here =E2=80=98loop=E2=80=99 is meant to assure we sleep for roughly 3 se=
conds, but
>> because of the incorrect rounding, we end up not sleeping at all.
>
> Hummmmmmmmmm.
>
> I don't think we can change anything in 2.0.  Right?
>
> In master, how about (1) we allow sleep to take any real number, in
> seconds; (2) sleep returns an inexact real number.  Then we can
> deprecate usleep and "standardize" on sleeping in units of seconds.
> Internally we refactor scm_std_usleep/* to take a 64-bit double for the
> number of seconds to sleep and return a double for the time remaining.

Sounds like a plan.  There could be programs that will break if =E2=80=98sl=
eep=E2=80=99
gives them an inexact instead of an integer.  Maybe we can assume this
is an unlikely situation, though.

Thoughts?

Ludo=E2=80=99.




Information forwarded to bug-guile@HIDDEN:
bug#19581; Package guile. Full text available.

Message received at 19581 <at> debbugs.gnu.org:


Received: (at 19581) by debbugs.gnu.org; 23 Jun 2016 09:02:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 23 05:02:56 2016
Received: from localhost ([127.0.0.1]:51777 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bG0XI-0000NA-Hi
	for submit <at> debbugs.gnu.org; Thu, 23 Jun 2016 05:02:56 -0400
Received: from pb-sasl1.pobox.com ([64.147.108.66]:54974
 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <wingo@HIDDEN>) id 1bG0XH-0000N3-LT
 for 19581 <at> debbugs.gnu.org; Thu, 23 Jun 2016 05:02:55 -0400
Received: from sasl.smtp.pobox.com (unknown [127.0.0.1])
 by pb-sasl1.pobox.com (Postfix) with ESMTP id 28AD920723;
 Thu, 23 Jun 2016 05:02:53 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc
 :subject:references:date:in-reply-to:message-id:mime-version
 :content-type:content-transfer-encoding; s=sasl; bh=/pflHFfB+fqo
 tTs2B3bhdJNo1R4=; b=cakfC/gelNU3Rc7Kj2fsznbPKRyU89E7bEMddSX/FxN1
 yA4NOo1oWfIe/064ycVN30ovkkpB9Yq3PVooUHL69eQIKh1xvDaKuF787uM3Qey/
 q2SKIwAsvB5Fu6S7n34Vn9V3g9HeV3dD+nX6jS10//V6vGQw6ekr205jimDhOnk=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc
 :subject:references:date:in-reply-to:message-id:mime-version
 :content-type:content-transfer-encoding; q=dns; s=sasl; b=KU6J3c
 9I6qmOhPwOSDGfJ3JxPeC1PCzWuQRiayx6q4ljmiWpx3oXPiIPt6J5AiRv27rN4Z
 EEPxo5HnDK75ZuwFdN9u/6Uq1MzF1tlL0n8WBth96mg561i9+UPe/mCXvRGwfO4J
 eRTlTBlddfLtMRdYQ/MG1OeKqaUpxKXI/fayI=
Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1])
 by pb-sasl1.pobox.com (Postfix) with ESMTP id 2082720721;
 Thu, 23 Jun 2016 05:02:53 -0400 (EDT)
Received: from clucks (unknown [88.160.190.192])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by pb-sasl1.pobox.com (Postfix) with ESMTPSA id 693E320720;
 Thu, 23 Jun 2016 05:02:52 -0400 (EDT)
From: Andy Wingo <wingo@HIDDEN>
To: ludo@HIDDEN (Ludovic =?utf-8?Q?Court=C3=A8s?=)
Subject: Re: bug#19581: 'sleep' return value is incorrectly rounded
References: <87a91mkfc3.fsf@HIDDEN>
Date: Thu, 23 Jun 2016 11:02:45 +0200
In-Reply-To: <87a91mkfc3.fsf@HIDDEN> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?=
 =?utf-8?Q?s?= message of "Tue, 13 Jan 2015 13:58:04 +0100")
Message-ID: <87shw4p9ai.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Pobox-Relay-ID: 4464AED4-3921-11E6-BAB6-C1836462E9F6-02397024!pb-sasl1.pobox.com
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: 19581
Cc: 19581 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.4 (-)

Hi :)

On Tue 13 Jan 2015 13:58, ludo@HIDDEN (Ludovic Court=C3=A8s) writes:

> I just noticed that =E2=80=98sleep=E2=80=99 essentially always rounds dow=
n its return
> value, which makes it unreliable, as in this example:
>
> $ time guile -c '(sigaction SIGINT +) (call-with-new-thread (lambda () (l=
et loop () (kill (getpid) SIGINT) (loop)))) (let loop ((n 3)) (when (> n 0)=
 (loop (sleep (pk "s" n)))))'
>
> ;;; ("s" 3)
>
> ;;; ("s" 2)
>
> ;;; ("s" 1)
>
> real	0m0.039s
> user	0m0.052s
> sys	0m0.017s
>
> Here =E2=80=98loop=E2=80=99 is meant to assure we sleep for roughly 3 sec=
onds, but
> because of the incorrect rounding, we end up not sleeping at all.

Hummmmmmmmmm.

I don't think we can change anything in 2.0.  Right?

In master, how about (1) we allow sleep to take any real number, in
seconds; (2) sleep returns an inexact real number.  Then we can
deprecate usleep and "standardize" on sleeping in units of seconds.
Internally we refactor scm_std_usleep/* to take a 64-bit double for the
number of seconds to sleep and return a double for the time remaining.

WDYT?

Andy




Information forwarded to bug-guile@HIDDEN:
bug#19581; Package guile. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 13 Jan 2015 12:58:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 13 07:58:21 2015
Received: from localhost ([127.0.0.1]:55040 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YB136-0007f3-Kh
	for submit <at> debbugs.gnu.org; Tue, 13 Jan 2015 07:58:21 -0500
Received: from eggs.gnu.org ([208.118.235.92]:57877)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <ludo@HIDDEN>) id 1YB133-0007el-Pe
 for submit <at> debbugs.gnu.org; Tue, 13 Jan 2015 07:58:18 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ludo@HIDDEN>) id 1YB12x-0000Bf-Ly
 for submit <at> debbugs.gnu.org; Tue, 13 Jan 2015 07:58:12 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:53667)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1YB12x-0000Bb-J8
 for submit <at> debbugs.gnu.org; Tue, 13 Jan 2015 07:58:11 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:59598)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <ludo@HIDDEN>) id 1YB12w-0006x6-NX
 for bug-guile@HIDDEN; Tue, 13 Jan 2015 07:58:11 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ludo@HIDDEN>) id 1YB12s-0000Ak-O2
 for bug-guile@HIDDEN; Tue, 13 Jan 2015 07:58:10 -0500
Received: from hera.aquilenet.fr ([2a01:474::1]:38420)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1YB12s-0000AU-Gk
 for bug-guile@HIDDEN; Tue, 13 Jan 2015 07:58:06 -0500
Received: from localhost (localhost [127.0.0.1])
 by hera.aquilenet.fr (Postfix) with ESMTP id 2A8EE44A1
 for <bug-guile@HIDDEN>; Tue, 13 Jan 2015 13:58:05 +0100 (CET)
Received: from hera.aquilenet.fr ([127.0.0.1])
 by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id gNlxFwyNRCEq for <bug-guile@HIDDEN>;
 Tue, 13 Jan 2015 13:58:05 +0100 (CET)
Received: from pluto (pluto.bordeaux.inria.fr [193.50.110.57])
 by hera.aquilenet.fr (Postfix) with ESMTPSA id EE2224495
 for <bug-guile@HIDDEN>; Tue, 13 Jan 2015 13:58:04 +0100 (CET)
From: ludo@HIDDEN (Ludovic =?utf-8?Q?Court=C3=A8s?=)
To: bug-guile@HIDDEN
Subject: 'sleep' return value is incorrectly rounded
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 24 =?utf-8?Q?Niv=C3=B4se?= an 223 de la =?utf-8?Q?R?=
 =?utf-8?Q?=C3=A9volution?=
X-PGP-Key-ID: 0xEA52ECF4
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA  D15D 77DD 95E2 EA52 ECF4
X-OS: x86_64-unknown-linux-gnu
Date: Tue, 13 Jan 2015 13:58:04 +0100
Message-ID: <87a91mkfc3.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

I just noticed that =E2=80=98sleep=E2=80=99 essentially always rounds down =
its return
value, which makes it unreliable, as in this example:

--8<---------------cut here---------------start------------->8---
$ time guile -c '(sigaction SIGINT +) (call-with-new-thread (lambda () (let=
 loop () (kill (getpid) SIGINT) (loop)))) (let loop ((n 3)) (when (> n 0) (=
loop (sleep (pk "s" n)))))'

;;; ("s" 3)

;;; ("s" 2)

;;; ("s" 1)

real	0m0.039s
user	0m0.052s
sys	0m0.017s
--8<---------------cut here---------------end--------------->8---

Here =E2=80=98loop=E2=80=99 is meant to assure we sleep for roughly 3 secon=
ds, but
because of the incorrect rounding, we end up not sleeping at all.

Ludo=E2=80=99.




Acknowledgement sent to ludo@HIDDEN (Ludovic Courtès):
New bug report received and forwarded. Copy sent to bug-guile@HIDDEN. Full text available.
Report forwarded to bug-guile@HIDDEN:
bug#19581; Package guile. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

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