GNU bug report logs - #15990
Bug-report: `sleep-for' doesn't sleep for expected period, maybe after async process invocation.

Previous Next

Package: emacs;

Reported by: Teika Kazura <teika <at> gmx.com>

Date: Thu, 28 Nov 2013 18:56:08 UTC

Severity: normal

Tags: confirmed

Merged with 20935

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 15990 in the body.
You can then email your comments to 15990 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#15990; Package emacs. (Thu, 28 Nov 2013 18:56:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Teika Kazura <teika <at> gmx.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 28 Nov 2013 18:56:09 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Teika Kazura <teika <at> gmx.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Bug-report: `sleep-for' doesn't sleep for expected period, maybe
 after async process invocation.
Date: Thu, 28 Nov 2013 15:52:35 +0900 (JST)
Hi, Emacs developers.

* Bug description
`sleep-for' ends too early, by not sleeping for the expected time. It's speculated that it's caused by a termination of an asynchronous process. [1]

This bug does not always reproduce, but it often does.

[1] http://stackoverflow.com/questions/14698081/elisp-sleep-for-doesnt-block-when-running-a-test-in-ert

* Environment
Gentoo Linux, Emacs-24.3 and 24.1.
Debian Linux, Emacs-23.2

MacOS X, too, according to a page. [1]

* Code to reproduce the bug
Do "emacs -q" and run the code below. It uses an external Unix command "sleep".
It has a line `(sleep-for 3)', but it *often* ends immediately. The last line judges the result so that you don't need a timer watch to confirm.

As far as I tested, the bug shows 100%, but if the bug doesn't reproduce, well, please try several times, or another environment.  ;-) (With the original code where I first met this problem, the bug occurrence rate exceeds 50%.)

------------------------------------------------------------------------
(let ((buf "*sleep-for test*")
      (now (cadr (current-time))))
  (start-process "test" buf "sleep" "0.1")
  (sleep-for 3)
  (message "This should be t: %s" (< now (- (cadr (current-time)) 3))))
------------------------------------------------------------------------

* Others
The following bug report may be related. Not sure.
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6202

I think I can compile the bzr latest snapshot. (But it takes me 20 min. to compile 24.3. :P)

Thank you very much. Best regards,

Teika (Teika kazura)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15990; Package emacs. (Wed, 25 Jun 2014 22:45:03 GMT) Full text and rfc822 format available.

Message #8 received at 15990 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 15990 <at> debbugs.gnu.org
Subject: Re: bug#15990: Bug-report: `sleep-for' doesn't sleep for expected
 period, maybe after async process invocation.
Date: Wed, 25 Jun 2014 18:44:47 -0400
For the record, see also http://debbugs.gnu.org/17647#25 .




Added tag(s) confirmed. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 25 Jun 2014 23:06:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15990; Package emacs. (Wed, 25 Jun 2014 23:08:02 GMT) Full text and rfc822 format available.

Message #13 received at 15990 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 15990 <at> debbugs.gnu.org
Subject: Re: bug#15990: Bug-report: `sleep-for' doesn't sleep for expected
 period, maybe after async process invocation.
Date: Wed, 25 Jun 2014 19:07:14 -0400
Glenn Morris wrote:

> For the record, see also http://debbugs.gnu.org/17647#25 .

And also

http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00294.html




Merged 15990 20935. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 30 Jun 2015 03:40:06 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 29 Jul 2015 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 267 days ago.

Previous Next


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