all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Teika Kazura <teika@gmx.com>
To: 15990@debbugs.gnu.org
Subject: bug#15990: 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)	[thread overview]
Message-ID: <20131128.155235.791210082742871046.teika@gmx.com> (raw)

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)





             reply	other threads:[~2013-11-28  6:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-28  6:52 Teika Kazura [this message]
2014-06-25 22:44 ` bug#15990: Bug-report: `sleep-for' doesn't sleep for expected period, maybe after async process invocation Glenn Morris
2014-06-25 23:07   ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131128.155235.791210082742871046.teika@gmx.com \
    --to=teika@gmx.com \
    --cc=15990@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.