From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#12447: 24.1.50; Stuck in garbage collection on OS X Date: Sun, 16 Sep 2012 17:25:35 +0400 Message-ID: <5055D34F.1040800@yandex.ru> 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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1347801961 7324 80.91.229.3 (16 Sep 2012 13:26:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 16 Sep 2012 13:26:01 +0000 (UTC) Cc: 12447@debbugs.gnu.org, hanche@math.ntnu.no To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 16 15:26:02 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TDErJ-0001sj-NJ for geb-bug-gnu-emacs@m.gmane.org; Sun, 16 Sep 2012 15:26:01 +0200 Original-Received: from localhost ([::1]:59415 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDErF-0004Dl-L4 for geb-bug-gnu-emacs@m.gmane.org; Sun, 16 Sep 2012 09:25:57 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDErC-0004DS-SX for bug-gnu-emacs@gnu.org; Sun, 16 Sep 2012 09:25:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TDErB-00086e-Nk for bug-gnu-emacs@gnu.org; Sun, 16 Sep 2012 09:25:54 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55299) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDErB-00086a-KC for bug-gnu-emacs@gnu.org; Sun, 16 Sep 2012 09:25:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TDEsH-00052M-R9 for bug-gnu-emacs@gnu.org; Sun, 16 Sep 2012 09:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 16 Sep 2012 13:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12447 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12447-submit@debbugs.gnu.org id=B12447.134780201319348 (code B ref 12447); Sun, 16 Sep 2012 13:27:01 +0000 Original-Received: (at 12447) by debbugs.gnu.org; 16 Sep 2012 13:26:53 +0000 Original-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 Original-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 Original-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) Original-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) Original-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= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 In-Reply-To: <83wqzuqgzr.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:64420 Archived-At: 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'.