From unknown Sat Aug 09 13:14:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#20935: sleep-for wakes prematurely due to process output 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: To: 20935@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.143563466312209 (code B ref -1); Tue, 30 Jun 2015 03:25:02 +0000 Received: (at submit) by debbugs.gnu.org; 30 Jun 2015 03:24:23 +0000 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 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 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 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 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 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) 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) From: flitterio@gmail.com (Francis Litterio) Date: Mon, 29 Jun 2015 23:18:19 -0400 Message-ID: <87egkt3mm3.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain 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-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) 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)) From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 29 23:39:30 2015 Received: (at control) by debbugs.gnu.org; 30 Jun 2015 03:39:30 +0000 Received: from localhost ([127.0.0.1]:33510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9mOP-0003Ww-V6 for submit@debbugs.gnu.org; Mon, 29 Jun 2015 23:39:30 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42624) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9mON-0003Wk-QK for control@debbugs.gnu.org; Mon, 29 Jun 2015 23:39:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9mOH-0004NF-Gv for control@debbugs.gnu.org; Mon, 29 Jun 2015 23:39:22 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33645) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9mOH-0004N9-Bx for control@debbugs.gnu.org; Mon, 29 Jun 2015 23:39:21 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1Z9mOG-00078B-EH for control@debbugs.gnu.org; Mon, 29 Jun 2015 23:39:20 -0400 Subject: control message for bug 20935 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Mon, 29 Jun 2015 23:39:20 -0400 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.6 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.6 (-----) merge 15990 20935 From unknown Sat Aug 09 13:14:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#20935: sleep-for wakes prematurely due to process output Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Jun 2015 03:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20935 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed To: flitterio@gmail.com (Francis Litterio) Cc: 20935@debbugs.gnu.org Received: via spool by 20935-submit@debbugs.gnu.org id=B20935.143563569213791 (code B ref 20935); Tue, 30 Jun 2015 03:42:02 +0000 Received: (at 20935) by debbugs.gnu.org; 30 Jun 2015 03:41:32 +0000 Received: from localhost ([127.0.0.1]:33514 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9mQN-0003aM-LI for submit@debbugs.gnu.org; Mon, 29 Jun 2015 23:41:31 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43310) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9mQK-0003a7-TN for 20935@debbugs.gnu.org; Mon, 29 Jun 2015 23:41:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9mQE-0005vv-7M for 20935@debbugs.gnu.org; Mon, 29 Jun 2015 23:41:23 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33676) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9mQB-0005uu-6k; Mon, 29 Jun 2015 23:41:19 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1Z9mQA-0007iA-Jc; Mon, 29 Jun 2015 23:41:18 -0400 From: Glenn Morris References: <87egkt3mm3.fsf@gmail.com> X-Spook: Ruby Ridge bank AMW Telecommunications kilo class mania X-Ran: ;<;9#^!`&y/*f;Rj+[kLo_X+aoc=@]Bbsi78WVQ4O=7dD/d2GrDrC/kE%hNdpiTm1jJVN< X-Hue: yellow X-Attribution: GM Date: Mon, 29 Jun 2015 23:41:18 -0400 In-Reply-To: <87egkt3mm3.fsf@gmail.com> (Francis Litterio's message of "Mon, 29 Jun 2015 23:18:19 -0400") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.6 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.6 (-----) 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 . From unknown Sat Aug 09 13:14:21 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: flitterio@gmail.com (Francis Litterio) Subject: bug#20935: closed (Re: bug#20935: sleep-for wakes prematurely due to process output) Message-ID: References: <83r3ot2n24.fsf@gnu.org> <87egkt3mm3.fsf@gmail.com> X-Gnu-PR-Message: they-closed 20935 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: confirmed Reply-To: 20935@debbugs.gnu.org Date: Tue, 30 Jun 2015 16:12:05 +0000 Content-Type: multipart/mixed; boundary="----------=_1435680725-1759-1" This is a multi-part message in MIME format... ------------=_1435680725-1759-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 20935@debbugs.gnu.org. --=20 20935: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D20935 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1435680725-1759-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 20935-done) by debbugs.gnu.org; 30 Jun 2015 16:11:55 +0000 Received: from localhost ([127.0.0.1]:34665 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9y8Z-0000RW-0F for submit@debbugs.gnu.org; Tue, 30 Jun 2015 12:11:55 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:46145) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9y8W-0000RC-19 for 20935-done@debbugs.gnu.org; Tue, 30 Jun 2015 12:11:52 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NQR00E00M8WQ100@a-mtaout22.012.net.il> for 20935-done@debbugs.gnu.org; Tue, 30 Jun 2015 19:11:44 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NQR00E8DMBIKL70@a-mtaout22.012.net.il>; Tue, 30 Jun 2015 19:11:44 +0300 (IDT) Date: Tue, 30 Jun 2015 19:11:47 +0300 From: Eli Zaretskii Subject: Re: bug#20935: sleep-for wakes prematurely due to process output In-reply-to: X-012-Sender: halo1@inter.net.il To: Glenn Morris Message-id: <83r3ot2n24.fsf@gnu.org> References: <87egkt3mm3.fsf@gmail.com> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 20935-done Cc: 20935-done@debbugs.gnu.org, flitterio@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Glenn Morris > Date: Mon, 29 Jun 2015 23:41:18 -0400 > Cc: 20935@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. ------------=_1435680725-1759-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 30 Jun 2015 03:24:23 +0000 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 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 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 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 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 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) 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) From: flitterio@gmail.com (Francis Litterio) To: bug-gnu-emacs@gnu.org Subject: sleep-for wakes prematurely due to process output Date: Mon, 29 Jun 2015 23:18:19 -0400 Message-ID: <87egkt3mm3.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain 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-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) 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)) ------------=_1435680725-1759-1-- From unknown Sat Aug 09 13:14:21 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Teika Kazura Subject: bug#15990: closed (Re: bug#20935: sleep-for wakes prematurely due to process output) Message-ID: References: <83r3ot2n24.fsf@gnu.org> <20131128.155235.791210082742871046.teika@gmx.com> X-Gnu-PR-Message: they-closed 15990 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: confirmed Reply-To: 15990@debbugs.gnu.org Date: Tue, 30 Jun 2015 16:12:06 +0000 Content-Type: multipart/mixed; boundary="----------=_1435680726-1759-3" This is a multi-part message in MIME format... ------------=_1435680726-1759-3 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #20935: Bug-report: `sleep-for' doesn't sleep for expected period, maybe af= ter async process invocation. 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 15990@debbugs.gnu.org. --=20 20935: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D20935 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1435680726-1759-3 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 20935-done) by debbugs.gnu.org; 30 Jun 2015 16:11:55 +0000 Received: from localhost ([127.0.0.1]:34665 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9y8Z-0000RW-0F for submit@debbugs.gnu.org; Tue, 30 Jun 2015 12:11:55 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:46145) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z9y8W-0000RC-19 for 20935-done@debbugs.gnu.org; Tue, 30 Jun 2015 12:11:52 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NQR00E00M8WQ100@a-mtaout22.012.net.il> for 20935-done@debbugs.gnu.org; Tue, 30 Jun 2015 19:11:44 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NQR00E8DMBIKL70@a-mtaout22.012.net.il>; Tue, 30 Jun 2015 19:11:44 +0300 (IDT) Date: Tue, 30 Jun 2015 19:11:47 +0300 From: Eli Zaretskii Subject: Re: bug#20935: sleep-for wakes prematurely due to process output In-reply-to: X-012-Sender: halo1@inter.net.il To: Glenn Morris Message-id: <83r3ot2n24.fsf@gnu.org> References: <87egkt3mm3.fsf@gmail.com> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 20935-done Cc: 20935-done@debbugs.gnu.org, flitterio@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Glenn Morris > Date: Mon, 29 Jun 2015 23:41:18 -0400 > Cc: 20935@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. ------------=_1435680726-1759-3 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 28 Nov 2013 18:55:32 +0000 Received: from localhost ([127.0.0.1]:49107 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vm6kM-0008Eg-SS for submit@debbugs.gnu.org; Thu, 28 Nov 2013 13:55:31 -0500 Received: from eggs.gnu.org ([208.118.235.92]:43478) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VlvTO-0005ow-2m for submit@debbugs.gnu.org; Thu, 28 Nov 2013 01:53:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VlvTC-0007i3-TD for submit@debbugs.gnu.org; Thu, 28 Nov 2013 01:53:08 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:44260) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlvTC-0007hz-Qh for submit@debbugs.gnu.org; Thu, 28 Nov 2013 01:53:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45186) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlvT7-00039N-EG for bug-gnu-emacs@gnu.org; Thu, 28 Nov 2013 01:53:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VlvT2-0007cn-4H for bug-gnu-emacs@gnu.org; Thu, 28 Nov 2013 01:52:57 -0500 Received: from mout.gmx.net ([212.227.15.18]:61996) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlvT1-0007c7-Qr for bug-gnu-emacs@gnu.org; Thu, 28 Nov 2013 01:52:52 -0500 Received: from localhost ([123.222.73.56]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0Lskr7-1VfLz71Wh7-012J94 for ; Thu, 28 Nov 2013 07:52:49 +0100 Date: Thu, 28 Nov 2013 15:52:35 +0900 (JST) Message-Id: <20131128.155235.791210082742871046.teika@gmx.com> To: bug-gnu-emacs@gnu.org Subject: Bug-report: `sleep-for' doesn't sleep for expected period, maybe after async process invocation. From: Teika Kazura Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:GOv4EKmQUgfV0R95y4CGwidTm0l9n9qWP27Ql2v12JCJ2tkqgeg UGCd3s2WxZR7cLnme/FM2X8VL5BDXyrva4ToBg4vi7IW70RX05DJwhp1agdq6Rm/qWhcfpp pbI8PuWzdrrsUEWvef4ZGf8c34OlAWxlUQYsowvBWtDOuUjuIZ3Dyso/U6m0aCvOjRbrONl GvehOSz24/NzaEOqY5nQw== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 28 Nov 2013 13:55:28 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) 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) ------------=_1435680726-1759-3--