From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: flitterio@gmail.com (Francis Litterio) Newsgroups: gmane.emacs.bugs Subject: bug#20935: sleep-for wakes prematurely due to process output Date: Mon, 29 Jun 2015 23:18:19 -0400 Message-ID: <87egkt3mm3.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1435634728 16145 80.91.229.3 (30 Jun 2015 03:25:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Jun 2015 03:25:28 +0000 (UTC) To: 20935@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 30 05:25:17 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z9mAe-0008Su-Ea for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Jun 2015 05:25:16 +0200 Original-Received: from localhost ([::1]:44771 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9mAd-000176-Hj for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Jun 2015 23:25:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51034) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9mAZ-00016H-AI for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 23:25:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9mAR-0004qE-K9 for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 23:25:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9mAR-0004pO-DB for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 23:25:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z9mAQ-0003Bq-Sd for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 23:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: flitterio@gmail.com (Francis Litterio) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Jun 2015 03:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 20935 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.143563466312209 (code B ref -1); Tue, 30 Jun 2015 03:25:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 30 Jun 2015 03:24:23 +0000 Original-Received: from localhost ([127.0.0.1]:33502 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9m9l-0003Ap-BW for submit@debbugs.gnu.org; Mon, 29 Jun 2015 23:24:22 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37281) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9m9i-0003Ab-8s for submit@debbugs.gnu.org; Mon, 29 Jun 2015 23:24:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9m9b-0004Mf-Ie for submit@debbugs.gnu.org; Mon, 29 Jun 2015 23:24:13 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:54311) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9m9b-0004Ma-FN for submit@debbugs.gnu.org; Mon, 29 Jun 2015 23:24:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50747) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9m9Z-0000zt-Pt for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 23:24:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9m9V-0004Gp-86 for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 23:24:09 -0400 Original-Received: from mail-ig0-x22a.google.com ([2607:f8b0:4001:c05::22a]:35579) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9m9V-0004Fi-1J for bug-gnu-emacs@gnu.org; Mon, 29 Jun 2015 23:24:05 -0400 Original-Received: by igblr2 with SMTP id lr2so66259036igb.0 for ; Mon, 29 Jun 2015 20:24:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=2F2rKY2PfVLMt98eZDo4GkAk8pK4a3GB/abtaXbGy+8=; b=pwiUofZt2x40IBd+6+wi7XU7KGJ4z0yW1erqpIMOe/vdgfCxNC/sSfZlU0SbEajT7e oUqfzVoeZyy/RGxnS2ZysncNJnA6briXGx3ty9ezp7Q+GHvYdgwlBUzUhvrJvWoqGsyK 6QMpvuhA7ZdKIbBn/GP/K+4ZJUNjamS2AH95XNsi/+b2Ac4y9jEh8hqcvv5a5sOWSqkF XSl5Oc9gZGIt8roCdW8QQGFaqIQe4e6qW6vtNYJjoU3GjUua2pdarNIlIpdvyPNWIcXl 2cWCmzt0vff1SsLlBvD3hjKNgFBcYQyFStQOtiUa1Th1DRyg25rW542LhsgCuZFHVvLo UE9w== X-Received: by 10.107.166.203 with SMTP id p194mr26508866ioe.30.1435634643095; Mon, 29 Jun 2015 20:24:03 -0700 (PDT) Original-Received: from puppy.gmail.com (216.sub-70-215-0.myvzw.com. [70.215.0.216]) by mx.google.com with ESMTPSA id f15sm29229677iof.36.2015.06.29.20.24.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2015 20:24:01 -0700 (PDT) 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:104522 Archived-At: 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 flitterio@gmail.com 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))