From unknown Mon Jun 23 04:09:16 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#12447 <12447@debbugs.gnu.org> To: bug#12447 <12447@debbugs.gnu.org> Subject: Status: 24.1.50; Stuck in garbage collection on OS X Reply-To: bug#12447 <12447@debbugs.gnu.org> Date: Mon, 23 Jun 2025 11:09:16 +0000 retitle 12447 24.1.50; Stuck in garbage collection on OS X reassign 12447 emacs submitter 12447 Harald Hanche-Olsen severity 12447 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 14 17:09:33 2012 Received: (at submit) by debbugs.gnu.org; 14 Sep 2012 21:09:33 +0000 Received: from localhost ([127.0.0.1]:34332 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCd8m-0004Ci-Li for submit@debbugs.gnu.org; Fri, 14 Sep 2012 17:09:32 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38219) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCd8k-0004Cb-8G for submit@debbugs.gnu.org; Fri, 14 Sep 2012 17:09:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCd7l-0005aa-RC for submit@debbugs.gnu.org; Fri, 14 Sep 2012 17:08:30 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:53191) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCd7l-0005aW-Ng for submit@debbugs.gnu.org; Fri, 14 Sep 2012 17:08:29 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58094) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCd7k-0000oY-KV for bug-gnu-emacs@gnu.org; Fri, 14 Sep 2012 17:08:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCd7i-0005WA-Ul for bug-gnu-emacs@gnu.org; Fri, 14 Sep 2012 17:08:28 -0400 Received: from hylle02.itea.ntnu.no ([129.241.56.101]:48150) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCd7i-0005TL-K4 for bug-gnu-emacs@gnu.org; Fri, 14 Sep 2012 17:08:26 -0400 Received: from localhost (localhost [127.0.0.1]) by hylle02.itea.ntnu.no (Postfix) with ESMTP id 84B982C05E for ; Fri, 14 Sep 2012 23:08:24 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at hylle02.itea.ntnu.no Received: from anne.math.ntnu.no (anne.math.ntnu.no [129.241.15.150]) by hylle02.itea.ntnu.no (Postfix) with SMTP id 27DF32C05D for ; Fri, 14 Sep 2012 23:08:23 +0200 (CEST) Received: (qmail 18840 invoked from network); 14 Sep 2012 21:08:23 -0000 Received: from gauss.math.ntnu.no (HELO localhost) (hanche@129.241.15.58) by anne.math.ntnu.no with ESMTPA; 14 Sep 2012 21:08:23 -0000 Date: Fri, 14 Sep 2012 23:08:19 +0200 (CEST) Message-Id: <20120914.230819.731988138196046556.hanche@math.ntnu.no> To: bug-gnu-emacs@gnu.org Subject: 24.1.50; Stuck in garbage collection on OS X From: Harald Hanche-Olsen X-URL: http://www.math.ntnu.no/~hanche/ X-Mailer: Mew version 6.5 on Emacs 24.1.50 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: submit Cc: jan.h.d@swipnet.se X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) This concerns emacs built with --with-ns from trunk on OS X. To start with the symptom: Emacs seems to freeze, and spends a lot of CPU time. Taking a sample with Activity monitor appears to indicate a very deeply nested mark_object calls; from this I conclude that the problem appears to happen in GC. How to trigger the symptom: I always got it by trying to send an email message with a large attachment. My mail client of choice is Mew, but I suspect that any activity triggering garbage collection will also trigger the bug. After bisecting, I come to the conclusion that this revision is to blame: revno: 109470 committer: Jan D. branch nick: trunk timestamp: Mon 2012-08-06 18:09:02 +0200 message: * keyboard.c (timer_check_2): Add break so timer_check returns next timeout. That revision only adds a single line of code. I also find that the bug disappears if I patch the current tip of trunk (revision 110013) as follows, which undoes revision 109470: === modified file 'src/keyboard.c' --- src/keyboard.c 2012-09-13 02:21:28 +0000 +++ src/keyboard.c 2012-09-14 19:12:15 +0000 @@ -4484,7 +4484,6 @@ } nexttime = make_emacs_time (0, 0); - break; } else /* When we encounter a timer that is still waiting, I suppose the break was added for a good reason, so this is probably not the right thing. But it does cure the present problem. (This bug is also discussed on the emacs-devel list, in the thread titled "Emacs seems awfully unstable on OS X lately".) There seems to be a second bug, introduced later, that causes crashes (as opposed to hangs). I mention this because the second bug could interfere with attempts to work on this one. I will endeavour to track down the other bug as well. - Harald From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 15 06:01:31 2012 Received: (at submit) by debbugs.gnu.org; 15 Sep 2012 10:01:31 +0000 Received: from localhost ([127.0.0.1]:34781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCpBq-0007l2-KV for submit@debbugs.gnu.org; Sat, 15 Sep 2012 06:01:31 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37991) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCpBn-0007ko-BB for submit@debbugs.gnu.org; Sat, 15 Sep 2012 06:01:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCpAc-0004o3-GB for submit@debbugs.gnu.org; Sat, 15 Sep 2012 06:00:19 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:38181) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCpAc-0004aB-Bs for submit@debbugs.gnu.org; Sat, 15 Sep 2012 06:00:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCp6Z-0001oc-0G for bug-gnu-emacs@gnu.org; Sat, 15 Sep 2012 05:56:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCp6X-0003Y8-OK for bug-gnu-emacs@gnu.org; Sat, 15 Sep 2012 05:56:02 -0400 Received: from mailout.attendit.se ([83.140.103.4]:36827) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCp6X-0003XF-Dw for bug-gnu-emacs@gnu.org; Sat, 15 Sep 2012 05:56:01 -0400 Received: from mail01.melmac.se (mail01.melmac.se [62.20.26.80]) by mailout.attendit.se (Postfix) with ESMTP id C7722501B9 for ; Sat, 15 Sep 2012 11:49:55 +0200 (CEST) Received: (qmail 20112 invoked by uid 89); 15 Sep 2012 09:55:30 -0000 Received: from h-46-59-42-18.na.cust.bahnhof.se (HELO coolsville.localdomain) (boel.djarv@bdtv.se@46.59.42.18) by mail01.melmac.se with ESMTPA; 15 Sep 2012 09:55:30 -0000 Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id 77B787FA05E; Sat, 15 Sep 2012 11:55:55 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1486\)) Subject: Re: 24.1.50; Stuck in garbage collection on OS X From: =?iso-8859-1?Q?Jan_Dj=E4rv?= In-Reply-To: <20120914.230819.731988138196046556.hanche@math.ntnu.no> Date: Sat, 15 Sep 2012 11:55:55 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20120914.230819.731988138196046556.hanche@math.ntnu.no> To: Harald Hanche-Olsen X-Mailer: Apple Mail (2.1486) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.2 (------) X-Debbugs-Envelope-To: submit Cc: bug-gnu-emacs@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) Hello. I think this is probably the same bug as in #12326. I.e. a timer gets = added over and over again. Please consider how to fix the original problem as described in = http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D12326#11 before removing = the break statement. Jan D. 14 sep 2012 kl. 23:08 skrev Harald Hanche-Olsen : > This concerns emacs built with --with-ns from trunk on OS X. >=20 > To start with the symptom: Emacs seems to freeze, and spends a lot of > CPU time. Taking a sample with Activity monitor appears to indicate a > very deeply nested mark_object calls; from this I conclude that the > problem appears to happen in GC. >=20 > How to trigger the symptom: I always got it by trying to send an email > message with a large attachment. My mail client of choice is Mew, but > I suspect that any activity triggering garbage collection will also > trigger the bug. >=20 > After bisecting, I come to the conclusion that this revision is to > blame: >=20 > revno: 109470 > committer: Jan D. > branch nick: trunk > timestamp: Mon 2012-08-06 18:09:02 +0200 > message: > * keyboard.c (timer_check_2): Add break so timer_check returns next = timeout. >=20 > That revision only adds a single line of code. I also find that the > bug disappears if I patch the current tip of trunk (revision 110013) > as follows, which undoes revision 109470: >=20 > =3D=3D=3D modified file 'src/keyboard.c' > --- src/keyboard.c 2012-09-13 02:21:28 +0000 > +++ src/keyboard.c 2012-09-14 19:12:15 +0000 > @@ -4484,7 +4484,6 @@ > } >=20 > nexttime =3D make_emacs_time (0, 0); > - break; > } > else > /* When we encounter a timer that is still waiting, >=20 >=20 > I suppose the break was added for a good reason, so this is probably > not the right thing. But it does cure the present problem. >=20 > (This bug is also discussed on the emacs-devel list, in the thread > titled "Emacs seems awfully unstable on OS X lately".) >=20 > There seems to be a second bug, introduced later, that causes crashes > (as opposed to hangs). I mention this because the second bug could > interfere with attempts to work on this one. I will endeavour to track > down the other bug as well. >=20 > - Harald From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 15 07:16:13 2012 Received: (at submit) by debbugs.gnu.org; 15 Sep 2012 11:16:13 +0000 Received: from localhost ([127.0.0.1]:34964 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCqM8-0002up-Ot for submit@debbugs.gnu.org; Sat, 15 Sep 2012 07:16:13 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53406) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCqM6-0002ua-PL for submit@debbugs.gnu.org; Sat, 15 Sep 2012 07:16:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCqL3-0003SI-Au for submit@debbugs.gnu.org; Sat, 15 Sep 2012 07:15:08 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:42523) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCqL3-0003OH-7D for submit@debbugs.gnu.org; Sat, 15 Sep 2012 07:15:05 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCqDZ-00045a-MS for bug-gnu-emacs@gnu.org; Sat, 15 Sep 2012 07:07:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCqDY-0001Ah-Dc for bug-gnu-emacs@gnu.org; Sat, 15 Sep 2012 07:07:21 -0400 Received: from hylle01.itea.ntnu.no ([129.241.56.100]:57837) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCqDY-0001AU-6v for bug-gnu-emacs@gnu.org; Sat, 15 Sep 2012 07:07:20 -0400 Received: from localhost (localhost [127.0.0.1]) by hylle01.itea.ntnu.no (Postfix) with ESMTP id 661EE39A039 for ; Sat, 15 Sep 2012 13:07:18 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at hylle01.itea.ntnu.no Received: from anne.math.ntnu.no (anne.math.ntnu.no [129.241.15.150]) by hylle01.itea.ntnu.no (Postfix) with SMTP id C2B0E39A037 for ; Sat, 15 Sep 2012 13:07:17 +0200 (CEST) Received: (qmail 18388 invoked from network); 15 Sep 2012 11:07:17 -0000 Received: from gauss.math.ntnu.no (HELO localhost) (hanche@129.241.15.58) by anne.math.ntnu.no with ESMTPA; 15 Sep 2012 11:07:17 -0000 Date: Sat, 15 Sep 2012 13:07:10 +0200 (CEST) Message-Id: <20120915.130710.337227137258656213.hanche@math.ntnu.no> To: jan.h.d@swipnet.se Subject: Re: 24.1.50; Stuck in garbage collection on OS X From: Harald Hanche-Olsen In-Reply-To: References: <20120914.230819.731988138196046556.hanche@math.ntnu.no> X-URL: http://www.math.ntnu.no/~hanche/ X-Mailer: Mew version 6.5 on Emacs 24.2.50 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: submit Cc: bug-gnu-emacs@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) [Jan Dj=E4rv (2012-09-15 09:55:55 UTC)] > I think this is probably the same bug as in #12326. I.e. a timer gets = added over and over again. > Please consider how to fix the original problem as described in http://= debbugs.gnu.org/cgi/bugreport.cgi?bug=3D12326#11 before removing the brea= k statement. Thanks for the pointer. There are certainly timers involved in the code t= hat runs when I get the hangs; I'll review it and see if that is where th= e problem lies. However, I am not sure exactly what to look for. Or, more precisely, what= is the undefined behaviour in js2-mode that you complain about it bug 12= 326? On a side note, I see that only a few timer functions are described in th= e elisp manual. It appears one has to read timer.el to find out how timer= s work at a lower level. Or did I miss something? - Harald From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 15 08:33:06 2012 Received: (at 12447) by debbugs.gnu.org; 15 Sep 2012 12:33:06 +0000 Received: from localhost ([127.0.0.1]:35050 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCrYX-0005Xg-UE for submit@debbugs.gnu.org; Sat, 15 Sep 2012 08:33:06 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:64390) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCrYT-0005XF-FI for 12447@debbugs.gnu.org; Sat, 15 Sep 2012 08:33:03 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MAE00G00576AI00@a-mtaout20.012.net.il> for 12447@debbugs.gnu.org; Sat, 15 Sep 2012 15:31:48 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAE00FIL5H0ULB0@a-mtaout20.012.net.il>; Sat, 15 Sep 2012 15:31:48 +0300 (IDT) Date: Sat, 15 Sep 2012 15:31:50 +0300 From: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X In-reply-to: <20120915.130710.337227137258656213.hanche@math.ntnu.no> X-012-Sender: halo1@inter.net.il To: Harald Hanche-Olsen Message-id: <834nmztqkp.fsf@gnu.org> References: <20120914.230819.731988138196046556.hanche@math.ntnu.no> <20120915.130710.337227137258656213.hanche@math.ntnu.no> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 12447 Cc: jan.h.d@swipnet.se, 12447@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Sat, 15 Sep 2012 13:07:10 +0200 (CEST) > From: Harald Hanche-Olsen > Cc: 12447@debbugs.gnu.org > > It appears one has to read timer.el to find out how timers work at a lower level. Or did I miss something? No, the real story of how timers work is in process.c. See the function wait_reading_process_output there, which runs the timers via the call to timer_check around line 4444; time_check and its subroutines are in keyboard.c. timer.el is just the Lisp interface to that code, used to create, delete, and manage timer objects. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 15 09:20:20 2012 Received: (at 12447) by debbugs.gnu.org; 15 Sep 2012 13:20:20 +0000 Received: from localhost ([127.0.0.1]:35077 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCsIG-0006co-6Q for submit@debbugs.gnu.org; Sat, 15 Sep 2012 09:20:20 -0400 Received: from hylle02.itea.ntnu.no ([129.241.56.101]:34996) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCsID-0006cf-Ds for 12447@debbugs.gnu.org; Sat, 15 Sep 2012 09:20:18 -0400 Received: from localhost (localhost [127.0.0.1]) by hylle02.itea.ntnu.no (Postfix) with ESMTP id B4DC22C027 for <12447@debbugs.gnu.org>; Sat, 15 Sep 2012 15:19:12 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at hylle02.itea.ntnu.no Received: from anne.math.ntnu.no (anne.math.ntnu.no [129.241.15.150]) by hylle02.itea.ntnu.no (Postfix) with SMTP id 306672C025 for <12447@debbugs.gnu.org>; Sat, 15 Sep 2012 15:19:12 +0200 (CEST) Received: (qmail 6476 invoked from network); 15 Sep 2012 13:19:12 -0000 Received: from gauss.math.ntnu.no (HELO localhost) (hanche@129.241.15.58) by anne.math.ntnu.no with ESMTPA; 15 Sep 2012 13:19:12 -0000 Date: Sat, 15 Sep 2012 15:19:09 +0200 (CEST) Message-Id: <20120915.151909.318452080619853688.hanche@math.ntnu.no> To: eliz@gnu.org Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X From: Harald Hanche-Olsen In-Reply-To: <834nmztqkp.fsf@gnu.org> References: <20120915.130710.337227137258656213.hanche@math.ntnu.no> <834nmztqkp.fsf@gnu.org> X-URL: http://www.math.ntnu.no/~hanche/ X-Mailer: Mew version 6.5 on Emacs 24.2.50 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Score: -4.7 (----) X-Debbugs-Envelope-To: 12447 Cc: jan.h.d@swipnet.se, 12447@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.7 (----) [Eli Zaretskii (2012-09-15 12:31:50 UTC)] > No, the real story of how timers work is in process.c. See the > function wait_reading_process_output there, which runs the timers via > the call to timer_check around line 4444; time_check and its > subroutines are in keyboard.c. > > timer.el is just the Lisp interface to that code, used to create, > delete, and manage timer objects. Okay, I'll study it; but it seems ludicrous that you need to read C code in order to use timers from elisp without causing emacs to hang. I almost feel like filing a documentation bug report. But I'll try to gain a better understanding of the issue before considering that. - Harald From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 15 09:57:21 2012 Received: (at 12447) by debbugs.gnu.org; 15 Sep 2012 13:57:21 +0000 Received: from localhost ([127.0.0.1]:35577 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCss5-0007XS-IJ for submit@debbugs.gnu.org; Sat, 15 Sep 2012 09:57:21 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:64951) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCss2-0007XK-P3 for 12447@debbugs.gnu.org; Sat, 15 Sep 2012 09:57:19 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MAE001008OIOZ00@a-mtaout22.012.net.il> for 12447@debbugs.gnu.org; Sat, 15 Sep 2012 16:56:14 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAE0007M9DOIXP0@a-mtaout22.012.net.il>; Sat, 15 Sep 2012 16:56:12 +0300 (IDT) Date: Sat, 15 Sep 2012 16:56:14 +0300 From: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X In-reply-to: <20120915.151909.318452080619853688.hanche@math.ntnu.no> X-012-Sender: halo1@inter.net.il To: Harald Hanche-Olsen Message-id: <83y5kbs83l.fsf@gnu.org> References: <20120915.130710.337227137258656213.hanche@math.ntnu.no> <834nmztqkp.fsf@gnu.org> <20120915.151909.318452080619853688.hanche@math.ntnu.no> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 12447 Cc: jan.h.d@swipnet.se, 12447@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Sat, 15 Sep 2012 15:19:09 +0200 (CEST) > Cc: jan.h.d@swipnet.se, 12447@debbugs.gnu.org > From: Harald Hanche-Olsen > > [Eli Zaretskii (2012-09-15 12:31:50 UTC)] > > > No, the real story of how timers work is in process.c. See the > > function wait_reading_process_output there, which runs the timers via > > the call to timer_check around line 4444; time_check and its > > subroutines are in keyboard.c. > > > > timer.el is just the Lisp interface to that code, used to create, > > delete, and manage timer objects. > > Okay, I'll study it; but it seems ludicrous that you need to read C > code in order to use timers from elisp without causing emacs to hang. ??? AFAIU, you are trying to track a bug, not use the timers. You specifically asked about "how the timers work at a lower level". Using timers does not involve any reading of C code; just read the "Timers" and "Idle timers" nodes of the ELisp manual, and Bob's your uncle. No low-level knowledge is needed just for using timers. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 15 10:25:05 2012 Received: (at 12447) by debbugs.gnu.org; 15 Sep 2012 14:25:05 +0000 Received: from localhost ([127.0.0.1]:35621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCtIu-0008Bq-Jc for submit@debbugs.gnu.org; Sat, 15 Sep 2012 10:25:05 -0400 Received: from hylle01.itea.ntnu.no ([129.241.56.100]:53841) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCtIs-0008BR-Er for 12447@debbugs.gnu.org; Sat, 15 Sep 2012 10:25:03 -0400 Received: from localhost (localhost [127.0.0.1]) by hylle01.itea.ntnu.no (Postfix) with ESMTP id 9FFFB35A001 for <12447@debbugs.gnu.org>; Sat, 15 Sep 2012 16:23:57 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at hylle01.itea.ntnu.no Received: from anne.math.ntnu.no (anne.math.ntnu.no [129.241.15.150]) by hylle01.itea.ntnu.no (Postfix) with SMTP id E16A731E018 for <12447@debbugs.gnu.org>; Sat, 15 Sep 2012 16:23:56 +0200 (CEST) Received: (qmail 14036 invoked from network); 15 Sep 2012 14:23:56 -0000 Received: from gauss.math.ntnu.no (HELO localhost) (hanche@129.241.15.58) by anne.math.ntnu.no with ESMTPA; 15 Sep 2012 14:23:56 -0000 Date: Sat, 15 Sep 2012 16:23:53 +0200 (CEST) Message-Id: <20120915.162353.801081994667867167.hanche@math.ntnu.no> To: eliz@gnu.org Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X From: Harald Hanche-Olsen In-Reply-To: <83y5kbs83l.fsf@gnu.org> References: <834nmztqkp.fsf@gnu.org> <20120915.151909.318452080619853688.hanche@math.ntnu.no> <83y5kbs83l.fsf@gnu.org> X-URL: http://www.math.ntnu.no/~hanche/ X-Mailer: Mew version 6.5 on Emacs 24.2.50 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Score: -4.7 (----) X-Debbugs-Envelope-To: 12447 Cc: jan.h.d@swipnet.se, 12447@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.7 (----) [Eli Zaretskii (2012-09-15 13:56:14 UTC)] > ??? AFAIU, you are trying to track a bug, not use the timers. You > specifically asked about "how the timers work at a lower level". > > Using timers does not involve any reading of C code; just read the > "Timers" and "Idle timers" nodes of the ELisp manual, and Bob's your > uncle. No low-level knowledge is needed just for using timers. Ah. I was forming my impression by looking at the code quoted in the discussion of bug#12326, which seems to be using lower level stuff. So I thought I had to understand that. But the timer code in mew seems to only use the interface described in the elisp manual. But yes, I am chasing a bug, not trying to use timers. Which seems to require understanding the underlying mechanism, as otherwise I have no idea what I need to be looking for. After all, the code works fine most of the time, but revision 109470 broke it for some strange reason. And this seems to imply that you do need to understand the lower levels in order to use timers safely. Which is bad, if true. For example: Is it okay to set a timer in a timer callback? Example code in the "Idle timers" node in the elisp manual seems to say so. Thanks for your patience with my many misunderstandings. I want to track this problem down, but I am still fumbling in the dark. - Harald From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 15 10:38:05 2012 Received: (at 12447) by debbugs.gnu.org; 15 Sep 2012 14:38:06 +0000 Received: from localhost ([127.0.0.1]:35634 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCtVV-0008Uj-IU for submit@debbugs.gnu.org; Sat, 15 Sep 2012 10:38:05 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:58089) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCtVT-0008UW-49 for 12447@debbugs.gnu.org; Sat, 15 Sep 2012 10:38:04 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MAE00H00B32DS00@a-mtaout20.012.net.il> for 12447@debbugs.gnu.org; Sat, 15 Sep 2012 17:36:58 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAE00GYFB9MWAA0@a-mtaout20.012.net.il>; Sat, 15 Sep 2012 17:36:58 +0300 (IDT) Date: Sat, 15 Sep 2012 17:37:00 +0300 From: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X In-reply-to: <20120915.162353.801081994667867167.hanche@math.ntnu.no> X-012-Sender: halo1@inter.net.il To: Harald Hanche-Olsen Message-id: <83txuzs67n.fsf@gnu.org> References: <834nmztqkp.fsf@gnu.org> <20120915.151909.318452080619853688.hanche@math.ntnu.no> <83y5kbs83l.fsf@gnu.org> <20120915.162353.801081994667867167.hanche@math.ntnu.no> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 12447 Cc: jan.h.d@swipnet.se, 12447@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Sat, 15 Sep 2012 16:23:53 +0200 (CEST) > Cc: jan.h.d@swipnet.se, 12447@debbugs.gnu.org > From: Harald Hanche-Olsen > > For example: Is it okay to set a timer in a timer callback? I don't see why not. Setting up a timer just creates a Lisp object and adds it to the list of timers. The timer will be run the next time the low-level mechanism, which is part of the Emacs exec loop, determines that it's ripe. > Thanks for your patience with my many misunderstandings. I want to > track this problem down, but I am still fumbling in the dark. You are welcome. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 15 15:00:25 2012 Received: (at submit) by debbugs.gnu.org; 15 Sep 2012 19:00:26 +0000 Received: from localhost ([127.0.0.1]:35772 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCxbN-0006o2-CT for submit@debbugs.gnu.org; Sat, 15 Sep 2012 15:00:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58266) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCxbK-0006jZ-9y for submit@debbugs.gnu.org; Sat, 15 Sep 2012 15:00:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCxaG-0004JY-SC for submit@debbugs.gnu.org; Sat, 15 Sep 2012 14:59:17 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:42468) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCxaG-0004JU-Oq for submit@debbugs.gnu.org; Sat, 15 Sep 2012 14:59:16 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42120) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCxaF-0001J7-Pv for bug-gnu-emacs@gnu.org; Sat, 15 Sep 2012 14:59:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCxaE-0004JH-CC for bug-gnu-emacs@gnu.org; Sat, 15 Sep 2012 14:59:15 -0400 Received: from mailout.attendit.se ([83.140.103.4]:50498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCxaE-0004J4-5n for bug-gnu-emacs@gnu.org; Sat, 15 Sep 2012 14:59:14 -0400 Received: from mail01.melmac.se (mail01.melmac.se [62.20.26.80]) by mailout.attendit.se (Postfix) with ESMTP id 4EFE950196 for ; Sat, 15 Sep 2012 20:53:10 +0200 (CEST) Received: (qmail 26023 invoked by uid 89); 15 Sep 2012 18:58:45 -0000 Received: from h-46-59-42-18.na.cust.bahnhof.se (HELO coolsville.localdomain) (boel.djarv@bdtv.se@46.59.42.18) by mail01.melmac.se with ESMTPA; 15 Sep 2012 18:58:45 -0000 Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id AE2AC7FA05E; Sat, 15 Sep 2012 20:59:10 +0200 (CEST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1486\)) Subject: Re: 24.1.50; Stuck in garbage collection on OS X From: =?iso-8859-1?Q?Jan_Dj=E4rv?= In-Reply-To: <20120915.130710.337227137258656213.hanche@math.ntnu.no> Date: Sat, 15 Sep 2012 20:59:09 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <61FFB506-42BA-4DE7-8AE3-092E940DD7AC@swipnet.se> References: <20120914.230819.731988138196046556.hanche@math.ntnu.no> <20120915.130710.337227137258656213.hanche@math.ntnu.no> To: Harald Hanche-Olsen X-Mailer: Apple Mail (2.1486) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.2 (------) X-Debbugs-Envelope-To: submit Cc: bug-gnu-emacs@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) 15 sep 2012 kl. 13:07 skrev Harald Hanche-Olsen : > [Jan Dj=E4rv (2012-09-15 09:55:55 UTC)] >=20 >> I think this is probably the same bug as in #12326. I.e. a timer = gets added over and over again. >> Please consider how to fix the original problem as described in = http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D12326#11 before removing = the break statement. >=20 > Thanks for the pointer. There are certainly timers involved in the = code that runs when I get the hangs; I'll review it and see if that is = where the problem lies. >=20 > However, I am not sure exactly what to look for. Or, more precisely, = what is the undefined behaviour in js2-mode that you complain about it = bug 12326? >=20 The undefined behaviour was before adding the break, timers could run at = a time in the future that depended on other timers. The defined = behaviour is with the break, timers run when they should. I suspect there is some bug in the C code when adding a timer from = within a timer callback. > On a side note, I see that only a few timer functions are described in = the elisp manual. It appears one has to read timer.el to find out how = timers work at a lower level. Or did I miss something? As Eli has answered, the timers are handeled in C as a list sorted by = time when the timers are to be run. I.e. the next timer to run is at = the head of the list. Jan D. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 15 15:08:19 2012 Received: (at control) by debbugs.gnu.org; 15 Sep 2012 19:08:19 +0000 Received: from localhost ([127.0.0.1]:35781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCxj0-0007Ee-Ne for submit@debbugs.gnu.org; Sat, 15 Sep 2012 15:08:18 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:53898) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCxiz-0007EY-Se for control@debbugs.gnu.org; Sat, 15 Sep 2012 15:08:18 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1TCxhx-0000zs-Ae for control@debbugs.gnu.org; Sat, 15 Sep 2012 15:07:13 -0400 Date: Sat, 15 Sep 2012 15:07:13 -0400 Message-Id: Subject: control message for bug 12326 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -7.4 (-------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -7.4 (-------) merge 12447 12326 From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 16 05:17:10 2012 Received: (at 12447) by debbugs.gnu.org; 16 Sep 2012 09:17:10 +0000 Received: from localhost ([127.0.0.1]:36467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDAyR-0006uk-7F for submit@debbugs.gnu.org; Sun, 16 Sep 2012 05:17:09 -0400 Received: from forward3h.mail.yandex.net ([84.201.187.148]:55791) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDAyM-0006ua-HV for 12447@debbugs.gnu.org; Sun, 16 Sep 2012 05:17:05 -0400 Received: from smtp1h.mail.yandex.net (smtp1h.mail.yandex.net [84.201.187.144]) by forward3h.mail.yandex.net (Yandex) with ESMTP id 410EB1360EF5; Sun, 16 Sep 2012 13:15:53 +0400 (MSK) Received: from smtp1h.mail.yandex.net (localhost [127.0.0.1]) by smtp1h.mail.yandex.net (Yandex) with ESMTP id E63091340267; Sun, 16 Sep 2012 13:15:52 +0400 (MSK) Received: from 5x166x246x245.dynamic.spb.ertelecom.ru (5x166x246x245.dynamic.spb.ertelecom.ru [5.166.246.245]) by smtp1h.mail.yandex.net (nwsmtp/Yandex) with ESMTP id FpUCdOMP-FqUiYOAN; Sun, 16 Sep 2012 13:15:52 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1347786952; bh=vpZrm0pxqvfQVkwDHNin7qU2VPuEOnpaZb+DIUuJCK0=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: Content-Type:Content-Transfer-Encoding; b=Qg7brloEhfsSAFniwCMwF+RI3Rwqdm+cRs7BSqAZs5iMHQKmj0Dytz+IhUfu6LJsw ts9g0xZ7r3CpmhgFUIqNgeFCWGxJ3GbbAGfPV64wv3p5V0OhzQ9abAK6t4M5F0zq7t XmC5lbMekWXw+QxB+5TFFrDIibhTuFDZECW0iykI= Message-ID: <505598C8.8070904@yandex.ru> Date: Sun, 16 Sep 2012 13:15:52 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: eliz@gnu.org Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 12447 Cc: 12447@debbugs.gnu.org, hanche@math.ntnu.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Eli Zaretskii writes: >> Date: Sat, 15 Sep 2012 16:23:53 +0200 (CEST) >> Cc: jan.h.d@swipnet.se, 12447@debbugs.gnu.org >> From: Harald Hanche-Olsen >> >> For example: Is it okay to set a timer in a timer callback? > > I don't see why not. Setting up a timer just creates a Lisp object > and adds it to the list of timers. The timer will be run the next > time the low-level mechanism, which is part of the Emacs exec loop, > determines that it's ripe. In js2-mode's case, the problem is that 'run-with-idle-timer' makes the created timer run now, not the "next time". Here's an example: (defvar counter 0) (defun foo () (message (format "foo %s" counter)) (incf counter) (run-with-idle-timer 1 nil #'foo)) (foo) I'd expect that either timer would fire once every second (as long as I'm not touching my keyboard), or at least stop firing when I do touch my keyboard (seeing as otherwise Emacs is idle), but instead I just see the timer firing many times a second, the counter runs in the message area, and Emacs doesn't respond to any commands. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 16 06:33:11 2012 Received: (at 12447) by debbugs.gnu.org; 16 Sep 2012 10:33:11 +0000 Received: from localhost ([127.0.0.1]:36500 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDCA3-0000EI-4p for submit@debbugs.gnu.org; Sun, 16 Sep 2012 06:33:11 -0400 Received: from mtaout23.012.net.il ([80.179.55.175]:38868) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDC9z-0000E8-Kx for 12447@debbugs.gnu.org; Sun, 16 Sep 2012 06:33:09 -0400 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0MAF00L00TZ7XH00@a-mtaout23.012.net.il> for 12447@debbugs.gnu.org; Sun, 16 Sep 2012 13:31:10 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAF00LBYUJTW2C0@a-mtaout23.012.net.il>; Sun, 16 Sep 2012 13:31:06 +0300 (IDT) Date: Sun, 16 Sep 2012 13:31:10 +0300 From: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X In-reply-to: <505598C8.8070904@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <834nmys1ht.fsf@gnu.org> References: <505598C8.8070904@yandex.ru> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 12447 Cc: 12447@debbugs.gnu.org, hanche@math.ntnu.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Sun, 16 Sep 2012 13:15:52 +0400 > From: Dmitry Gutov > CC: hanche@math.ntnu.no, 12447@debbugs.gnu.org > > Eli Zaretskii writes: > > >> Date: Sat, 15 Sep 2012 16:23:53 +0200 (CEST) > >> Cc: jan.h.d@swipnet.se, 12447@debbugs.gnu.org > >> From: Harald Hanche-Olsen > >> > >> For example: Is it okay to set a timer in a timer callback? > > > > I don't see why not. Setting up a timer just creates a Lisp object > > and adds it to the list of timers. The timer will be run the next > > time the low-level mechanism, which is part of the Emacs exec loop, > > determines that it's ripe. > > In js2-mode's case, the problem is that 'run-with-idle-timer' makes the > created timer run now, not the "next time". Here's an example: > > (defvar counter 0) > > (defun foo () > (message (format "foo %s" counter)) > (incf counter) > (run-with-idle-timer 1 nil #'foo)) > > (foo) The code above does not run the timer, it just schedules it to run after at least 1 sec of idleness time. > I'd expect that either timer would fire once every second (as long as > I'm not touching my keyboard), or at least stop firing when I do touch > my keyboard (seeing as otherwise Emacs is idle), but instead I just see > the timer firing many times a second, the counter runs in the message > area, and Emacs doesn't respond to any commands. Then there's a bug, because an idle timer should only fire when there's no other input. If there's keyboard input, Emacs should process it first. I don't think the bug is related to the fact that the timer handler re-schedules itself. That is something many timers do. There's something else at work here, and that something is most probably on the C level. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 16 06:45:45 2012 Received: (at 12447) by debbugs.gnu.org; 16 Sep 2012 10:45:45 +0000 Received: from localhost ([127.0.0.1]:36531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDCMC-0000Y5-Kj for submit@debbugs.gnu.org; Sun, 16 Sep 2012 06:45:44 -0400 Received: from forward16.mail.yandex.net ([95.108.253.141]:52087) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDCM8-0000Xu-Te for 12447@debbugs.gnu.org; Sun, 16 Sep 2012 06:45:43 -0400 Received: from smtp16.mail.yandex.net (smtp16.mail.yandex.net [95.108.252.16]) by forward16.mail.yandex.net (Yandex) with ESMTP id 39E71D212E2; Sun, 16 Sep 2012 14:44:31 +0400 (MSK) Received: from smtp16.mail.yandex.net (localhost [127.0.0.1]) by smtp16.mail.yandex.net (Yandex) with ESMTP id 051776A030D; Sun, 16 Sep 2012 14:44:30 +0400 (MSK) Received: from 5x166x246x245.dynamic.spb.ertelecom.ru (5x166x246x245.dynamic.spb.ertelecom.ru [5.166.246.245]) by smtp16.mail.yandex.net (nwsmtp/Yandex) with ESMTP id iTb0kSE2-iUbaiAiP; Sun, 16 Sep 2012 14:44:30 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1347792270; bh=ifu8136F56J0mg7Qy0g7EFt0rLsyRrKv8cL035xXnu0=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=i+4WjRMglAfyowxM3FBGTSqSPzKlpX1ZeZlQ1uQWXow3w/4tk8a+X95i+l48bD9xQ Vsgw+r4e+LrGewyBss0n/hU71UgpPXAJsRRIdYo+YdFlgocqJyVartezRzlaArm08F VOmh+zFsnI4z6rywb9BflxfH5OEpYXddYTDpQm6Q= Message-ID: <5055AD8E.5020309@yandex.ru> Date: Sun, 16 Sep 2012 14:44:30 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X References: <505598C8.8070904@yandex.ru> <834nmys1ht.fsf@gnu.org> In-Reply-To: <834nmys1ht.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 12447 Cc: 12447@debbugs.gnu.org, hanche@math.ntnu.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 16.09.2012 14:31, Eli Zaretskii wrote: >> Date: Sun, 16 Sep 2012 13:15:52 +0400 >> From: Dmitry Gutov >> CC: hanche@math.ntnu.no, 12447@debbugs.gnu.org >> >> Eli Zaretskii writes: >> >> >> Date: Sat, 15 Sep 2012 16:23:53 +0200 (CEST) >> >> Cc: jan.h.d@swipnet.se, 12447@debbugs.gnu.org >> >> From: Harald Hanche-Olsen >> >> >> >> For example: Is it okay to set a timer in a timer callback? >> > >> > I don't see why not. Setting up a timer just creates a Lisp object >> > and adds it to the list of timers. The timer will be run the next >> > time the low-level mechanism, which is part of the Emacs exec loop, >> > determines that it's ripe. >> >> In js2-mode's case, the problem is that 'run-with-idle-timer' makes the >> created timer run now, not the "next time". Here's an example: >> >> (defvar counter 0) >> >> (defun foo () >> (message (format "foo %s" counter)) >> (incf counter) >> (run-with-idle-timer 1 nil #'foo)) >> >> (foo) > > The code above does not run the timer, it just schedules it to run > after at least 1 sec of idleness time. Yes. And 1 second later, Emacs effectively freezes (while still continuing to show the increasing counter in the message area). >> I'd expect that either timer would fire once every second (as long as >> I'm not touching my keyboard), or at least stop firing when I do touch >> my keyboard (seeing as otherwise Emacs is idle), but instead I just see >> the timer firing many times a second, the counter runs in the message >> area, and Emacs doesn't respond to any commands. > > Then there's a bug, because an idle timer should only fire when > there's no other input. If there's keyboard input, Emacs should > process it first. > > I don't think the bug is related to the fact that the timer handler > re-schedules itself. That is something many timers do. There's > something else at work here, and that something is most probably on > the C level. Like I wrote in 12326, AFAICT, the problem is that timer_check_2 doesn't at any point check that Emacs is still idle. When run-with-idle-timer calls (timer-activate-when-idle timer t), the new timer is added to the list, timer_check_2 reaches is and runs it immediately because 'timer_idleness_start_time' still has the same value. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 16 07:54:49 2012 Received: (at 12447) by debbugs.gnu.org; 16 Sep 2012 11:54:50 +0000 Received: from localhost ([127.0.0.1]:36561 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDDR3-0002vf-JM for submit@debbugs.gnu.org; Sun, 16 Sep 2012 07:54:49 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:44181) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDDQz-0002vV-TQ for 12447@debbugs.gnu.org; Sun, 16 Sep 2012 07:54:47 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MAF00D00YATR300@a-mtaout22.012.net.il> for 12447@debbugs.gnu.org; Sun, 16 Sep 2012 14:53:18 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAF00DNOYCUAQE0@a-mtaout22.012.net.il>; Sun, 16 Sep 2012 14:53:18 +0300 (IDT) Date: Sun, 16 Sep 2012 14:53:22 +0300 From: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X In-reply-to: <5055AD8E.5020309@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <83zk4qqj4d.fsf@gnu.org> References: <505598C8.8070904@yandex.ru> <834nmys1ht.fsf@gnu.org> <5055AD8E.5020309@yandex.ru> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 12447 Cc: 12447@debbugs.gnu.org, hanche@math.ntnu.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Sun, 16 Sep 2012 14:44:30 +0400 > From: Dmitry Gutov > CC: hanche@math.ntnu.no, 12447@debbugs.gnu.org > > Like I wrote in 12326, AFAICT, the problem is that timer_check_2 doesn't > at any point check that Emacs is still idle. When run-with-idle-timer > calls (timer-activate-when-idle timer t), the new timer is added to the > list, timer_check_2 reaches is and runs it immediately because > 'timer_idleness_start_time' still has the same value. If that is the problem, then perhaps having timer_check_2 work on a copy of the list would solve the problem. Did you try that? From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 16 08:08:22 2012 Received: (at 12447) by debbugs.gnu.org; 16 Sep 2012 12:08:22 +0000 Received: from localhost ([127.0.0.1]:36578 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDDe9-0003FZ-S0 for submit@debbugs.gnu.org; Sun, 16 Sep 2012 08:08:22 -0400 Received: from forward12.mail.yandex.net ([95.108.130.94]:54237) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDDe4-0003FL-M4 for 12447@debbugs.gnu.org; Sun, 16 Sep 2012 08:08:19 -0400 Received: from smtp12.mail.yandex.net (smtp12.mail.yandex.net [95.108.131.191]) by forward12.mail.yandex.net (Yandex) with ESMTP id CD554C21616; Sun, 16 Sep 2012 16:07:06 +0400 (MSK) Received: from smtp12.mail.yandex.net (localhost [127.0.0.1]) by smtp12.mail.yandex.net (Yandex) with ESMTP id 989B716A0643; Sun, 16 Sep 2012 16:07:06 +0400 (MSK) Received: from 5x166x246x245.dynamic.spb.ertelecom.ru (5x166x246x245.dynamic.spb.ertelecom.ru [5.166.246.245]) by smtp12.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 75wOmEL0-76w0YArj; Sun, 16 Sep 2012 16:07:06 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1347797226; bh=Syo34yDXK+NGyoCZC2P7BZEWeWBp7IGdXkqyRhm9nps=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=tOXto1wbHn6XyYl2TgdfQ1JejZLiOJOrfI3c6OM3/LHbGdLb2b/Rk+ksf0yWZO038 LdPAxYk10EpzMoecbwHoKrqVpDk0nTCKvGNScTmjD3dT9oFFeuifwkgyrjnzD0NWxS OBUuIVioybW7+Oa5TjOM+5f8dWRcp5gKoONO0WZI= Message-ID: <5055C0EB.3040908@yandex.ru> Date: Sun, 16 Sep 2012 16:07:07 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X References: <505598C8.8070904@yandex.ru> <834nmys1ht.fsf@gnu.org> <5055AD8E.5020309@yandex.ru> <83zk4qqj4d.fsf@gnu.org> In-Reply-To: <83zk4qqj4d.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 12447 Cc: 12447@debbugs.gnu.org, hanche@math.ntnu.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 16.09.2012 15:53, Eli Zaretskii wrote: >> Date: Sun, 16 Sep 2012 14:44:30 +0400 >> From: Dmitry Gutov >> CC: hanche@math.ntnu.no, 12447@debbugs.gnu.org >> >> Like I wrote in 12326, AFAICT, the problem is that timer_check_2 doesn't >> at any point check that Emacs is still idle. When run-with-idle-timer >> calls (timer-activate-when-idle timer t), the new timer is added to the >> list, timer_check_2 reaches is and runs it immediately because >> 'timer_idleness_start_time' still has the same value. > > If that is the problem, then perhaps having timer_check_2 work on a > copy of the list would solve the problem. Did you try that? I'm no C programmer, so I didn't try to fix it in C code. How would I make a copy of a list there? But no, it probably won't: the "guilty" commit made timer_check_2 actually return 0 after a timer fires (keeping true to the comment above it), so a local copy would serve no purpose. Assuming it would've worked, though, wouldn't it make the second argument to 'timer-activate-when-idle' useless? From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 16 08:40:34 2012 Received: (at 12447) by debbugs.gnu.org; 16 Sep 2012 12:40:34 +0000 Received: from localhost ([127.0.0.1]:36590 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDE9J-00040C-S4 for submit@debbugs.gnu.org; Sun, 16 Sep 2012 08:40:34 -0400 Received: from mtaout21.012.net.il ([80.179.55.169]:51621) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDE9C-0003zz-Ei for 12447@debbugs.gnu.org; Sun, 16 Sep 2012 08:40:28 -0400 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MAG00J000B71L00@a-mtaout21.012.net.il> for 12447@debbugs.gnu.org; Sun, 16 Sep 2012 15:39:16 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAG00JG20HG1Q10@a-mtaout21.012.net.il>; Sun, 16 Sep 2012 15:39:16 +0300 (IDT) Date: Sun, 16 Sep 2012 15:39:20 +0300 From: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X In-reply-to: <5055C0EB.3040908@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <83wqzuqgzr.fsf@gnu.org> References: <505598C8.8070904@yandex.ru> <834nmys1ht.fsf@gnu.org> <5055AD8E.5020309@yandex.ru> <83zk4qqj4d.fsf@gnu.org> <5055C0EB.3040908@yandex.ru> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 12447 Cc: 12447@debbugs.gnu.org, hanche@math.ntnu.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Sun, 16 Sep 2012 16:07:07 +0400 > From: Dmitry Gutov > CC: hanche@math.ntnu.no, 12447@debbugs.gnu.org > > >> Like I wrote in 12326, AFAICT, the problem is that timer_check_2 doesn't > >> at any point check that Emacs is still idle. When run-with-idle-timer > >> calls (timer-activate-when-idle timer t), the new timer is added to the > >> list, timer_check_2 reaches is and runs it immediately because > >> 'timer_idleness_start_time' still has the same value. > > > > If that is the problem, then perhaps having timer_check_2 work on a > > copy of the list would solve the problem. Did you try that? > > I'm no C programmer, so I didn't try to fix it in C code. How would I > make a copy of a list there? Using the Fcopy_sequence function, I'd think. Use it at the beginning of the function to set the value of 'idle_timers', instead of this line: idle_timers = Vtimer_idle_list; > But no, it probably won't: the "guilty" commit made timer_check_2 > actually return 0 after a timer fires (keeping true to the comment above > it), so a local copy would serve no purpose. timer_check_2 indeed returns, but then timer_check will call it again, because it continues calling timer_check_2 in a loop, until there's no ripe timer. > Assuming it would've worked, though, wouldn't it make the second > argument to 'timer-activate-when-idle' useless? It isn't useless, it just means a slight delay in the "now" part of its doc string. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 16 09:26:53 2012 Received: (at 12447) by debbugs.gnu.org; 16 Sep 2012 13:26:53 +0000 Received: from localhost ([127.0.0.1]:36612 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDEs8-000520-Ke for submit@debbugs.gnu.org; Sun, 16 Sep 2012 09:26:53 -0400 Received: from forward15.mail.yandex.net ([95.108.130.119]:37137) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDEs1-00051o-RM for 12447@debbugs.gnu.org; Sun, 16 Sep 2012 09:26:48 -0400 Received: from smtp14.mail.yandex.net (smtp14.mail.yandex.net [95.108.131.192]) by forward15.mail.yandex.net (Yandex) with ESMTP id 2ECB09E10E3; Sun, 16 Sep 2012 17:25:35 +0400 (MSK) Received: from smtp14.mail.yandex.net (localhost [127.0.0.1]) by smtp14.mail.yandex.net (Yandex) with ESMTP id EEE931B60756; Sun, 16 Sep 2012 17:25:34 +0400 (MSK) Received: from 5x166x246x245.dynamic.spb.ertelecom.ru (5x166x246x245.dynamic.spb.ertelecom.ru [5.166.246.245]) by smtp14.mail.yandex.net (nwsmtp/Yandex) with ESMTP id PYOa8YP0-PYOCpL7T; Sun, 16 Sep 2012 17:25:34 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1347801934; bh=Orc4/AoC2GEBUetdoiCyB+aiZ9zbAtiKMmLcW8CzqO8=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=WbH8jywW9E9G3SHW5z5adxjGS/25zhIZJUybialYblfJHWH1VXuSLy/S/Ekjyt/hQ P2OrSeOY2ArBtC3F0aVygIEyaZv4FhoKYEiiQfQ+aVKTXg9KtAYsq8PmvHZIX5vw9v 7zQcobTJnRWxXdxm8g2kJHEPnLi/tW9X9IB75ekI= Message-ID: <5055D34F.1040800@yandex.ru> Date: Sun, 16 Sep 2012 17:25:35 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X References: <505598C8.8070904@yandex.ru> <834nmys1ht.fsf@gnu.org> <5055AD8E.5020309@yandex.ru> <83zk4qqj4d.fsf@gnu.org> <5055C0EB.3040908@yandex.ru> <83wqzuqgzr.fsf@gnu.org> In-Reply-To: <83wqzuqgzr.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 12447 Cc: 12447@debbugs.gnu.org, hanche@math.ntnu.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 16.09.2012 16:39, Eli Zaretskii wrote: >> Date: Sun, 16 Sep 2012 16:07:07 +0400 >> From: Dmitry Gutov >> CC: hanche@math.ntnu.no, 12447@debbugs.gnu.org >> >>>> Like I wrote in 12326, AFAICT, the problem is that timer_check_2 doesn't >>>> at any point check that Emacs is still idle. When run-with-idle-timer >>>> calls (timer-activate-when-idle timer t), the new timer is added to the >>>> list, timer_check_2 reaches is and runs it immediately because >>>> 'timer_idleness_start_time' still has the same value. >>> >>> If that is the problem, then perhaps having timer_check_2 work on a >>> copy of the list would solve the problem. Did you try that? >> >> I'm no C programmer, so I didn't try to fix it in C code. How would I >> make a copy of a list there? > > Using the Fcopy_sequence function, I'd think. Use it at the beginning > of the function to set the value of 'idle_timers', instead of this > line: > > idle_timers = Vtimer_idle_list; Done that, recompiled, no difference in the example a sent previously. Exactly because, I think, of the control flow you describe below: >> But no, it probably won't: the "guilty" commit made timer_check_2 >> actually return 0 after a timer fires (keeping true to the comment above >> it), so a local copy would serve no purpose. > > timer_check_2 indeed returns, but then timer_check will call it again, > because it continues calling timer_check_2 in a loop, until there's no > ripe timer. Each time timer_check_2 is called, a new copy would be made from the idle timers list, so the newly created timer would be reached during the same call to 'timer_check'. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 16 09:48:56 2012 Received: (at 12447) by debbugs.gnu.org; 16 Sep 2012 13:48:56 +0000 Received: from localhost ([127.0.0.1]:36628 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDFDU-0005WI-3r for submit@debbugs.gnu.org; Sun, 16 Sep 2012 09:48:56 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:39536) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDFDQ-0005W8-Pr for 12447@debbugs.gnu.org; Sun, 16 Sep 2012 09:48:54 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MAG00E003NDUG00@a-mtaout22.012.net.il> for 12447@debbugs.gnu.org; Sun, 16 Sep 2012 16:47:40 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAG00DQ43NCW4S0@a-mtaout22.012.net.il>; Sun, 16 Sep 2012 16:47:36 +0300 (IDT) Date: Sun, 16 Sep 2012 16:47:40 +0300 From: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X In-reply-to: <5055D34F.1040800@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <83txuyqdtv.fsf@gnu.org> References: <505598C8.8070904@yandex.ru> <834nmys1ht.fsf@gnu.org> <5055AD8E.5020309@yandex.ru> <83zk4qqj4d.fsf@gnu.org> <5055C0EB.3040908@yandex.ru> <83wqzuqgzr.fsf@gnu.org> <5055D34F.1040800@yandex.ru> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 12447 Cc: 12447@debbugs.gnu.org, hanche@math.ntnu.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Sun, 16 Sep 2012 17:25:35 +0400 > From: Dmitry Gutov > CC: hanche@math.ntnu.no, 12447@debbugs.gnu.org > > > idle_timers = Vtimer_idle_list; > > Done that, recompiled, no difference in the example a sent previously. > Exactly because, I think, of the control flow you describe below: > > >> But no, it probably won't: the "guilty" commit made timer_check_2 > >> actually return 0 after a timer fires (keeping true to the comment above > >> it), so a local copy would serve no purpose. > > > > timer_check_2 indeed returns, but then timer_check will call it again, > > because it continues calling timer_check_2 in a loop, until there's no > > ripe timer. > > Each time timer_check_2 is called, a new copy would be made from the > idle timers list, so the newly created timer would be reached during the > same call to 'timer_check'. But the first time timer_check_2 encounters an un-ripe timer, or gets to the end of the list of timers, it returns a non-zero 'nexttime' value, which should break the loop in timer_check. Why isn't this happening? Perhaps the problem is that the value of 'difference' is not initialized: while (CONSP (timers) || CONSP (idle_timers)) { Lisp_Object timer = Qnil, idle_timer = Qnil; EMACS_TIME timer_time, idle_timer_time; EMACS_TIME difference; <<<<<<<<<<<<<<<<<<<<<<<<<<<< and then never set to any specific value, until here: else /* When we encounter a timer that is still waiting, return the amount of time to wait before it is ripe. */ { UNGCPRO; return difference; } which causes us return garbage, potentially zero, to timer_check. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 16 10:27:04 2012 Received: (at 12447) by debbugs.gnu.org; 16 Sep 2012 14:27:04 +0000 Received: from localhost ([127.0.0.1]:37281 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDFoO-0006Vr-5H for submit@debbugs.gnu.org; Sun, 16 Sep 2012 10:27:04 -0400 Received: from forward5.mail.yandex.net ([77.88.46.21]:45580) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDFoK-0006VN-8X for 12447@debbugs.gnu.org; Sun, 16 Sep 2012 10:27:02 -0400 Received: from smtp1.mail.yandex.net (smtp1.mail.yandex.net [77.88.46.101]) by forward5.mail.yandex.net (Yandex) with ESMTP id AC7981200F00; Sun, 16 Sep 2012 18:25:49 +0400 (MSK) Received: from smtp1.mail.yandex.net (localhost [127.0.0.1]) by smtp1.mail.yandex.net (Yandex) with ESMTP id 7A3D7AA03BC; Sun, 16 Sep 2012 18:25:49 +0400 (MSK) Received: from 5x166x246x245.dynamic.spb.ertelecom.ru (5x166x246x245.dynamic.spb.ertelecom.ru [5.166.246.245]) by smtp1.mail.yandex.net (nwsmtp/Yandex) with ESMTP id PmNKEwkZ-PmNiU1Tq; Sun, 16 Sep 2012 18:25:48 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1347805549; bh=5dzx9z8aH26mkuQdPRzU4/FX1GwyRZpDP6q361c86uk=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=FOPiLpGMMGhT490ql+oMVV2AhGWz6yPQnED3GvWmG62mAbFQ5tCD0EgnPAotgI0VL v7GJnwtrkD1rsNVm0Kc+3w7WiJKQfz0UIqtxYSlCvX0zXtHhw77ukTNJhenQBK3lSp Ml7lSCkjbfyWOfTWWX24rDIwGfov4oQ5VPCu0YnA= Message-ID: <5055E16E.1070604@yandex.ru> Date: Sun, 16 Sep 2012 18:25:50 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X References: <505598C8.8070904@yandex.ru> <834nmys1ht.fsf@gnu.org> <5055AD8E.5020309@yandex.ru> <83zk4qqj4d.fsf@gnu.org> <5055C0EB.3040908@yandex.ru> <83wqzuqgzr.fsf@gnu.org> <5055D34F.1040800@yandex.ru> <83txuyqdtv.fsf@gnu.org> In-Reply-To: <83txuyqdtv.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 12447 Cc: 12447@debbugs.gnu.org, hanche@math.ntnu.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 16.09.2012 17:47, Eli Zaretskii wrote: >> Date: Sun, 16 Sep 2012 17:25:35 +0400 >> From: Dmitry Gutov >> CC: hanche@math.ntnu.no, 12447@debbugs.gnu.org >> >>> idle_timers = Vtimer_idle_list; >> >> Done that, recompiled, no difference in the example a sent previously. >> Exactly because, I think, of the control flow you describe below: >> >>>> But no, it probably won't: the "guilty" commit made timer_check_2 >>>> actually return 0 after a timer fires (keeping true to the comment above >>>> it), so a local copy would serve no purpose. >>> >>> timer_check_2 indeed returns, but then timer_check will call it again, >>> because it continues calling timer_check_2 in a loop, until there's no >>> ripe timer. >> >> Each time timer_check_2 is called, a new copy would be made from the >> idle timers list, so the newly created timer would be reached during the >> same call to 'timer_check'. > > But the first time timer_check_2 encounters an un-ripe timer, or gets > to the end of the list of timers, it returns a non-zero 'nexttime' > value, which should break the loop in timer_check. Why isn't this > happening? Maybe because the new timer is at the top of the list, and it's considered ripe? > Perhaps the problem is that the value of 'difference' is not > initialized: > > while (CONSP (timers) || CONSP (idle_timers)) > { > Lisp_Object timer = Qnil, idle_timer = Qnil; > EMACS_TIME timer_time, idle_timer_time; > EMACS_TIME difference; <<<<<<<<<<<<<<<<<<<<<<<<<<<< > > and then never set to any specific value, until here: > > else > /* When we encounter a timer that is still waiting, > return the amount of time to wait before it is ripe. */ > { > UNGCPRO; > return difference; > } > > which causes us return garbage, potentially zero, to timer_check. It's assigned to, though. When we encounter a timer that's not yet ripe. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 16 10:55:52 2012 Received: (at 12447) by debbugs.gnu.org; 16 Sep 2012 14:55:52 +0000 Received: from localhost ([127.0.0.1]:37296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDGGG-0007Ap-IG for submit@debbugs.gnu.org; Sun, 16 Sep 2012 10:55:52 -0400 Received: from mtaout21.012.net.il ([80.179.55.169]:64450) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDGGC-0007Ag-Q9 for 12447@debbugs.gnu.org; Sun, 16 Sep 2012 10:55:49 -0400 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MAG00J006IRPM00@a-mtaout21.012.net.il> for 12447@debbugs.gnu.org; Sun, 16 Sep 2012 17:54:32 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAG00JNU6QVP240@a-mtaout21.012.net.il>; Sun, 16 Sep 2012 17:54:32 +0300 (IDT) Date: Sun, 16 Sep 2012 17:54:36 +0300 From: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X In-reply-to: <5055E16E.1070604@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <83sjaiqaqb.fsf@gnu.org> References: <505598C8.8070904@yandex.ru> <834nmys1ht.fsf@gnu.org> <5055AD8E.5020309@yandex.ru> <83zk4qqj4d.fsf@gnu.org> <5055C0EB.3040908@yandex.ru> <83wqzuqgzr.fsf@gnu.org> <5055D34F.1040800@yandex.ru> <83txuyqdtv.fsf@gnu.org> <5055E16E.1070604@yandex.ru> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 12447 Cc: 12447@debbugs.gnu.org, hanche@math.ntnu.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Sun, 16 Sep 2012 18:25:50 +0400 > From: Dmitry Gutov > CC: hanche@math.ntnu.no, 12447@debbugs.gnu.org > > > Perhaps the problem is that the value of 'difference' is not > > initialized: > > > > while (CONSP (timers) || CONSP (idle_timers)) > > { > > Lisp_Object timer = Qnil, idle_timer = Qnil; > > EMACS_TIME timer_time, idle_timer_time; > > EMACS_TIME difference; <<<<<<<<<<<<<<<<<<<<<<<<<<<< > > > > and then never set to any specific value, until here: > > > > else > > /* When we encounter a timer that is still waiting, > > return the amount of time to wait before it is ripe. */ > > { > > UNGCPRO; > > return difference; > > } > > > > which causes us return garbage, potentially zero, to timer_check. > > It's assigned to, though. When we encounter a timer that's not yet ripe. What if all of them are ripe? From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 16 11:57:25 2012 Received: (at 12447) by debbugs.gnu.org; 16 Sep 2012 15:57:25 +0000 Received: from localhost ([127.0.0.1]:37393 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDHDo-0000AX-R9 for submit@debbugs.gnu.org; Sun, 16 Sep 2012 11:57:25 -0400 Received: from forward4.mail.yandex.net ([77.88.46.9]:42473) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDHDl-0000AN-4A for 12447@debbugs.gnu.org; Sun, 16 Sep 2012 11:57:24 -0400 Received: from smtp3.mail.yandex.net (smtp3.mail.yandex.net [77.88.46.103]) by forward4.mail.yandex.net (Yandex) with ESMTP id 07C641BC136F; Sun, 16 Sep 2012 19:56:09 +0400 (MSK) Received: from smtp3.mail.yandex.net (localhost [127.0.0.1]) by smtp3.mail.yandex.net (Yandex) with ESMTP id C3EB61BA03B7; Sun, 16 Sep 2012 19:56:09 +0400 (MSK) Received: from 5x166x246x245.dynamic.spb.ertelecom.ru (5x166x246x245.dynamic.spb.ertelecom.ru [5.166.246.245]) by smtp3.mail.yandex.net (nwsmtp/Yandex) with ESMTP id u9MqDcPJ-u9M4jVOo; Sun, 16 Sep 2012 19:56:09 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1347810969; bh=TGBmsoqovyZey9T8isfK5PBe0XXqKVDtgIb3UsPzKwA=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=PlK3UglmML5VsWRqwTs21V19uIg8fd27WfvONVSNTpmbMUqkoHwm74bhN2C1sgv7O eaI96OFSEAdhoIIoaDYFdI3czF1KTe0Ia1n1JZf+67UoHgoBIYEAOMpbDDRy1ULpTZ PUfCFyBjQ6lKlg4rKCY1x6alMlDfiXkIaT9ZEUIM= Message-ID: <5055F69B.4020004@yandex.ru> Date: Sun, 16 Sep 2012 19:56:11 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X References: <505598C8.8070904@yandex.ru> <834nmys1ht.fsf@gnu.org> <5055AD8E.5020309@yandex.ru> <83zk4qqj4d.fsf@gnu.org> <5055C0EB.3040908@yandex.ru> <83wqzuqgzr.fsf@gnu.org> <5055D34F.1040800@yandex.ru> <83txuyqdtv.fsf@gnu.org> <5055E16E.1070604@yandex.ru> <83sjaiqaqb.fsf@gnu.org> In-Reply-To: <83sjaiqaqb.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 12447 Cc: 12447@debbugs.gnu.org, hanche@math.ntnu.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 16.09.2012 18:54, Eli Zaretskii wrote: >> Date: Sun, 16 Sep 2012 18:25:50 +0400 >> From: Dmitry Gutov >> CC: hanche@math.ntnu.no, 12447@debbugs.gnu.org >> >>> Perhaps the problem is that the value of 'difference' is not >>> initialized: >>> >>> while (CONSP (timers) || CONSP (idle_timers)) >>> { >>> Lisp_Object timer = Qnil, idle_timer = Qnil; >>> EMACS_TIME timer_time, idle_timer_time; >>> EMACS_TIME difference; <<<<<<<<<<<<<<<<<<<<<<<<<<<< >>> >>> and then never set to any specific value, until here: >>> >>> else >>> /* When we encounter a timer that is still waiting, >>> return the amount of time to wait before it is ripe. */ >>> { >>> UNGCPRO; >>> return difference; >>> } >>> >>> which causes us return garbage, potentially zero, to timer_check. >> >> It's assigned to, though. When we encounter a timer that's not yet ripe. > > What if all of them are ripe? I don't see the problem. The first timer is ripe? Fire it and return 'nexttime'. Otherwise, return 'difference', which now has been assigned a value. If we've reached the end of the list, again return 'nexttime', which is initialized with invalid_emacs_time () at the beginning of timer_check_2. Anyway, I think the immediate problem is that the newly created timer can be considered ripe. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 18 11:07:38 2012 Received: (at 12447) by debbugs.gnu.org; 18 Sep 2012 15:07:39 +0000 Received: from localhost ([127.0.0.1]:41981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDzOk-0001ii-Fk for submit@debbugs.gnu.org; Tue, 18 Sep 2012 11:07:38 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:52690) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDzOg-0001iS-JQ for 12447@debbugs.gnu.org; Tue, 18 Sep 2012 11:07:36 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MAJ00A00W928W00@a-mtaout20.012.net.il> for 12447@debbugs.gnu.org; Tue, 18 Sep 2012 18:05:22 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAJ00ABPWKY1IC0@a-mtaout20.012.net.il>; Tue, 18 Sep 2012 18:05:22 +0300 (IDT) Date: Tue, 18 Sep 2012 18:05:31 +0300 From: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X In-reply-to: <5055F69B.4020004@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov , Jan =?iso-8859-1?Q?Dj=E4rv?= Message-id: <837grr1idg.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 8bit References: <505598C8.8070904@yandex.ru> <834nmys1ht.fsf@gnu.org> <5055AD8E.5020309@yandex.ru> <83zk4qqj4d.fsf@gnu.org> <5055C0EB.3040908@yandex.ru> <83wqzuqgzr.fsf@gnu.org> <5055D34F.1040800@yandex.ru> <83txuyqdtv.fsf@gnu.org> <5055E16E.1070604@yandex.ru> <83sjaiqaqb.fsf@gnu.org> <5055F69B.4020004@yandex.ru> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 12447 Cc: 12447@debbugs.gnu.org, hanche@math.ntnu.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Sun, 16 Sep 2012 19:56:11 +0400 > From: Dmitry Gutov > Cc: 12447@debbugs.gnu.org, hanche@math.ntnu.no > > On 16.09.2012 18:54, Eli Zaretskii wrote: > >> Date: Sun, 16 Sep 2012 18:25:50 +0400 > >> From: Dmitry Gutov > >> CC: hanche@math.ntnu.no, 12447@debbugs.gnu.org > >> > >>> Perhaps the problem is that the value of 'difference' is not > >>> initialized: > >>> > >>> while (CONSP (timers) || CONSP (idle_timers)) > >>> { > >>> Lisp_Object timer = Qnil, idle_timer = Qnil; > >>> EMACS_TIME timer_time, idle_timer_time; > >>> EMACS_TIME difference; <<<<<<<<<<<<<<<<<<<<<<<<<<<< > >>> > >>> and then never set to any specific value, until here: > >>> > >>> else > >>> /* When we encounter a timer that is still waiting, > >>> return the amount of time to wait before it is ripe. */ > >>> { > >>> UNGCPRO; > >>> return difference; > >>> } > >>> > >>> which causes us return garbage, potentially zero, to timer_check. > >> > >> It's assigned to, though. When we encounter a timer that's not yet ripe. > > > > What if all of them are ripe? > > I don't see the problem. The first timer is ripe? Fire it and return > 'nexttime'. Otherwise, return 'difference', which now has been assigned > a value. > If we've reached the end of the list, again return 'nexttime', which is > initialized with invalid_emacs_time () at the beginning of timer_check_2. > > Anyway, I think the immediate problem is that the newly created timer > can be considered ripe. The patch below makes your simplified recipe, viz.: (defvar counter 0) (defun foo () (message (format "foo %s" counter)) (setq counter (1+ counter)) (run-with-idle-timer 1 nil #'foo)) (foo) "work" without locking up Emacs. "Work" in the sense that the timer is run and increments the counter, but keyboard input is still accepted, and causes 1-sec break in the idle timer invocation. What does NOT happen is the once-per-second invocation of the idle timer: as long as there's no other input, the idle timer runs much more frequently. But I think this is expected, since the call to run-with-idle-timer above explicitly asks to be run immediately. Can you see if these changes also make js2-mode work as expected? Jan, can you test whether this patch still keeps your two-timers recipe working? If it does, I think I should commit the changes below, because they avoid locking up Emacs by a timer that repeatedly reinvokes itself. === modified file 'src/keyboard.c' --- src/keyboard.c 2012-09-16 21:43:55 +0000 +++ src/keyboard.c 2012-09-18 14:58:24 +0000 @@ -4334,25 +4334,18 @@ decode_timer (Lisp_Object timer, EMACS_T should be done. */ static EMACS_TIME -timer_check_2 (void) +timer_check_2 (Lisp_Object timers, Lisp_Object idle_timers) { EMACS_TIME nexttime; EMACS_TIME now; EMACS_TIME idleness_now; - Lisp_Object timers, idle_timers, chosen_timer; - struct gcpro gcpro1, gcpro2, gcpro3; + Lisp_Object chosen_timer; + struct gcpro gcpro1; nexttime = invalid_emacs_time (); - /* Always consider the ordinary timers. */ - timers = Vtimer_list; - /* Consider the idle timers only if Emacs is idle. */ - if (EMACS_TIME_VALID_P (timer_idleness_start_time)) - idle_timers = Vtimer_idle_list; - else - idle_timers = Qnil; chosen_timer = Qnil; - GCPRO3 (timers, idle_timers, chosen_timer); + GCPRO1 (chosen_timer); /* First run the code that was delayed. */ while (CONSP (pending_funcalls)) @@ -4501,13 +4494,30 @@ EMACS_TIME timer_check (void) { EMACS_TIME nexttime; + Lisp_Object timers, idle_timers; + struct gcpro gcpro1, gcpro2; + + /* We use copies of the timers' lists to allow a timer to add itself + again, without locking up Emacs if the newly added timer is + already ripe when added. */ + + /* Always consider the ordinary timers. */ + timers = Fcopy_sequence (Vtimer_list); + /* Consider the idle timers only if Emacs is idle. */ + if (EMACS_TIME_VALID_P (timer_idleness_start_time)) + idle_timers = Fcopy_sequence (Vtimer_idle_list); + else + idle_timers = Qnil; + + GCPRO2 (timers, idle_timers); do { - nexttime = timer_check_2 (); + nexttime = timer_check_2 (timers, idle_timers); } while (EMACS_SECS (nexttime) == 0 && EMACS_NSECS (nexttime) == 0); + UNGCPRO; return nexttime; } From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 18 13:31:00 2012 Received: (at 12447) by debbugs.gnu.org; 18 Sep 2012 17:31:00 +0000 Received: from localhost ([127.0.0.1]:42092 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TE1dT-0000pg-Lp for submit@debbugs.gnu.org; Tue, 18 Sep 2012 13:30:59 -0400 Received: from mailout.attendit.se ([83.140.103.4]:54796) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TE1dQ-0000pM-UA for 12447@debbugs.gnu.org; Tue, 18 Sep 2012 13:30:57 -0400 Received: from mail01.melmac.se (mail01.melmac.se [62.20.26.80]) by mailout.attendit.se (Postfix) with ESMTP id 0EEA4500D5 for <12447@debbugs.gnu.org>; Tue, 18 Sep 2012 19:23:28 +0200 (CEST) Received: (qmail 19123 invoked by uid 89); 18 Sep 2012 17:29:02 -0000 Received: from h-46-59-42-18.na.cust.bahnhof.se (HELO coolsville.localdomain) (boel.djarv@bdtv.se@46.59.42.18) by mail01.melmac.se with ESMTPA; 18 Sep 2012 17:29:02 -0000 Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id 8A2A27FA05E; Tue, 18 Sep 2012 19:29:28 +0200 (CEST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1486\)) Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X From: =?iso-8859-1?Q?Jan_Dj=E4rv?= In-Reply-To: <837grr1idg.fsf@gnu.org> Date: Tue, 18 Sep 2012 19:29:28 +0200 Content-Transfer-Encoding: 7bit Message-Id: <37946879-EFDD-4A81-8C98-893F1AE2FF90@swipnet.se> References: <505598C8.8070904@yandex.ru> <834nmys1ht.fsf@gnu.org> <5055AD8E.5020309@yandex.ru> <83zk4qqj4d.fsf@gnu.org> <5055C0EB.3040908@yandex.ru> <83wqzuqgzr.fsf@gnu.org> <5055D34F.1040800@yandex.ru> <83txuyqdtv.fsf@gnu.org> <5055E16E.1070604@yandex.ru> <83sjaiqaqb.fsf@gnu.org> <5055F69B.4020004@yandex.ru> <837grr1idg.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.1486) X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 12447 Cc: 12447@debbugs.gnu.org, hanche@math.ntnu.no, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) Hello. 18 sep 2012 kl. 17:05 skrev Eli Zaretskii : > The patch below makes your simplified recipe, viz.: > > (defvar counter 0) > > (defun foo () > (message (format "foo %s" counter)) > (setq counter (1+ counter)) > (run-with-idle-timer 1 nil #'foo)) > (foo) > > "work" without locking up Emacs. "Work" in the sense that the timer > is run and increments the counter, but keyboard input is still > accepted, and causes 1-sec break in the idle timer invocation. What > does NOT happen is the once-per-second invocation of the idle timer: > as long as there's no other input, the idle timer runs much more > frequently. But I think this is expected, since the call to > run-with-idle-timer above explicitly asks to be run immediately. > > Can you see if these changes also make js2-mode work as expected? > > Jan, can you test whether this patch still keeps your two-timers > recipe working? If it does, I think I should commit the changes > below, because they avoid locking up Emacs by a timer that repeatedly > reinvokes itself. It does. Jan D. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 18 16:10:09 2012 Received: (at 12447) by debbugs.gnu.org; 18 Sep 2012 20:10:09 +0000 Received: from localhost ([127.0.0.1]:42275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TE47U-0000sf-Mm for submit@debbugs.gnu.org; Tue, 18 Sep 2012 16:10:08 -0400 Received: from mtaout23.012.net.il ([80.179.55.175]:52155) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TE47R-0000sO-HG for 12447@debbugs.gnu.org; Tue, 18 Sep 2012 16:10:06 -0400 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0MAK00E00AEEE000@a-mtaout23.012.net.il> for 12447@debbugs.gnu.org; Tue, 18 Sep 2012 23:08:42 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAK00EHPAMICW70@a-mtaout23.012.net.il>; Tue, 18 Sep 2012 23:08:42 +0300 (IDT) Date: Tue, 18 Sep 2012 23:08:52 +0300 From: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X In-reply-to: <37946879-EFDD-4A81-8C98-893F1AE2FF90@swipnet.se> To: Jan =?iso-8859-1?Q?Dj=E4rv?= Message-id: <83vcfbytyj.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: QUOTED-PRINTABLE X-012-Sender: halo1@inter.net.il References: <505598C8.8070904@yandex.ru> <834nmys1ht.fsf@gnu.org> <5055AD8E.5020309@yandex.ru> <83zk4qqj4d.fsf@gnu.org> <5055C0EB.3040908@yandex.ru> <83wqzuqgzr.fsf@gnu.org> <5055D34F.1040800@yandex.ru> <83txuyqdtv.fsf@gnu.org> <5055E16E.1070604@yandex.ru> <83sjaiqaqb.fsf@gnu.org> <5055F69B.4020004@yandex.ru> <837grr1idg.fsf@gnu.org> <37946879-EFDD-4A81-8C98-893F1AE2FF90@swipnet.se> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 12447 Cc: 12447@debbugs.gnu.org, hanche@math.ntnu.no, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > From: Jan Dj=E4rv > Date: Tue, 18 Sep 2012 19:29:28 +0200 > Cc: Dmitry Gutov , > 12447@debbugs.gnu.org, > hanche@math.ntnu.no >=20 > > Jan, can you test whether this patch still keeps your two-timers > > recipe working? If it does, I think I should commit the changes > > below, because they avoid locking up Emacs by a timer that repeat= edly > > reinvokes itself. >=20 >=20 > It does. Thanks. Assuming js2-mode also works, I will wait for a few days to hear possible objections and comments, and commit then. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 18 20:28:31 2012 Received: (at 12447) by debbugs.gnu.org; 19 Sep 2012 00:28:31 +0000 Received: from localhost ([127.0.0.1]:42443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TE89W-0003Q6-Mv for submit@debbugs.gnu.org; Tue, 18 Sep 2012 20:28:31 -0400 Received: from forward13.mail.yandex.net ([95.108.130.120]:59547) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TE89T-0003Pv-9i for 12447@debbugs.gnu.org; Tue, 18 Sep 2012 20:28:29 -0400 Received: from smtp14.mail.yandex.net (smtp14.mail.yandex.net [95.108.131.192]) by forward13.mail.yandex.net (Yandex) with ESMTP id 411A5141DE6; Wed, 19 Sep 2012 04:27:03 +0400 (MSK) Received: from smtp14.mail.yandex.net (localhost [127.0.0.1]) by smtp14.mail.yandex.net (Yandex) with ESMTP id F32AE1B6075E; Wed, 19 Sep 2012 04:27:02 +0400 (MSK) Received: from 5x166x246x245.dynamic.spb.ertelecom.ru (5x166x246x245.dynamic.spb.ertelecom.ru [5.166.246.245]) by smtp14.mail.yandex.net (nwsmtp/Yandex) with ESMTP id R2O0bVeC-R2Oa1lY1; Wed, 19 Sep 2012 04:27:02 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1348014422; bh=60/wgOQvHgsYM/YxBfTCFhbL7L6pMWfIIf20RSwCkxA=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=hRMItOg9PLkWdr+ZecSjqOhbC39hSkgs21JrcPrRNCi96LeOl3rU2VALymOtnBzzG BtHzCakfABJXu/SpCgtzICC4vq5X9XvEtgJLaZa16k3HRWhyYunrkVd7shqKpP0x9g B4lO+YzwW90RrqQyAa/NDZn+5PAeYavcVa46F/C0= Message-ID: <5059115B.8010407@yandex.ru> Date: Wed, 19 Sep 2012 04:27:07 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X References: <505598C8.8070904@yandex.ru> <834nmys1ht.fsf@gnu.org> <5055AD8E.5020309@yandex.ru> <83zk4qqj4d.fsf@gnu.org> <5055C0EB.3040908@yandex.ru> <83wqzuqgzr.fsf@gnu.org> <5055D34F.1040800@yandex.ru> <83txuyqdtv.fsf@gnu.org> <5055E16E.1070604@yandex.ru> <83sjaiqaqb.fsf@gnu.org> <5055F69B.4020004@yandex.ru> <837grr1idg.fsf@gnu.org> In-Reply-To: <837grr1idg.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 12447 Cc: =?ISO-8859-1?Q?Jan_Dj=E4rv?= , hanche@math.ntnu.no, 12447@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 18.09.2012 19:05, Eli Zaretskii wrote: > The patch below makes your simplified recipe, viz.: > > (defvar counter 0) > > (defun foo () > (message (format "foo %s" counter)) > (setq counter (1+ counter)) > (run-with-idle-timer 1 nil #'foo)) > (foo) > > "work" without locking up Emacs. "Work" in the sense that the timer > is run and increments the counter, but keyboard input is still > accepted, and causes 1-sec break in the idle timer invocation. What > does NOT happen is the once-per-second invocation of the idle timer: > as long as there's no other input, the idle timer runs much more > frequently. But I think this is expected, since the call to > run-with-idle-timer above explicitly asks to be run immediately. I think this behavior makes sense, too. > Can you see if these changes also make js2-mode work as expected? They do, thank you. I'll keep the workaround, though, as it reportedly also fixes the long-standing OS X freeze bug. --Dmitry From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 18 22:56:09 2012 Received: (at 12447) by debbugs.gnu.org; 19 Sep 2012 02:56:09 +0000 Received: from localhost ([127.0.0.1]:42515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TEASO-0006gj-HC for submit@debbugs.gnu.org; Tue, 18 Sep 2012 22:56:09 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:61789) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TEASL-0006gb-LQ for 12447@debbugs.gnu.org; Tue, 18 Sep 2012 22:56:07 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MAK00G00TAXSA00@a-mtaout20.012.net.il> for 12447@debbugs.gnu.org; Wed, 19 Sep 2012 05:54:28 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAK00GIHTESL890@a-mtaout20.012.net.il>; Wed, 19 Sep 2012 05:54:28 +0300 (IDT) Date: Wed, 19 Sep 2012 05:54:39 +0300 From: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X In-reply-to: <5059115B.8010407@yandex.ru> To: Dmitry Gutov Message-id: <83txuuzpqo.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: QUOTED-PRINTABLE X-012-Sender: halo1@inter.net.il References: <505598C8.8070904@yandex.ru> <834nmys1ht.fsf@gnu.org> <5055AD8E.5020309@yandex.ru> <83zk4qqj4d.fsf@gnu.org> <5055C0EB.3040908@yandex.ru> <83wqzuqgzr.fsf@gnu.org> <5055D34F.1040800@yandex.ru> <83txuyqdtv.fsf@gnu.org> <5055E16E.1070604@yandex.ru> <83sjaiqaqb.fsf@gnu.org> <5055F69B.4020004@yandex.ru> <837grr1idg.fsf@gnu.org> <5059115B.8010407@yandex.ru> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 12447 Cc: jan.h.d@swipnet.se, hanche@math.ntnu.no, 12447@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Wed, 19 Sep 2012 04:27:07 +0400 > From: Dmitry Gutov > CC: Jan Dj=E4rv ,=20 > 12447@debbugs.gnu.org, hanche@math.ntnu.no >=20 > > Can you see if these changes also make js2-mode work as expected? >=20 > They do, thank you. Thanks for testing. > I'll keep the workaround, though, as it reportedly also fixes the > long-standing OS X freeze bug. What workaround is that? From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 19 03:42:42 2012 Received: (at 12447) by debbugs.gnu.org; 19 Sep 2012 07:42:42 +0000 Received: from localhost ([127.0.0.1]:42832 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TEEvh-0007Jp-3K for submit@debbugs.gnu.org; Wed, 19 Sep 2012 03:42:42 -0400 Received: from hylle02.itea.ntnu.no ([129.241.56.101]:40213) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TEEvd-0007JV-FL for 12447@debbugs.gnu.org; Wed, 19 Sep 2012 03:42:39 -0400 Received: from localhost (localhost [127.0.0.1]) by hylle02.itea.ntnu.no (Postfix) with ESMTP id 982391280E2 for <12447@debbugs.gnu.org>; Wed, 19 Sep 2012 09:41:11 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at hylle02.itea.ntnu.no Received: from anne.math.ntnu.no (anne.math.ntnu.no [129.241.15.150]) by hylle02.itea.ntnu.no (Postfix) with SMTP id 0133468027 for <12447@debbugs.gnu.org>; Wed, 19 Sep 2012 09:41:11 +0200 (CEST) Received: (qmail 15125 invoked from network); 19 Sep 2012 07:41:10 -0000 Received: from gauss.math.ntnu.no (HELO localhost) (hanche@129.241.15.58) by anne.math.ntnu.no with ESMTPA; 19 Sep 2012 07:41:10 -0000 Date: Wed, 19 Sep 2012 09:41:10 +0200 (CEST) Message-Id: <20120919.094110.135296827301142480.hanche@math.ntnu.no> To: eliz@gnu.org Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X From: Harald Hanche-Olsen In-Reply-To: <83txuuzpqo.fsf@gnu.org> References: <837grr1idg.fsf@gnu.org> <5059115B.8010407@yandex.ru> <83txuuzpqo.fsf@gnu.org> X-URL: http://www.math.ntnu.no/~hanche/ X-Mailer: Mew version 6.5 on Emacs 24.2.50 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -4.7 (----) X-Debbugs-Envelope-To: 12447 Cc: jan.h.d@swipnet.se, 12447@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.7 (----) [Eli Zaretskii (2012-09-19 02:54:39 UTC)] > > Date: Wed, 19 Sep 2012 04:27:07 +0400 > > From: Dmitry Gutov > > CC: Jan Dj=E4rv ,=20 > > 12447@debbugs.gnu.org, hanche@math.ntnu.no > >=20 > > I'll keep the workaround, though, as it reportedly also fixes the > > long-standing OS X freeze bug. >=20 > What workaround is that? Perhaps he meant backing out of 109470. FWIW, I am now running with your patch applied, and 109470 reinstated, and sending messages with big attachments now works without a hitch. - Harald From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 19 05:56:10 2012 Received: (at 12447) by debbugs.gnu.org; 19 Sep 2012 09:56:10 +0000 Received: from localhost ([127.0.0.1]:42935 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TEH0s-0002jB-9l for submit@debbugs.gnu.org; Wed, 19 Sep 2012 05:56:10 -0400 Received: from forward14.mail.yandex.net ([95.108.130.92]:54503) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TEH0o-0002j1-IP for 12447@debbugs.gnu.org; Wed, 19 Sep 2012 05:56:08 -0400 Received: from smtp12.mail.yandex.net (smtp12.mail.yandex.net [95.108.131.191]) by forward14.mail.yandex.net (Yandex) with ESMTP id 05B501981FAE; Wed, 19 Sep 2012 13:54:39 +0400 (MSK) Received: from smtp12.mail.yandex.net (localhost [127.0.0.1]) by smtp12.mail.yandex.net (Yandex) with ESMTP id B377916A02A4; Wed, 19 Sep 2012 13:54:39 +0400 (MSK) Received: from 5x166x246x245.dynamic.spb.ertelecom.ru (5x166x246x245.dynamic.spb.ertelecom.ru [5.166.246.245]) by smtp12.mail.yandex.net (nwsmtp/Yandex) with ESMTP id scwauKOv-sdwmQDo6; Wed, 19 Sep 2012 13:54:39 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1348048479; bh=BsSmLUtJ/bqHoWg1L+uqthnky+PpoWcsoYCEodnfbw4=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=cWGUg3HbNuU4AVTX6Ebl9enqku4Bt9ojTXCnHTTkFFmuyJi6aijsUnMcgFB0r3MgS D6FxaacwUca7uWU8AjpLlbmew3QsQoKfG9l8QSRJelmGdr7eOUGTP3jnF2oWAhS+4y 0FQEupDwIlidCafQKnlnVDQDc1dmaVbK6fwiDNOE= Message-ID: <5059965F.5030708@yandex.ru> Date: Wed, 19 Sep 2012 13:54:39 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X References: <505598C8.8070904@yandex.ru> <834nmys1ht.fsf@gnu.org> <5055AD8E.5020309@yandex.ru> <83zk4qqj4d.fsf@gnu.org> <5055C0EB.3040908@yandex.ru> <83wqzuqgzr.fsf@gnu.org> <5055D34F.1040800@yandex.ru> <83txuyqdtv.fsf@gnu.org> <5055E16E.1070604@yandex.ru> <83sjaiqaqb.fsf@gnu.org> <5055F69B.4020004@yandex.ru> <837grr1idg.fsf@gnu.org> <5059115B.8010407@yandex.ru> <83txuuzpqo.fsf@gnu.org> In-Reply-To: <83txuuzpqo.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 12447 Cc: jan.h.d@swipnet.se, hanche@math.ntnu.no, 12447@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 19.09.2012 6:54, Eli Zaretskii wrote: >> I'll keep the workaround, though, as it reportedly also fixes the >> long-standing OS X freeze bug. > > What workaround is that? The one I posted in #12326: calling timer-activate-when-idle with nil DONT-WAIT argument. https://github.com/mooz/js2-mode/commit/b02f4a0d72d0e2087038fe891e2580c4505415ef From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 19 11:23:07 2012 Received: (at 12447) by debbugs.gnu.org; 19 Sep 2012 15:23:07 +0000 Received: from localhost ([127.0.0.1]:43748 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TEM7H-0002ed-G8 for submit@debbugs.gnu.org; Wed, 19 Sep 2012 11:23:07 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:37864) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TEM7E-0002eU-9K for 12447@debbugs.gnu.org; Wed, 19 Sep 2012 11:23:05 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MAL00300ROLJI00@a-mtaout20.012.net.il> for 12447@debbugs.gnu.org; Wed, 19 Sep 2012 18:21:15 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAL003BXRZFA170@a-mtaout20.012.net.il>; Wed, 19 Sep 2012 18:21:15 +0300 (IDT) Date: Wed, 19 Sep 2012 18:21:27 +0300 From: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X In-reply-to: <20120919.094110.135296827301142480.hanche@math.ntnu.no> To: Harald Hanche-Olsen Message-id: <83pq5iyr60.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: QUOTED-PRINTABLE X-012-Sender: halo1@inter.net.il References: <837grr1idg.fsf@gnu.org> <5059115B.8010407@yandex.ru> <83txuuzpqo.fsf@gnu.org> <20120919.094110.135296827301142480.hanche@math.ntnu.no> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 12447 Cc: jan.h.d@swipnet.se, 12447@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Wed, 19 Sep 2012 09:41:10 +0200 (CEST) > Cc: dgutov@yandex.ru, jan.h.d@swipnet.se, 12447@debbugs.gnu.org > From: Harald Hanche-Olsen >=20 > [Eli Zaretskii (2012-09-19 02:54:39 UTC)] >=20 > > > Date: Wed, 19 Sep 2012 04:27:07 +0400 > > > From: Dmitry Gutov > > > CC: Jan Dj=E4rv ,=20 > > > 12447@debbugs.gnu.org, hanche@math.ntnu.no > > >=20 > > > I'll keep the workaround, though, as it reportedly also fixes t= he > > > long-standing OS X freeze bug. > >=20 > > What workaround is that? >=20 > Perhaps he meant backing out of 109470. I don't think it should be backed out. > FWIW, I am now running with your patch applied, and 109470 reinstat= ed, > and sending messages with big attachments now works without a hitch= . Thanks. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 19 11:26:05 2012 Received: (at 12447) by debbugs.gnu.org; 19 Sep 2012 15:26:06 +0000 Received: from localhost ([127.0.0.1]:43764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TEMA9-0002jF-Lc for submit@debbugs.gnu.org; Wed, 19 Sep 2012 11:26:05 -0400 Received: from mtaout21.012.net.il ([80.179.55.169]:44076) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TEMA7-0002j7-4V for 12447@debbugs.gnu.org; Wed, 19 Sep 2012 11:26:04 -0400 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MAL00H00S3WVV00@a-mtaout21.012.net.il> for 12447@debbugs.gnu.org; Wed, 19 Sep 2012 18:24:07 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAL00HQSS46RZ30@a-mtaout21.012.net.il>; Wed, 19 Sep 2012 18:24:07 +0300 (IDT) Date: Wed, 19 Sep 2012 18:24:18 +0300 From: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X In-reply-to: <5059965F.5030708@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <83obl2yr19.fsf@gnu.org> References: <505598C8.8070904@yandex.ru> <834nmys1ht.fsf@gnu.org> <5055AD8E.5020309@yandex.ru> <83zk4qqj4d.fsf@gnu.org> <5055C0EB.3040908@yandex.ru> <83wqzuqgzr.fsf@gnu.org> <5055D34F.1040800@yandex.ru> <83txuyqdtv.fsf@gnu.org> <5055E16E.1070604@yandex.ru> <83sjaiqaqb.fsf@gnu.org> <5055F69B.4020004@yandex.ru> <837grr1idg.fsf@gnu.org> <5059115B.8010407@yandex.ru> <83txuuzpqo.fsf@gnu.org> <5059965F.5030708@yandex.ru> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 12447 Cc: jan.h.d@swipnet.se, hanche@math.ntnu.no, 12447@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Wed, 19 Sep 2012 13:54:39 +0400 > From: Dmitry Gutov > CC: jan.h.d@swipnet.se, 12447@debbugs.gnu.org, hanche@math.ntnu.no > > On 19.09.2012 6:54, Eli Zaretskii wrote: > >> I'll keep the workaround, though, as it reportedly also fixes the > >> long-standing OS X freeze bug. > > > > What workaround is that? > > The one I posted in #12326: calling timer-activate-when-idle with nil > DONT-WAIT argument. I don't think that's a workaround. I think that's what js2 should do, if (AFAIU) it wants the timer handler be invoked once, after Emacs has been idle for more than 1 sec. > https://github.com/mooz/js2-mode/commit/b02f4a0d72d0e2087038fe891e2580c4505415ef Btw, in this line: (timer-activate-when-idle timer nil))) I think you can lose the last argument, since it is optional anyway. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 19 12:23:07 2012 Received: (at 12447) by debbugs.gnu.org; 19 Sep 2012 16:23:07 +0000 Received: from localhost ([127.0.0.1]:43863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TEN3K-00046n-MB for submit@debbugs.gnu.org; Wed, 19 Sep 2012 12:23:06 -0400 Received: from forward11.mail.yandex.net ([95.108.130.93]:39378) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TEN3G-00046M-PL for 12447@debbugs.gnu.org; Wed, 19 Sep 2012 12:23:05 -0400 Received: from smtp13.mail.yandex.net (smtp13.mail.yandex.net [95.108.130.68]) by forward11.mail.yandex.net (Yandex) with ESMTP id 6138CE82D94; Wed, 19 Sep 2012 20:21:31 +0400 (MSK) Received: from smtp13.mail.yandex.net (localhost [127.0.0.1]) by smtp13.mail.yandex.net (Yandex) with ESMTP id 19E8BE40517; Wed, 19 Sep 2012 20:21:31 +0400 (MSK) Received: from 5x166x246x245.dynamic.spb.ertelecom.ru (5x166x246x245.dynamic.spb.ertelecom.ru [5.166.246.245]) by smtp13.mail.yandex.net (nwsmtp/Yandex) with ESMTP id LUW4uXQT-LUWGSsSi; Wed, 19 Sep 2012 20:21:30 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1348071691; bh=5qMU3zvRm8sXIu2XFtG+1ooGZUfqXVpPwn956OmqAWQ=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=OkDTLCT1m7hHriuBkXHy23pVkMmRAEcwFoM6dsGwarcYzEvepNO09NY5vBNzFGn0N n3CFfOGHA1dVV1ewq9GIy+LzDd90Cx5I77lEGoy9gfi9buk/K8VWX+biD0Al1pbxJY KJGKKLyQn6dZ51Q710lwrhmBivbbeWIfOVy1URO4= Message-ID: <5059F10C.6070806@yandex.ru> Date: Wed, 19 Sep 2012 20:21:32 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X References: <505598C8.8070904@yandex.ru> <834nmys1ht.fsf@gnu.org> <5055AD8E.5020309@yandex.ru> <83zk4qqj4d.fsf@gnu.org> <5055C0EB.3040908@yandex.ru> <83wqzuqgzr.fsf@gnu.org> <5055D34F.1040800@yandex.ru> <83txuyqdtv.fsf@gnu.org> <5055E16E.1070604@yandex.ru> <83sjaiqaqb.fsf@gnu.org> <5055F69B.4020004@yandex.ru> <837grr1idg.fsf@gnu.org> <5059115B.8010407@yandex.ru> <83txuuzpqo.fsf@gnu.org> <5059965F.5030708@yandex.ru> <83obl2yr19.fsf@gnu.org> In-Reply-To: <83obl2yr19.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 12447 Cc: jan.h.d@swipnet.se, hanche@math.ntnu.no, 12447@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 19.09.2012 19:24, Eli Zaretskii wrote: >> Date: Wed, 19 Sep 2012 13:54:39 +0400 >> From: Dmitry Gutov >> CC: jan.h.d@swipnet.se, 12447@debbugs.gnu.org, hanche@math.ntnu.no >> >> On 19.09.2012 6:54, Eli Zaretskii wrote: >>>> I'll keep the workaround, though, as it reportedly also fixes the >>>> long-standing OS X freeze bug. >>> >>> What workaround is that? >> >> The one I posted in #12326: calling timer-activate-when-idle with nil >> DONT-WAIT argument. > > I don't think that's a workaround. I think that's what js2 should do, > if (AFAIU) it wants the timer handler be invoked once, after Emacs has > been idle for more than 1 sec. Maybe, but run-with-idle-timer calls it with DONT-WAIT t, and js2-mode-reset-timer is only supposed to be called in response to some user action. So with your patch, it works effectively the same either way. By the way, here's what run-with-idle-timer docstring says: "Perform an action the next time Emacs is idle for SECS seconds." Shouldn't this mean that it should also pass DONT-WAIT nil? Below that, the docstring mentions what will happen if Emacs has been idle for N seconds (N < SECS), but doesn't clarify that if N => SECS, it will fire immediately. >> https://github.com/mooz/js2-mode/commit/b02f4a0d72d0e2087038fe891e2580c4505415ef > > Btw, in this line: > > (timer-activate-when-idle timer nil))) > > I think you can lose the last argument, since it is optional anyway. Sure, I wrote it that way just to be explicit. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 19 12:40:18 2012 Received: (at 12447) by debbugs.gnu.org; 19 Sep 2012 16:40:18 +0000 Received: from localhost ([127.0.0.1]:43882 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TENJy-0004X8-2B for submit@debbugs.gnu.org; Wed, 19 Sep 2012 12:40:18 -0400 Received: from mtaout23.012.net.il ([80.179.55.175]:37394) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TENJu-0004Wu-Ds for 12447@debbugs.gnu.org; Wed, 19 Sep 2012 12:40:15 -0400 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0MAL00L00VGPGA00@a-mtaout23.012.net.il> for 12447@debbugs.gnu.org; Wed, 19 Sep 2012 19:38:45 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAL00LCLVKLBG40@a-mtaout23.012.net.il>; Wed, 19 Sep 2012 19:38:45 +0300 (IDT) Date: Wed, 19 Sep 2012 19:38:57 +0300 From: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X In-reply-to: <5059F10C.6070806@yandex.ru> X-012-Sender: halo1@inter.net.il To: Dmitry Gutov Message-id: <83ipbaynku.fsf@gnu.org> References: <505598C8.8070904@yandex.ru> <834nmys1ht.fsf@gnu.org> <5055AD8E.5020309@yandex.ru> <83zk4qqj4d.fsf@gnu.org> <5055C0EB.3040908@yandex.ru> <83wqzuqgzr.fsf@gnu.org> <5055D34F.1040800@yandex.ru> <83txuyqdtv.fsf@gnu.org> <5055E16E.1070604@yandex.ru> <83sjaiqaqb.fsf@gnu.org> <5055F69B.4020004@yandex.ru> <837grr1idg.fsf@gnu.org> <5059115B.8010407@yandex.ru> <83txuuzpqo.fsf@gnu.org> <5059965F.5030708@yandex.ru> <83obl2yr19.fsf@gnu.org> <5059F10C.6070806@yandex.ru> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 12447 Cc: jan.h.d@swipnet.se, hanche@math.ntnu.no, 12447@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Wed, 19 Sep 2012 20:21:32 +0400 > From: Dmitry Gutov > CC: jan.h.d@swipnet.se, 12447@debbugs.gnu.org, hanche@math.ntnu.no > > By the way, here's what run-with-idle-timer docstring says: > "Perform an action the next time Emacs is idle for SECS seconds." > > Shouldn't this mean that it should also pass DONT-WAIT nil? No, it just means no one considered the possibility that an idle timer will re-invoke itself like that. IOW, the doc string is inaccurate. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 19 14:31:28 2012 Received: (at 12447) by debbugs.gnu.org; 19 Sep 2012 18:31:28 +0000 Received: from localhost ([127.0.0.1]:43964 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TEP3X-00076T-KL for submit@debbugs.gnu.org; Wed, 19 Sep 2012 14:31:27 -0400 Received: from forward7.mail.yandex.net ([77.88.61.37]:41426) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TEP3V-00076J-3I for 12447@debbugs.gnu.org; Wed, 19 Sep 2012 14:31:25 -0400 Received: from smtp6.mail.yandex.net (smtp6.mail.yandex.net [77.88.61.56]) by forward7.mail.yandex.net (Yandex) with ESMTP id 556671C1EA6; Wed, 19 Sep 2012 22:29:56 +0400 (MSK) Received: from smtp6.mail.yandex.net (localhost [127.0.0.1]) by smtp6.mail.yandex.net (Yandex) with ESMTP id 10C5A164033B; Wed, 19 Sep 2012 22:29:56 +0400 (MSK) Received: from 5x166x246x245.dynamic.spb.ertelecom.ru (5x166x246x245.dynamic.spb.ertelecom.ru [5.166.246.245]) by smtp6.mail.yandex.net (nwsmtp/Yandex) with ESMTP id TtO0Y8XS-TtO8PmAA; Wed, 19 Sep 2012 22:29:55 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1348079396; bh=ZORt/btuii3VVsRXr9GBFZ8Bmsd4PTsYCAHXJy22wBg=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=mgDa1mVdUHvttV0S7qkqinAXIQaxIr/+JwPu7XTKpHBOlG1cxsDFGhejHej7+6rpV OzbgLDakAU23CzGudv2UVSnQf0TGnyXDpaeSR3oq7qZUyVz53niEFjEEPsv+Mteb3H mRQdrnNqqa++Y6LTbom8QODQ7WlZ0biWA//fT3y0= Message-ID: <505A0F26.4050303@yandex.ru> Date: Wed, 19 Sep 2012 22:29:58 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X References: <505598C8.8070904@yandex.ru> <834nmys1ht.fsf@gnu.org> <5055AD8E.5020309@yandex.ru> <83zk4qqj4d.fsf@gnu.org> <5055C0EB.3040908@yandex.ru> <83wqzuqgzr.fsf@gnu.org> <5055D34F.1040800@yandex.ru> <83txuyqdtv.fsf@gnu.org> <5055E16E.1070604@yandex.ru> <83sjaiqaqb.fsf@gnu.org> <5055F69B.4020004@yandex.ru> <837grr1idg.fsf@gnu.org> <5059115B.8010407@yandex.ru> <83txuuzpqo.fsf@gnu.org> <5059965F.5030708@yandex.ru> <83obl2yr19.fsf@gnu.org> <5059F10C.6070806@yandex.ru> <83ipbaynku.fsf@gnu.org> In-Reply-To: <83ipbaynku.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 12447 Cc: jan.h.d@swipnet.se, hanche@math.ntnu.no, 12447@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 19.09.2012 20:38, Eli Zaretskii wrote: >> Date: Wed, 19 Sep 2012 20:21:32 +0400 >> From: Dmitry Gutov >> CC: jan.h.d@swipnet.se, 12447@debbugs.gnu.org, hanche@math.ntnu.no >> >> By the way, here's what run-with-idle-timer docstring says: >> "Perform an action the next time Emacs is idle for SECS seconds." >> >> Shouldn't this mean that it should also pass DONT-WAIT nil? > > No, it just means no one considered the possibility that an idle timer > will re-invoke itself like that. IOW, the doc string is inaccurate. Okay. Could you fix it? From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 20 00:06:32 2012 Received: (at 12447) by debbugs.gnu.org; 20 Sep 2012 04:06:32 +0000 Received: from localhost ([127.0.0.1]:44368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TEY22-0004Om-R9 for submit@debbugs.gnu.org; Thu, 20 Sep 2012 00:06:32 -0400 Received: from mail-pb0-f44.google.com ([209.85.160.44]:42218) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TEY1z-0004Od-IJ for 12447@debbugs.gnu.org; Thu, 20 Sep 2012 00:06:28 -0400 Received: by pbbjt11 with SMTP id jt11so1755424pbb.3 for <12447@debbugs.gnu.org>; Wed, 19 Sep 2012 21:04:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=/WZEyd1fC5XlB4UoVnGk40Uf4tDRyNRLklKxgEBhTdg=; b=DJwtezf7s2kr8MWxh1wFcYUWxlzVFR/vyM8ov0Id4vezZWwL6CmHfxK2Z3GrlHIebN Jx34xVcYqqg/Deo6B8HmklPNjh/OPVwFf4XDWqWDpj31516tgT/c/gt597j2M7UembEa WUUqjQnptGovo4YJGhe5zSQrbqaXGEmHcxibeTpz3kANTgvNAWyKn3Q5PxxLwF/bkVGU xnzWs5vm+4+7avtG0gUOBiX89k6vAcYq5CayP+sc2pB9N4aUifTP6ES5EYVE3vN+LDVd pJllOF9g+jI+mHTU4cmBw4zC7in8TmIi68QpBPj9JYjf2pQuqBE1wEr29wndSIEe9udW MWvg== Received: by 10.66.82.3 with SMTP id e3mr2104301pay.56.1348113897384; Wed, 19 Sep 2012 21:04:57 -0700 (PDT) Received: from ulysses ([155.69.19.102]) by mx.google.com with ESMTPS id rz10sm2858552pbc.32.2012.09.19.21.04.53 (version=SSLv3 cipher=OTHER); Wed, 19 Sep 2012 21:04:56 -0700 (PDT) From: Chong Yidong To: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X References: <505598C8.8070904@yandex.ru> <834nmys1ht.fsf@gnu.org> <5055AD8E.5020309@yandex.ru> <83zk4qqj4d.fsf@gnu.org> <5055C0EB.3040908@yandex.ru> <83wqzuqgzr.fsf@gnu.org> <5055D34F.1040800@yandex.ru> <83txuyqdtv.fsf@gnu.org> <5055E16E.1070604@yandex.ru> <83sjaiqaqb.fsf@gnu.org> <5055F69B.4020004@yandex.ru> <837grr1idg.fsf@gnu.org> <5059115B.8010407@yandex.ru> <83txuuzpqo.fsf@gnu.org> <5059965F.5030708@yandex.ru> <83obl2yr19.fsf@gnu.org> <5059F10C.6070806@yandex.ru> <83ipbaynku.fsf@gnu.org> Date: Thu, 20 Sep 2012 12:04:51 +0800 In-Reply-To: <83ipbaynku.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 19 Sep 2012 19:38:57 +0300") Message-ID: <87a9wlz6e4.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 12447 Cc: 12447@debbugs.gnu.org, hanche@math.ntnu.no, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Eli Zaretskii writes: >> Date: Wed, 19 Sep 2012 20:21:32 +0400 >> From: Dmitry Gutov >> CC: jan.h.d@swipnet.se, 12447@debbugs.gnu.org, hanche@math.ntnu.no >> >> By the way, here's what run-with-idle-timer docstring says: >> "Perform an action the next time Emacs is idle for SECS seconds." >> >> Shouldn't this mean that it should also pass DONT-WAIT nil? > > No, it just means no one considered the possibility that an idle timer > will re-invoke itself like that. IOW, the doc string is inaccurate. I'm not 100% sure this is merely a doc string problem. In the face of ambiguity, we should try to choose the behavior that is least likely to lead to infloops in user code. When `run-with-idle-timer' is called from an idle timer, we could interpret it to mean "run the function the next time Emacs becomes idle for SECS seconds, not including the current period of idleness". Such behavior seems quite reasonable. And it is of course easy to implement, by simply making `run-with-idle-timer' check if it is running while idle and, if so, giving a nil second arg to `timer-activate-by-idle'. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 20 12:03:08 2012 Received: (at 12447) by debbugs.gnu.org; 20 Sep 2012 16:03:08 +0000 Received: from localhost ([127.0.0.1]:45375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TEjDX-0004fj-Pg for submit@debbugs.gnu.org; Thu, 20 Sep 2012 12:03:08 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:64296) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TEjDU-0004fZ-Ql for 12447@debbugs.gnu.org; Thu, 20 Sep 2012 12:03:06 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MAN00500OENP800@a-mtaout22.012.net.il> for 12447@debbugs.gnu.org; Thu, 20 Sep 2012 19:01:06 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAN005IVOHTKQ30@a-mtaout22.012.net.il>; Thu, 20 Sep 2012 19:01:06 +0300 (IDT) Date: Thu, 20 Sep 2012 19:01:20 +0300 From: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X In-reply-to: <87a9wlz6e4.fsf@gnu.org> X-012-Sender: halo1@inter.net.il To: Chong Yidong Message-id: <83ehlwznsf.fsf@gnu.org> References: <505598C8.8070904@yandex.ru> <834nmys1ht.fsf@gnu.org> <5055AD8E.5020309@yandex.ru> <83zk4qqj4d.fsf@gnu.org> <5055C0EB.3040908@yandex.ru> <83wqzuqgzr.fsf@gnu.org> <5055D34F.1040800@yandex.ru> <83txuyqdtv.fsf@gnu.org> <5055E16E.1070604@yandex.ru> <83sjaiqaqb.fsf@gnu.org> <5055F69B.4020004@yandex.ru> <837grr1idg.fsf@gnu.org> <5059115B.8010407@yandex.ru> <83txuuzpqo.fsf@gnu.org> <5059965F.5030708@yandex.ru> <83obl2yr19.fsf@gnu.org> <5059F10C.6070806@yandex.ru> <83ipbaynku.fsf@gnu.org> <87a9wlz6e4.fsf@gnu.org> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 12447 Cc: 12447@debbugs.gnu.org, hanche@math.ntnu.no, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > From: Chong Yidong > Cc: Dmitry Gutov , hanche@math.ntnu.no, 12447@debbugs.gnu.org > Date: Thu, 20 Sep 2012 12:04:51 +0800 > > Eli Zaretskii writes: > > >> Date: Wed, 19 Sep 2012 20:21:32 +0400 > >> From: Dmitry Gutov > >> CC: jan.h.d@swipnet.se, 12447@debbugs.gnu.org, hanche@math.ntnu.no > >> > >> By the way, here's what run-with-idle-timer docstring says: > >> "Perform an action the next time Emacs is idle for SECS seconds." > >> > >> Shouldn't this mean that it should also pass DONT-WAIT nil? > > > > No, it just means no one considered the possibility that an idle timer > > will re-invoke itself like that. IOW, the doc string is inaccurate. > > I'm not 100% sure this is merely a doc string problem. In the face of > ambiguity, we should try to choose the behavior that is least likely to > lead to infloops in user code. There's no infloop with my patch. Assuming that no one comes with a loop in a couple of days, I will install that, and this particular issue will be gone. In general, I think we should prefer solutions that allow Lisp programmers or users do dumb things (and sometimes get dumb results), without wedging Emacs. Restricting what Lisp can do because someone dumb could wedge Emacs runs a risk of punishing the innocent lot because of a guilty (or dumb) few. > When `run-with-idle-timer' is called from an idle timer, we could > interpret it to mean "run the function the next time Emacs becomes idle > for SECS seconds, not including the current period of idleness". I could think of some legitimate uses of the current behavior, though. For example, imagine an idle timer that gets run after 1 sec of idleness, does something quick and simple, and then calls itself or another time with a larger timeout value, at which time it will do something different, perhaps more complex. I see no reason to forcibly prevent such use cases. It is also in line with Emacs behavior since about forever. The possibility of an infloop was a side effect of another bugfix. With that possibility hopefully taken care of, we have no reason to change old behavior, which evidently at least one external package relies upon. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 20 23:33:38 2012 Received: (at 12447) by debbugs.gnu.org; 21 Sep 2012 03:33:38 +0000 Received: from localhost ([127.0.0.1]:45927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TEtzl-00047K-UC for submit@debbugs.gnu.org; Thu, 20 Sep 2012 23:33:38 -0400 Received: from mail-pb0-f44.google.com ([209.85.160.44]:37580) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TEtzi-00047B-CH for 12447@debbugs.gnu.org; Thu, 20 Sep 2012 23:33:35 -0400 Received: by pbbjt11 with SMTP id jt11so4271504pbb.3 for <12447@debbugs.gnu.org>; Thu, 20 Sep 2012 20:31:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=+i/HfFy50b8chu2wJY5fbDWsA4Bb5Yws+9nvdCNHd/g=; b=siemM81su7DPlsoqtogQRH0/ZEeQpALMet2riKkT7LBIf/hDRpWkbAkWzG/lD/hZ40 uPKj53a5/L9JF6PoBqRtU1Ke0vZ7Qj6+v714PrlW/OqMIPmajDoA5f3X3H78mpHySsQq pkFOJBn6Wp9bXb/r0ZeHjIp6qBXruJXxX26fasYJ99BNOtZDO7OHlHLoNx464TLJbPQp jqjI5pGtqzmMBNNldS2UiCqy13wTZyRYeC829htS4+PGPF8W0YD6dPqgq1FjNAqx5mtf Pc0m53zZJ03jyRbcKgp6Ew1GCYsGFnDou8Zp3kjj/wURRGNrLD99BU3pt0qCDl+I62s/ CCqA== Received: by 10.66.85.8 with SMTP id d8mr10088780paz.30.1348198318598; Thu, 20 Sep 2012 20:31:58 -0700 (PDT) Received: from ulysses ([155.69.19.149]) by mx.google.com with ESMTPS id kj10sm4427902pbc.72.2012.09.20.20.31.54 (version=SSLv3 cipher=OTHER); Thu, 20 Sep 2012 20:31:57 -0700 (PDT) From: Chong Yidong To: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X References: <505598C8.8070904@yandex.ru> <834nmys1ht.fsf@gnu.org> <5055AD8E.5020309@yandex.ru> <83zk4qqj4d.fsf@gnu.org> <5055C0EB.3040908@yandex.ru> <83wqzuqgzr.fsf@gnu.org> <5055D34F.1040800@yandex.ru> <83txuyqdtv.fsf@gnu.org> <5055E16E.1070604@yandex.ru> <83sjaiqaqb.fsf@gnu.org> <5055F69B.4020004@yandex.ru> <837grr1idg.fsf@gnu.org> <5059115B.8010407@yandex.ru> <83txuuzpqo.fsf@gnu.org> <5059965F.5030708@yandex.ru> <83obl2yr19.fsf@gnu.org> <5059F10C.6070806@yandex.ru> <83ipbaynku.fsf@gnu.org> <87a9wlz6e4.fsf@gnu.org> <83ehlwznsf.fsf@gnu.org> Date: Fri, 21 Sep 2012 11:31:51 +0800 In-Reply-To: <83ehlwznsf.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 20 Sep 2012 19:01:20 +0300") Message-ID: <87ipb8m4pk.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 12447 Cc: 12447@debbugs.gnu.org, hanche@math.ntnu.no, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Eli Zaretskii writes: >> When `run-with-idle-timer' is called from an idle timer, we could >> interpret it to mean "run the function the next time Emacs becomes idle >> for SECS seconds, not including the current period of idleness". > > I could think of some legitimate uses of the current behavior, though. > For example, imagine an idle timer that gets run after 1 sec of > idleness, does something quick and simple, and then calls itself or > another time with a larger timeout value, at which time it will do > something different, perhaps more complex. I see no reason to > forcibly prevent such use cases. It would still be possible to get the old behavior by calling lower-level timer functions used by `run-with-idle-timer'. > It is also in line with Emacs behavior since about forever. The > possibility of an infloop was a side effect of another bugfix. With > that possibility hopefully taken care of, we have no reason to change > old behavior, which evidently at least one external package relies > upon. What is the package that relies on the old behavior? From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 21 03:15:43 2012 Received: (at 12447) by debbugs.gnu.org; 21 Sep 2012 07:15:43 +0000 Received: from localhost ([127.0.0.1]:46044 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TExSh-0000iC-1p for submit@debbugs.gnu.org; Fri, 21 Sep 2012 03:15:43 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:49553) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TExSf-0000i5-Ed for 12447@debbugs.gnu.org; Fri, 21 Sep 2012 03:15:42 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MAO00400UQHX500@a-mtaout20.012.net.il> for 12447@debbugs.gnu.org; Fri, 21 Sep 2012 10:13:53 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAO004U7UR4W010@a-mtaout20.012.net.il>; Fri, 21 Sep 2012 10:13:53 +0300 (IDT) Date: Fri, 21 Sep 2012 10:14:08 +0300 From: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X In-reply-to: <87ipb8m4pk.fsf@gnu.org> X-012-Sender: halo1@inter.net.il To: Chong Yidong Message-id: <83r4pvyhj3.fsf@gnu.org> References: <505598C8.8070904@yandex.ru> <834nmys1ht.fsf@gnu.org> <5055AD8E.5020309@yandex.ru> <83zk4qqj4d.fsf@gnu.org> <5055C0EB.3040908@yandex.ru> <83wqzuqgzr.fsf@gnu.org> <5055D34F.1040800@yandex.ru> <83txuyqdtv.fsf@gnu.org> <5055E16E.1070604@yandex.ru> <83sjaiqaqb.fsf@gnu.org> <5055F69B.4020004@yandex.ru> <837grr1idg.fsf@gnu.org> <5059115B.8010407@yandex.ru> <83txuuzpqo.fsf@gnu.org> <5059965F.5030708@yandex.ru> <83obl2yr19.fsf@gnu.org> <5059F10C.6070806@yandex.ru> <83ipbaynku.fsf@gnu.org> <87a9wlz6e4.fsf@gnu.org> <83ehlwznsf.fsf@gnu.org> <87ipb8m4pk.fsf@gnu.org> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 12447 Cc: 12447@debbugs.gnu.org, hanche@math.ntnu.no, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > From: Chong Yidong > Cc: dgutov@yandex.ru, hanche@math.ntnu.no, 12447@debbugs.gnu.org > Date: Fri, 21 Sep 2012 11:31:51 +0800 > > What is the package that relies on the old behavior? js2-mode, see bug #12326 (merged with this one). From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 21 05:11:42 2012 Received: (at 12447) by debbugs.gnu.org; 21 Sep 2012 09:11:42 +0000 Received: from localhost ([127.0.0.1]:46182 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TEzGv-0003Kq-K1 for submit@debbugs.gnu.org; Fri, 21 Sep 2012 05:11:42 -0400 Received: from mail-pb0-f44.google.com ([209.85.160.44]:41404) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TEzGs-0003Ki-K3 for 12447@debbugs.gnu.org; Fri, 21 Sep 2012 05:11:39 -0400 Received: by pbbjt11 with SMTP id jt11so4863613pbb.3 for <12447@debbugs.gnu.org>; Fri, 21 Sep 2012 02:10:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=kS2QF4N9Ox56XbtbaQIobQ04xiOS0AyB3FduvTkv1ws=; b=cddSONqvA8VO25YcWOT+3i5VeEb5CIYItFA4UajdusoTIT25jgPPhjvb7UICGgoS9u 7oJEzwdJ9hKzLd/zwiiFLR4avpvRPX2kVlL9iWonnFfBKLuAcZt3D4CY/oa63EUUL1pV 0sNzQUZcxu+Lb/fXuf4AgvtNCt2QZoEXSs+Phj+PUGM1mLNOf5uJes4v7DUhY2UYyEKJ w3lVSv0prdppWPBpdfi8/fumxtbGKGvW782tBCEA2iB6AMZayqxQkpmchrJCyFGwNCR/ OCWG5wnyXZC8AIB8BnUR1F63BKObOUjFeavVGV8npqdzVrH7lND7yQpYeIAEs+hu+icn l+mA== Received: by 10.68.224.69 with SMTP id ra5mr1972104pbc.114.1348218600669; Fri, 21 Sep 2012 02:10:00 -0700 (PDT) Received: from ulysses ([155.69.19.149]) by mx.google.com with ESMTPS id i2sm3844335pay.31.2012.09.21.02.09.57 (version=SSLv3 cipher=OTHER); Fri, 21 Sep 2012 02:09:59 -0700 (PDT) From: Chong Yidong To: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X References: <505598C8.8070904@yandex.ru> <5055AD8E.5020309@yandex.ru> <83zk4qqj4d.fsf@gnu.org> <5055C0EB.3040908@yandex.ru> <83wqzuqgzr.fsf@gnu.org> <5055D34F.1040800@yandex.ru> <83txuyqdtv.fsf@gnu.org> <5055E16E.1070604@yandex.ru> <83sjaiqaqb.fsf@gnu.org> <5055F69B.4020004@yandex.ru> <837grr1idg.fsf@gnu.org> <5059115B.8010407@yandex.ru> <83txuuzpqo.fsf@gnu.org> <5059965F.5030708@yandex.ru> <83obl2yr19.fsf@gnu.org> <5059F10C.6070806@yandex.ru> <83ipbaynku.fsf@gnu.org> <87a9wlz6e4.fsf@gnu.org> <83ehlwznsf.fsf@gnu.org> <87ipb8m4pk.fsf@gnu.org> <83r4pvyhj3.fsf@gnu.org> Date: Fri, 21 Sep 2012 17:09:54 +0800 In-Reply-To: <83r4pvyhj3.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 21 Sep 2012 10:14:08 +0300") Message-ID: <87lig3d9nh.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 12447 Cc: 12447@debbugs.gnu.org, hanche@math.ntnu.no, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Eli Zaretskii writes: >> What is the package that relies on the old behavior? > > js2-mode, see bug #12326 (merged with this one). I'm confused. You just said that js2-mode needed a code change: >> The one I posted in #12326: calling timer-activate-when-idle with nil >> DONT-WAIT argument. > > I don't think that's a workaround. I think that's what js2 should do, > if (AFAIU) it wants the timer handler be invoked once, after Emacs has > been idle for more than 1 sec. If I understand correctly, js2-mode (prior to the workaround) assumed the new behavior: it called run-with-idle-timer from inside the idle timer, with the same delay, with the intention of scheduling for the next period of idleness. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 21 05:56:16 2012 Received: (at 12447) by debbugs.gnu.org; 21 Sep 2012 09:56:16 +0000 Received: from localhost ([127.0.0.1]:46219 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TEzy4-0004K7-3f for submit@debbugs.gnu.org; Fri, 21 Sep 2012 05:56:16 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:48224) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TEzy1-0004Jy-Hx for 12447@debbugs.gnu.org; Fri, 21 Sep 2012 05:56:14 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MAP00F0025YJS00@a-mtaout22.012.net.il> for 12447@debbugs.gnu.org; Fri, 21 Sep 2012 12:54:06 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAP00FO3265JJ00@a-mtaout22.012.net.il>; Fri, 21 Sep 2012 12:54:06 +0300 (IDT) Date: Fri, 21 Sep 2012 12:54:22 +0300 From: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X In-reply-to: <87lig3d9nh.fsf@gnu.org> X-012-Sender: halo1@inter.net.il To: Chong Yidong Message-id: <83ipb7ya41.fsf@gnu.org> References: <505598C8.8070904@yandex.ru> <5055AD8E.5020309@yandex.ru> <83zk4qqj4d.fsf@gnu.org> <5055C0EB.3040908@yandex.ru> <83wqzuqgzr.fsf@gnu.org> <5055D34F.1040800@yandex.ru> <83txuyqdtv.fsf@gnu.org> <5055E16E.1070604@yandex.ru> <83sjaiqaqb.fsf@gnu.org> <5055F69B.4020004@yandex.ru> <837grr1idg.fsf@gnu.org> <5059115B.8010407@yandex.ru> <83txuuzpqo.fsf@gnu.org> <5059965F.5030708@yandex.ru> <83obl2yr19.fsf@gnu.org> <5059F10C.6070806@yandex.ru> <83ipbaynku.fsf@gnu.org> <87a9wlz6e4.fsf@gnu.org> <83ehlwznsf.fsf@gnu.org> <87ipb8m4pk.fsf@gnu.org> <83r4pvyhj3.fsf@gnu.org> <87lig3d9nh.fsf@gnu.org> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 12447 Cc: 12447@debbugs.gnu.org, hanche@math.ntnu.no, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > From: Chong Yidong > Cc: dgutov@yandex.ru, hanche@math.ntnu.no, 12447@debbugs.gnu.org > Date: Fri, 21 Sep 2012 17:09:54 +0800 > > Eli Zaretskii writes: > > >> What is the package that relies on the old behavior? > > > > js2-mode, see bug #12326 (merged with this one). > > I'm confused. You just said that js2-mode needed a code change: > > >> The one I posted in #12326: calling timer-activate-when-idle with nil > >> DONT-WAIT argument. > > > > I don't think that's a workaround. I think that's what js2 should do, > > if (AFAIU) it wants the timer handler be invoked once, after Emacs has > > been idle for more than 1 sec. > > If I understand correctly, js2-mode (prior to the workaround) assumed > the new behavior: it called run-with-idle-timer from inside the idle > timer, with the same delay, with the intention of scheduling for the > next period of idleness. I have no idea what js2-mode wants to do. What I wrote above was based on my limited reading of the code fragments posted to that bug. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 21 06:51:34 2012 Received: (at 12447) by debbugs.gnu.org; 21 Sep 2012 10:51:34 +0000 Received: from localhost ([127.0.0.1]:46291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TF0pZ-0005cw-Rc for submit@debbugs.gnu.org; Fri, 21 Sep 2012 06:51:34 -0400 Received: from forward18.mail.yandex.net ([95.108.253.143]:41816) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TF0pW-0005cn-6n for 12447@debbugs.gnu.org; Fri, 21 Sep 2012 06:51:32 -0400 Received: from smtp18.mail.yandex.net (smtp18.mail.yandex.net [95.108.252.18]) by forward18.mail.yandex.net (Yandex) with ESMTP id A8B201780D97; Fri, 21 Sep 2012 14:49:49 +0400 (MSK) Received: from smtp18.mail.yandex.net (localhost [127.0.0.1]) by smtp18.mail.yandex.net (Yandex) with ESMTP id 5FF3818A00EF; Fri, 21 Sep 2012 14:49:49 +0400 (MSK) Received: from 5x166x246x245.dynamic.spb.ertelecom.ru (5x166x246x245.dynamic.spb.ertelecom.ru [5.166.246.245]) by smtp18.mail.yandex.net (nwsmtp/Yandex) with ESMTP id nmHqVN3Q-nnHeuFTx; Fri, 21 Sep 2012 14:49:49 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1348224589; bh=bFMg9qDi1AUZla0xUgC34BRIsN2uOOiSj2pVCxmiX5w=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=AIoUCqG7kIvmnbNQcIElobi+922jyQc6HliGiaDosB33c4nMB7/tYJvSlF2QCRfYn eme1vIlo1cUMdOxJcwmuGrHdd4gHtbIMbjrvXrfa4ca15OuB1GezPkThZtMBE5v7Hm 4AdXHBSUgeWSRar/eW3svcUGsYcnoqXbHW1R+9lg= Message-ID: <505C464E.2020106@yandex.ru> Date: Fri, 21 Sep 2012 14:49:50 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Chong Yidong Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X References: <505598C8.8070904@yandex.ru> <5055AD8E.5020309@yandex.ru> <83zk4qqj4d.fsf@gnu.org> <5055C0EB.3040908@yandex.ru> <83wqzuqgzr.fsf@gnu.org> <5055D34F.1040800@yandex.ru> <83txuyqdtv.fsf@gnu.org> <5055E16E.1070604@yandex.ru> <83sjaiqaqb.fsf@gnu.org> <5055F69B.4020004@yandex.ru> <837grr1idg.fsf@gnu.org> <5059115B.8010407@yandex.ru> <83txuuzpqo.fsf@gnu.org> <5059965F.5030708@yandex.ru> <83obl2yr19.fsf@gnu.org> <5059F10C.6070806@yandex.ru> <83ipbaynku.fsf@gnu.org> <87a9wlz6e4.fsf@gnu.org> <83ehlwznsf.fsf@gnu.org> <87ipb8m4pk.fsf@gnu.org> <83r4pvyhj3.fsf@gnu.org> <87lig3d9nh.fsf@gnu.org> In-Reply-To: <87lig3d9nh.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 12447 Cc: Eli Zaretskii , 12447@debbugs.gnu.org, hanche@math.ntnu.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 21.09.2012 13:09, Chong Yidong wrote: > Eli Zaretskii writes: > >>> What is the package that relies on the old behavior? >> >> js2-mode, see bug #12326 (merged with this one). > > I'm confused. You just said that js2-mode needed a code change: > >>> The one I posted in #12326: calling timer-activate-when-idle with nil >>> DONT-WAIT argument. >> >> I don't think that's a workaround. I think that's what js2 should do, >> if (AFAIU) it wants the timer handler be invoked once, after Emacs has >> been idle for more than 1 sec. > > If I understand correctly, js2-mode (prior to the workaround) assumed > the new behavior: it called run-with-idle-timer from inside the idle > timer, with the same delay, with the intention of scheduling for the > next period of idleness. Like I mentioned, the new behavior makes more sense for it, but it worked almost the same with the old behavior until the infloop problem. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 21 10:28:05 2012 Received: (at 12447) by debbugs.gnu.org; 21 Sep 2012 14:28:06 +0000 Received: from localhost ([127.0.0.1]:47197 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TF4D7-00033T-NR for submit@debbugs.gnu.org; Fri, 21 Sep 2012 10:28:05 -0400 Received: from mail-pb0-f44.google.com ([209.85.160.44]:40898) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TF4D4-00033L-Ow for 12447@debbugs.gnu.org; Fri, 21 Sep 2012 10:28:03 -0400 Received: by pbbjt11 with SMTP id jt11so5423861pbb.3 for <12447@debbugs.gnu.org>; Fri, 21 Sep 2012 07:26:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=lFbia8S+xjDnuDuqnlBZ1YAL7bLODM1Xy8fHgkpM2mY=; b=pLp4mewCes9xHHRJyrhhbXICe1OS/NecYuOhBeVuaBBAfaz+ams15DUUreBtXBhFjA b9MejE/28YLmpaOARE744QOI6yDUsLW4x5ccWYsblpsifTgLH0DjjW+dK4EcvUisa6I1 QYFLgGQz0rsOpv0nOKecTG6ScIotNShYUxnxsBqDWzuLjIu/8FIjzi+G1R8k3v2SQHhG dMPO6tMn1niXb3riLnvmy7E2K5hxhV2Jd8GSJGZzIUVTIltrOLF8c9LP162HOtR5P6kw +IfVVc4+FAKJZj9qxzGVSA3/pRDciklQJZyjca9HN586e0bxWk7Rb6vAqRD4V+JVqmCU XKjg== Received: by 10.66.77.170 with SMTP id t10mr13885597paw.0.1348237583585; Fri, 21 Sep 2012 07:26:23 -0700 (PDT) Received: from ulysses (cm162.gamma80.maxonline.com.sg. [202.156.80.162]) by mx.google.com with ESMTPS id b6sm4207642paz.9.2012.09.21.07.26.20 (version=SSLv3 cipher=OTHER); Fri, 21 Sep 2012 07:26:22 -0700 (PDT) From: Chong Yidong To: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X References: <505598C8.8070904@yandex.ru> <5055C0EB.3040908@yandex.ru> <83wqzuqgzr.fsf@gnu.org> <5055D34F.1040800@yandex.ru> <83txuyqdtv.fsf@gnu.org> <5055E16E.1070604@yandex.ru> <83sjaiqaqb.fsf@gnu.org> <5055F69B.4020004@yandex.ru> <837grr1idg.fsf@gnu.org> <5059115B.8010407@yandex.ru> <83txuuzpqo.fsf@gnu.org> <5059965F.5030708@yandex.ru> <83obl2yr19.fsf@gnu.org> <5059F10C.6070806@yandex.ru> <83ipbaynku.fsf@gnu.org> <87a9wlz6e4.fsf@gnu.org> <83ehlwznsf.fsf@gnu.org> <87ipb8m4pk.fsf@gnu.org> <83r4pvyhj3.fsf@gnu.org> <87lig3d9nh.fsf@gnu.org> <83ipb7ya41.fsf@gnu.org> Date: Fri, 21 Sep 2012 22:26:18 +0800 In-Reply-To: <83ipb7ya41.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 21 Sep 2012 12:54:22 +0300") Message-ID: <87mx0jtpth.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 12447 Cc: 12447@debbugs.gnu.org, hanche@math.ntnu.no, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Eli Zaretskii writes: >> If I understand correctly, js2-mode (prior to the workaround) assumed >> the new behavior: it called run-with-idle-timer from inside the idle >> timer, with the same delay, with the intention of scheduling for the >> next period of idleness. > > I have no idea what js2-mode wants to do. What I wrote above was > based on my limited reading of the code fragments posted to that bug. OK, I guess your approach is fine. Please go ahead and commit your patch when you're ready, and amend the docstring of run-with-idle-timer as Dmitry suggested. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 22 09:21:05 2012 Received: (at 12447-done) by debbugs.gnu.org; 22 Sep 2012 13:21:05 +0000 Received: from localhost ([127.0.0.1]:48331 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TFPdj-0003dz-MU for submit@debbugs.gnu.org; Sat, 22 Sep 2012 09:21:04 -0400 Received: from mtaout21.012.net.il ([80.179.55.169]:42131) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TFPdc-0003dm-CA for 12447-done@debbugs.gnu.org; Sat, 22 Sep 2012 09:20:57 -0400 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MAR00E006AQDE00@a-mtaout21.012.net.il> for 12447-done@debbugs.gnu.org; Sat, 22 Sep 2012 16:19:08 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MAR00E0J6BWBL30@a-mtaout21.012.net.il>; Sat, 22 Sep 2012 16:19:08 +0300 (IDT) Date: Sat, 22 Sep 2012 16:18:56 +0300 From: Eli Zaretskii Subject: Re: bug#12447: 24.1.50; Stuck in garbage collection on OS X In-reply-to: <87mx0jtpth.fsf@gnu.org> X-012-Sender: halo1@inter.net.il To: Chong Yidong Message-id: <83ehlukxfj.fsf@gnu.org> References: <505598C8.8070904@yandex.ru> <5055C0EB.3040908@yandex.ru> <83wqzuqgzr.fsf@gnu.org> <5055D34F.1040800@yandex.ru> <83txuyqdtv.fsf@gnu.org> <5055E16E.1070604@yandex.ru> <83sjaiqaqb.fsf@gnu.org> <5055F69B.4020004@yandex.ru> <837grr1idg.fsf@gnu.org> <5059115B.8010407@yandex.ru> <83txuuzpqo.fsf@gnu.org> <5059965F.5030708@yandex.ru> <83obl2yr19.fsf@gnu.org> <5059F10C.6070806@yandex.ru> <83ipbaynku.fsf@gnu.org> <87a9wlz6e4.fsf@gnu.org> <83ehlwznsf.fsf@gnu.org> <87ipb8m4pk.fsf@gnu.org> <83r4pvyhj3.fsf@gnu.org> <87lig3d9nh.fsf@gnu.org> <83ipb7ya41.fsf@gnu.org> <87mx0jtpth.fsf@gnu.org> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 12447-done Cc: hanche@math.ntnu.no, 12447-done@debbugs.gnu.org, dgutov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > From: Chong Yidong > Cc: dgutov@yandex.ru, hanche@math.ntnu.no, 12447@debbugs.gnu.org > Date: Fri, 21 Sep 2012 22:26:18 +0800 > > Eli Zaretskii writes: > > >> If I understand correctly, js2-mode (prior to the workaround) assumed > >> the new behavior: it called run-with-idle-timer from inside the idle > >> timer, with the same delay, with the intention of scheduling for the > >> next period of idleness. > > > > I have no idea what js2-mode wants to do. What I wrote above was > > based on my limited reading of the code fragments posted to that bug. > > OK, I guess your approach is fine. Please go ahead and commit your > patch when you're ready, and amend the docstring of run-with-idle-timer > as Dmitry suggested. Done in trunk revision 110138. I'm therefore closing this bug. From unknown Mon Jun 23 04:09:16 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 21 Oct 2012 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator