Subject: bug#20935: closed (Re: bug#20935: sleep-for wakes prematurely due to process output)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 30 Jun 2015 16:12:05 +0000

Your bug report

#20935: sleep-for wakes prematurely due to process output

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
20935: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20935
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#20935: sleep-for wakes prematurely due to process output
From: Eli Zaretskii <[email-masked]>
To: Glenn Morris <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Tue, 30 Jun 2015 19:11:47 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Glenn Morris <[email-masked]>
> Date: Mon, 29 Jun 2015 23:41:18 -0400
> Cc: [email-masked]
> 
> 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.

Subject: sleep-for wakes prematurely due to process output
From: [email-masked] (Francis Litterio)
To: [email-masked]
Date: Mon, 29 Jun 2015 23:18:19 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

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, but function wait_reading_process_output in
process.c seems to be written to return prematurely when process output
is received.  Function wait_reading_process_output is used by sleep-for
to implement the wait.

To reproduce:

1. Launch Emacs with: runemacs.exe -Q

2. In buffer *scratch*, evaluate this form:

   (progn
     (start-process-shell-command "foo" "*scratch*" "sh -c 'sleep 5; echo hello; sleep 5'")
     (sleep-for 30)
     (insert "Woken from sleep-for!\n"))

3. Observe the text "Woken from sleep-for!" inserted after just 5 seconds
   instead of the expected 30 seconds.

I found this, because calls to sleep-for were not sleeping for the expected
duration when ERC was connected to an IRC server sending regular output over the
network connection.
--
Fran Litterio
[email-masked]

In GNU Emacs 25.0.50.1 (i686-pc-mingw32)
 of 2015-06-22 on PUPPY
Repository revision: 567bf811dc83d4e2a770f602fc70df0874aa02e4
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=c:/apps/emacs --without-x --without-xpm
 --without-png --without-jpeg --without-tiff --without-gif'

Configured features:
SOUND NOTIFY ACL TOOLKIT_SCROLL_BARS

Important settings:
  value of $LANG: C.ISO-8859-1
  locale-coding-system: cp1252

Major mode: Lisp Interaction

Minor modes in effect:
  diff-auto-refine-mode: t
  show-paren-mode: t
  icomplete-mode: t
  savehist-mode: t
  shell-dirtrack-mode: t
  erc-list-mode: t
  erc-menu-mode: t
  erc-ring-mode: t
  erc-networks-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-netsplit-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Recent messages:

Done
"Done"
Done
"Done"
Done
"Done"
Done
"Done"
Type "q" to delete help window.

Load-path shadows:
None found.

Features:
(shadow mail-extr emacsbug vc-git bug-reference add-log eieio-opt
speedbar sb-image ezimage dframe find-func misearch multi-isearch sort
server gnus-draft gnus-agent gnus-srvr nnvirtual nndraft nnmh gnus-msg
gnus-cite canlock gnus-art mm-uu mml2015 epg-config mm-view mml-smime
smime dig mailcap gnus-async gnus-score score-mode gnus-cache gnus-sum
fpl-moo fpl-react erc-notify erc-truncate erc-log erc-dcc help-mode
source-safe ediff-merg ediff-wind ediff-diff ediff-mult ediff-help
ediff-init ediff-util ediff grep python json ielm sgml-mode csharp-mode
cc-langs cl smtpmail sendmail nntp gnus-group gnus-undo gnus-start
gnus-cloud nnimap nnmail mail-source utf7 netrc parse-time gnus-spec
gnus-int gnus-range message rfc822 mml mml-sec mm-decode mm-bodies
mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums gmm-utils
mailheader gnus-win nnoo gnus gnus-ems nnheader mail-utils etags xref vc
vc-dispatcher dired-aux hexl smerge-mode diff-mode easy-mmode paren man
info compile apropos tramp tramp-compat tramp-loaddefs trampver advice
saveplace icomplete savehist browse-url shell warnings arc-mode
archive-mode ange-ftp mailabbrev erc-list erc-menu erc-join erc-ring
erc-networks erc-pcomplete pcomplete erc-track erc-match erc-button
wid-edit erc-fill erc-stamp erc-netsplit erc-goodies erc erc-backend
erc-compat format-spec thingatpt pp socks network-stream nsm auth-source
cl-macs cl-seq eieio byte-opt gv bytecomp byte-compile cl-extra seq
cconv eieio-core cl-loaddefs pcase cl-lib gnus-util mm-util help-fns
mail-prsvr password-cache starttls tls dired cc-mode cc-fonts easymenu
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
comint ansi-color ring calc-ext calc calc-loaddefs calc-macs time-stamp
time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel dos-w32 ls-lisp disp-table w32-win w32-vars
term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
w32notify w32 multi-tty make-network-process emacs)

Memory information:
((conses 8 358284 96911)
 (symbols 32 43211 0)
 (miscs 32 151 1146)
 (strings 16 85786 24653)
 (string-bytes 1 2690860)
 (vectors 8 38720)
 (vector-slots 4 741449 110636)
 (floats 8 445 494)
 (intervals 28 13391 1964)
 (buffers 516 29))