From triska@gmx.at Sat Oct 4 10:58:41 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.7 required=4.0 tests=AWL,BAYES_00,FOURLA, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 4 Oct 2008 17:58:41 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m94HwbqK026716 for ; Sat, 4 Oct 2008 10:58:39 -0700 Received: from mail.gnu.org ([199.232.76.166]:41273 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1KmBMY-00045E-II for emacs-pretest-bug@gnu.org; Sat, 04 Oct 2008 13:56:18 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1KmBOj-00023R-UK for emacs-pretest-bug@gnu.org; Sat, 04 Oct 2008 13:58:35 -0400 Received: from mail.gmx.net ([213.165.64.20]:33851) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1KmBOj-00021u-D6 for emacs-pretest-bug@gnu.org; Sat, 04 Oct 2008 13:58:33 -0400 Received: (qmail invoked by alias); 04 Oct 2008 17:58:29 -0000 Received: from chello062178240212.3.14.tuwien.teleweb.at (EHLO mt-computer.local) [62.178.240.212] by mail.gmx.net (mp001) with SMTP; 04 Oct 2008 19:58:29 +0200 X-Authenticated: #4064391 X-Provags-ID: V01U2FsdGVkX19cvTI0KGVcLZMZkweNpe4sAHU6FEeZG2lGzU1hD9 211SVt/3vdkD/7 Received: by mt-computer.local (Postfix, from userid 502) id 6076AB16233; Sat, 4 Oct 2008 19:58:16 +0200 (CEST) From: Markus Triska To: emacs-pretest-bug@gnu.org Subject: 23.0.60; read-char unexpectedly halts execution of script Message-Id: <20081004175816.6076AB16233@mt-computer.local> Date: Sat, 4 Oct 2008 19:58:16 +0200 (CEST) X-Y-GMX-Trusted: 0 X-FuHaFi: 0.53 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Let filter.el consist of the forms: (defun bc-filter (proc string) (message "%s" string)) (message "starting") (setq bc (start-process "bc" nil "/usr/bin/bc")) (set-process-filter bc 'bc-filter) (while t (let ((char (read-char nil nil 0.1))) (message "char: %s" char))) Where "/usr/bin/bc" is the GNU arbitrary precision calculator. Now: mt-computer:~ mt$ emacs --script filter.el starting mt-computer:~ mt$ I expect non-termination in this case, as in eval-buffer on filter.el. In GNU Emacs 23.0.60.1 (i386-apple-darwin8.11.1, GTK+ Version 2.12.9) of 2008-09-24 on mt-computer.local Windowing system distributor `The XFree86 Project, Inc', version 11.0.40400000 Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_GB.UTF-8 value of $XMODIFIERS: nil locale-coding-system: nil default-enable-multibyte-characters: t From cyd@stupidchicken.com Mon Oct 6 12:07:18 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-3.9 required=4.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1082) by emacsbugs.donarmstrong.com; 6 Oct 2008 19:07:18 +0000 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m96J7CNA019899 for <1082@emacsbugs.donarmstrong.com>; Mon, 6 Oct 2008 12:07:13 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id 6E50957E0B6; Mon, 6 Oct 2008 15:08:44 -0400 (EDT) From: Chong Yidong To: emacs-devel@gnu.org Cc: 1082@debbugs.gnu.org Subject: Re: 23.0.60; read-char unexpectedly halts execution of script Date: Mon, 06 Oct 2008 15:08:44 -0400 Message-ID: <87hc7pr16r.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > Let filter.el consist of the forms: > > (defun bc-filter (proc string) > (message "%s" string)) > > (message "starting") > (setq bc (start-process "bc" nil "/usr/bin/bc")) > (set-process-filter bc 'bc-filter) > > (while t > (let ((char (read-char nil nil 0.1))) > (message "char: %s" char))) > > Where "/usr/bin/bc" is the GNU arbitrary precision calculator. Now: > > mt-computer:~ mt$ emacs --script filter.el > starting > mt-computer:~ mt$ > > I expect non-termination in this case, as in eval-buffer on filter.el. This broke when SYNC_INPUT became the default; it works when Emacs is recompiled without SYNC_INPUT, like Emacs 22. I don't know what the specific cause of failure is, however. Maybe the SYNC_INPUT code should only be active when Emacs is run interactively. Thoughts? From cyd@stupidchicken.com Mon Oct 6 12:33:59 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-3.9 required=4.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1082) by emacsbugs.donarmstrong.com; 6 Oct 2008 19:33:59 +0000 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m96JXuh2025808 for <1082@emacsbugs.donarmstrong.com>; Mon, 6 Oct 2008 12:33:57 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id 3D5CC57E0B6; Mon, 6 Oct 2008 15:35:28 -0400 (EDT) From: Chong Yidong To: emacs-devel@gnu.org Cc: 1082@debbugs.gnu.org Subject: Re: 23.0.60; read-char unexpectedly halts execution of script References: <87hc7pr16r.fsf@cyd.mit.edu> Date: Mon, 06 Oct 2008 15:35:28 -0400 In-Reply-To: <87hc7pr16r.fsf@cyd.mit.edu> (Chong Yidong's message of "Mon, 06 Oct 2008 15:08:44 -0400") Message-ID: <87iqs5wm7z.fsf@cyd.mit.edu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Chong Yidong writes: >> Let filter.el consist of the forms: >> >> (defun bc-filter (proc string) >> (message "%s" string)) >> >> (message "starting") >> (setq bc (start-process "bc" nil "/usr/bin/bc")) >> (set-process-filter bc 'bc-filter) >> >> (while t >> (let ((char (read-char nil nil 0.1))) >> (message "char: %s" char))) >> >> Where "/usr/bin/bc" is the GNU arbitrary precision calculator. Now: >> >> mt-computer:~ mt$ emacs --script filter.el >> starting >> mt-computer:~ mt$ >> >> I expect non-termination in this case > > This broke when SYNC_INPUT became the default. To pin it down further, this breakage seems to be due to not using SA_RESTART in the signal handler. If we set SA_RESTARTi in sysdep.c, the problem disappears. Stefan, could you comment? signal_handler_t sys_signal (int signal_number, signal_handler_t action) { struct sigaction new_action, old_action; sigemptyset (&new_action.sa_mask); new_action.sa_handler = action; #if defined (SA_RESTART) && ! defined (BROKEN_SA_RESTART) && !defined(SYNC_INPUT) /* Emacs mostly works better with restartable system services. If this flag exists, we probably want to turn it on here. However, on some systems this resets the timeout of `select' which means that `select' never finishes if it keeps getting signals. BROKEN_SA_RESTART is defined on those systems. */ /* It's not clear why the comment above says "mostly works better". --Stef When SYNC_INPUT is set, we don't want SA_RESTART because we need to poll for pending input so we need long-running syscalls to be interrupted after a signal that sets the interrupt_input_pending flag. */ new_action.sa_flags = SA_RESTART; #else new_action.sa_flags = 0; #endif sigaction (signal_number, &new_action, &old_action); return (old_action.sa_handler); } From lennart.borgman@gmail.com Mon Oct 6 12:36:41 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-7.5 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, RCVD_IN_DNSWL_LOW autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1082) by emacsbugs.donarmstrong.com; 6 Oct 2008 19:36:41 +0000 Received: from ch-smtp01.sth.basefarm.net (ch-smtp01.sth.basefarm.net [80.76.149.212]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m96JaWtv026982 for <1082@emacsbugs.donarmstrong.com>; Mon, 6 Oct 2008 12:36:34 -0700 Received: from c83-254-151-87.bredband.comhem.se ([83.254.151.87]:62603 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1KmvrU-00004z-4w; Mon, 06 Oct 2008 21:35:33 +0200 Message-ID: <48EA6855.8070800@gmail.com> Date: Mon, 06 Oct 2008 21:34:45 +0200 From: "Lennart Borgman (gmail)" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Chong Yidong , 1082@debbugs.gnu.org CC: emacs-devel@gnu.org Subject: Re: bug#1082: 23.0.60; read-char unexpectedly halts execution of script References: <87hc7pr16r.fsf@cyd.mit.edu> In-Reply-To: <87hc7pr16r.fsf@cyd.mit.edu> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 081006-0, 2008-10-06), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.151.87 X-Scan-Result: No virus found in message 1KmvrU-00004z-4w. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1KmvrU-00004z-4w 606dad796ea58413753467bb3b4ced1d Chong Yidong wrote: >> Let filter.el consist of the forms: >> >> (defun bc-filter (proc string) >> (message "%s" string)) >> >> (message "starting") >> (setq bc (start-process "bc" nil "/usr/bin/bc")) >> (set-process-filter bc 'bc-filter) >> >> (while t >> (let ((char (read-char nil nil 0.1))) >> (message "char: %s" char))) >> >> Where "/usr/bin/bc" is the GNU arbitrary precision calculator. Now: >> >> mt-computer:~ mt$ emacs --script filter.el >> starting >> mt-computer:~ mt$ >> >> I expect non-termination in this case, as in eval-buffer on filter.el. > > This broke when SYNC_INPUT became the default; it works when Emacs is > recompiled without SYNC_INPUT, like Emacs 22. > > I don't know what the specific cause of failure is, however. Maybe the > SYNC_INPUT code should only be active when Emacs is run interactively. > > Thoughts? What is the while loop supposed to do? I tested just that and I got a bit weird results. From schwab@suse.de Mon Oct 6 14:28:12 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-9.1 required=4.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1082) by emacsbugs.donarmstrong.com; 6 Oct 2008 21:28:13 +0000 Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m96LS9Ai021955 for <1082@emacsbugs.donarmstrong.com>; Mon, 6 Oct 2008 14:28:10 -0700 Received: from Relay2.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id D512D45BF1; Mon, 6 Oct 2008 23:28:07 +0200 (CEST) From: Andreas Schwab To: Chong Yidong Cc: emacs-devel@gnu.org, 1082@debbugs.gnu.org Subject: Re: 23.0.60; read-char unexpectedly halts execution of script References: <87hc7pr16r.fsf@cyd.mit.edu> X-Yow: Two with FLUFFO, hold th' BEETS..side of SOYETTES! Date: Mon, 06 Oct 2008 23:28:06 +0200 In-Reply-To: <87hc7pr16r.fsf@cyd.mit.edu> (Chong Yidong's message of "Mon, 06 Oct 2008 15:08:44 -0400") Message-ID: User-Agent: Gnus/5.110009 (No Gnus v0.9) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Chong Yidong writes: >> Let filter.el consist of the forms: >> >> (defun bc-filter (proc string) >> (message "%s" string)) >> >> (message "starting") >> (setq bc (start-process "bc" nil "/usr/bin/bc")) >> (set-process-filter bc 'bc-filter) >> >> (while t >> (let ((char (read-char nil nil 0.1))) >> (message "char: %s" char))) >> >> Where "/usr/bin/bc" is the GNU arbitrary precision calculator. Now: >> >> mt-computer:~ mt$ emacs --script filter.el >> starting >> mt-computer:~ mt$ >> >> I expect non-termination in this case, as in eval-buffer on filter.el. > > This broke when SYNC_INPUT became the default; it works when Emacs is > recompiled without SYNC_INPUT, like Emacs 22. > > I don't know what the specific cause of failure is, however. Maybe the > SYNC_INPUT code should only be active when Emacs is run interactively. > > Thoughts? In non-interactive mode we always want restartable syscalls, since keyboard input goes through stdio (SYNC_INPUT makes no difference here). I've checked in a fix. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From cyd@stupidchicken.com Mon Oct 6 14:45:55 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-3.9 required=4.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at control) by emacsbugs.donarmstrong.com; 6 Oct 2008 21:45:55 +0000 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m96LjqDO026672 for ; Mon, 6 Oct 2008 14:45:53 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id 0392857E0BB; Mon, 6 Oct 2008 17:47:24 -0400 (EDT) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 1082 Date: Mon, 06 Oct 2008 17:47:24 -0400 Message-ID: <87wsglqtub.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii close 1082 thanks From markus.triska@gmx.at Mon Oct 6 15:17:34 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.3 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1082) by emacsbugs.donarmstrong.com; 6 Oct 2008 22:17:34 +0000 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id m96MHUpc002060 for <1082@emacsbugs.donarmstrong.com>; Mon, 6 Oct 2008 15:17:32 -0700 Received: (qmail invoked by alias); 06 Oct 2008 22:17:24 -0000 Received: from chello062178240212.3.14.tuwien.teleweb.at (EHLO mt-computer.local) [62.178.240.212] by mail.gmx.net (mp024) with SMTP; 07 Oct 2008 00:17:24 +0200 X-Authenticated: #4064391 X-Provags-ID: V01U2FsdGVkX18cqOxP4w8cBDNFqpi14FQQC0jf4n9OfCdE0kWLl3 G+jYZz+264owAG Received: by mt-computer.local (Postfix, from userid 502) id 8CA94B1B684; Tue, 7 Oct 2008 00:17:02 +0200 (CEST) From: Markus Triska To: Andreas Schwab Cc: 1082@debbugs.gnu.org Subject: Re: bug#1082: 23.0.60; read-char unexpectedly halts execution of script References: <87hc7pr16r.fsf@cyd.mit.edu> Date: Tue, 07 Oct 2008 00:17:02 +0200 In-Reply-To: (Andreas Schwab's message of "Mon, 06 Oct 2008 23:28:06 +0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Y-GMX-Trusted: 0 X-FuHaFi: 0.5600000000000001 Andreas Schwab writes: > In non-interactive mode we always want restartable syscalls, since > keyboard input goes through stdio (SYNC_INPUT makes no difference here). > I've checked in a fix. Thank you, it fixes this problem for me. Could process output also be handled, as in interactive use? E.g., M-x eval-region on the forms: (defun bc-filter (proc string) (message "%s" string)) (message "starting") (setq bc (start-process "bc" nil "/usr/bin/bc")) (set-process-filter bc 'bc-filter) (while t (let ((char (read-char nil nil 0.1))) (when char (message "char: %s" char)))) processes the output of bc, and shows: starting bc 1.06 Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. Whereas in "emacs --script" mode, this output is not shown. From monnier@iro.umontreal.ca Mon Oct 6 19:10:06 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-4.0 required=4.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1082) by emacsbugs.donarmstrong.com; 7 Oct 2008 02:10:07 +0000 Received: from ironport2-out.teksavvy.com (ironport2-out.teksavvy.com [206.248.154.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m972A332026719 for <1082@emacsbugs.donarmstrong.com>; Mon, 6 Oct 2008 19:10:04 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtsEABJi6kjO+IH3/2dsb2JhbACBcbtdgWqBBw X-IronPort-AV: E=Sophos;i="4.33,370,1220241600"; d="scan'208";a="28078723" Received: from 206-248-129-247.dsl.teksavvy.com (HELO ceviche.home) ([206.248.129.247]) by ironport2-out.teksavvy.com with ESMTP; 06 Oct 2008 22:09:58 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 3C1B9B41E3; Mon, 6 Oct 2008 22:09:58 -0400 (EDT) From: Stefan Monnier To: Andreas Schwab Cc: Chong Yidong , 1082@debbugs.gnu.org, emacs-devel@gnu.org Subject: Re: 23.0.60; read-char unexpectedly halts execution of script Message-ID: References: <87hc7pr16r.fsf@cyd.mit.edu> Date: Mon, 06 Oct 2008 22:09:58 -0400 In-Reply-To: (Andreas Schwab's message of "Mon, 06 Oct 2008 23:28:06 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > In non-interactive mode we always want restartable syscalls, since > keyboard input goes through stdio (SYNC_INPUT makes no difference here). > I've checked in a fix. Thank you. Could you add a comment explaining why we test `noninteractive' at that spot, please? Stefan From unknown Fri Aug 22 01:03:32 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Tue, 04 Nov 2008 15:24:03 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator