GNU bug report logs - #20935
sleep-for wakes prematurely due to process output

Previous Next

Package: emacs;

Reported by: flitterio <at> gmail.com (Francis Litterio)

Date: Tue, 30 Jun 2015 03:25:02 UTC

Severity: normal

Tags: confirmed

Merged with 15990

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#15990: closed (Bug-report: `sleep-for' doesn't sleep for
 expected period, maybe after async process invocation.)
Date: Tue, 30 Jun 2015 16:12:05 +0000
[Message part 1 (text/plain, inline)]
Your message dated Tue, 30 Jun 2015 19:11:47 +0300
with message-id <83r3ot2n24.fsf <at> gnu.org>
and subject line Re: bug#20935: sleep-for wakes prematurely due to process output
has caused the debbugs.gnu.org bug report #20935,
regarding Bug-report: `sleep-for' doesn't sleep for expected period, maybe after async process invocation.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
20935: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20935
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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)


[Message part 3 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 20935-done <at> debbugs.gnu.org, flitterio <at> gmail.com
Subject: Re: bug#20935: sleep-for wakes prematurely due to process output
Date: Tue, 30 Jun 2015 19:11:47 +0300
> From: Glenn Morris <rgm <at> gnu.org>
> Date: Mon, 29 Jun 2015 23:41:18 -0400
> Cc: 20935 <at> debbugs.gnu.org
> 
> Francis Litterio wrote:
> 
> > On Windows, using the latest sources, function sleep-for is woken
> > prematurely by process (or network connection) output.  I'm not sure if
> > this also happens on UNIX,
> 
> Yes, it's the unaddressed http://debbugs.gnu.org/15990 .

Sorry, I completely forgot about that problem (it was still in my
queue).

Now fixed in commit 3bea77f.


This bug report was last modified 10 years and 14 days ago.

Previous Next


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