From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.bugs Subject: bug#12832: 24.3.50; Emacs lockup when idle Date: Wed, 14 Nov 2012 16:29:53 +0000 Message-ID: <50A3C701.4090308@gmail.com> References: <838vac12kn.fsf@gnu.org> <509BFAE7.8020205@gmail.com> <83liebyu9t.fsf@gnu.org> <509CDF7F.2000409@gmail.com> <83ip9fyqmy.fsf@gnu.org> <83390izlxm.fsf@gnu.org> <509D4DAC.1060901@gmail.com> <83pq3hvet0.fsf@gnu.org> <509BAC2E.2000702@gmail.com> <80r4nxsl1s.fsf@somewhere.org> <83lie5vbot.fsf@gnu.org> <50A2585A.3050008@gmail.com> <83ip99v8h5.fsf@gnu.org> <50A26E9E.4020405@gmail.com> <83ehjxv3gv.fsf@gnu.org> <50A39237.3090302@gmail.com> 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 1352910634 10740 80.91.229.3 (14 Nov 2012 16:30:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 Nov 2012 16:30:34 +0000 (UTC) Cc: fni@missioncriticalit.com, 12832@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 14 17:30:44 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 1TYfrP-0000Du-Bm for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Nov 2012 17:30:43 +0100 Original-Received: from localhost ([::1]:36469 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYfrF-00022o-Ke for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Nov 2012 11:30:33 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:35287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYfrB-00022B-8K for bug-gnu-emacs@gnu.org; Wed, 14 Nov 2012 11:30:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TYfr8-0001XS-4j for bug-gnu-emacs@gnu.org; Wed, 14 Nov 2012 11:30:29 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60328) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYfr8-0001XO-0z for bug-gnu-emacs@gnu.org; Wed, 14 Nov 2012 11:30:26 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TYfrh-0007hg-Jm for bug-gnu-emacs@gnu.org; Wed, 14 Nov 2012 11:31:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andy Moreton Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Nov 2012 16:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12832 X-GNU-PR-Package: emacs,w32 X-GNU-PR-Keywords: Original-Received: via spool by 12832-submit@debbugs.gnu.org id=B12832.135291063629580 (code B ref 12832); Wed, 14 Nov 2012 16:31:01 +0000 Original-Received: (at 12832) by debbugs.gnu.org; 14 Nov 2012 16:30:36 +0000 Original-Received: from localhost ([127.0.0.1]:42346 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TYfrI-0007h2-38 for submit@debbugs.gnu.org; Wed, 14 Nov 2012 11:30:36 -0500 Original-Received: from mail-we0-f172.google.com ([74.125.82.172]:33097) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TYfrF-0007gu-0S for 12832@debbugs.gnu.org; Wed, 14 Nov 2012 11:30:34 -0500 Original-Received: by mail-we0-f172.google.com with SMTP id u46so210081wey.3 for <12832@debbugs.gnu.org>; Wed, 14 Nov 2012 08:29:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=+G9ik3fi/VcXjQUtBrai0YTxC6tmzYCZ98lV/79ELag=; b=jFFtpwoooXGylynlme9XIt7augF84r21SSk3ngoNBkjP7mgQK7nNikv0iD20o/+52X k9yhaaOWh+aWQZh7Yjv4Rfjk50yx75jwLmOT17x78v+dbPWRbu38ftSaQKuEP4DM7E4w U9w4n0UbIg9I3sQehVbvy/VUnYJBKjCW08BcyrwemYwR55ML4r17dBhIaxjYdugmb9AE BwUbpHOTcodipbkmWjrb+zW194IUmUFDBLE7132HLhKQERwdN3bRTW8mfwZGR0XLq9ES HfVdFlislD6y+FawWDmaWhQ7HMT1FsIFZEZ5syKE4EmQPo7qLpPuQAGepl48f7wAihuh NSXg== Original-Received: by 10.180.87.201 with SMTP id ba9mr17467146wib.1.1352910595930; Wed, 14 Nov 2012 08:29:55 -0800 (PST) Original-Received: from [10.17.20.82] (uk.solarflare.com. [193.34.186.16]) by mx.google.com with ESMTPS id en20sm3162243wid.4.2012.11.14.08.29.54 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Nov 2012 08:29:54 -0800 (PST) User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 In-Reply-To: <50A39237.3090302@gmail.com> X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-Spam-Score: 0.1 (/) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:66919 Archived-At: On 14/11/2012 12:44, Andy Moreton wrote: > On 13/11/2012 17:04, Eli Zaretskii wrote: >> Can you please try the patch below and see if it prevents the >> lock-ups? >> >> === modified file 'src/w32proc.c' >> --- src/w32proc.c 2012-11-05 03:18:32 +0000 >> +++ src/w32proc.c 2012-11-13 16:59:53 +0000 >> @@ -431,13 +431,24 @@ timer_loop (LPVOID arg) >> /* Simulate a signal delivered to the thread which installed >> the timer, by suspending that thread while the handler >> runs. */ >> - DWORD result = SuspendThread (itimer->caller_thread); >> + DWORD result; >> + >> + if (dwMainThreadId) >> + enter_crit (); >> + result = SuspendThread (itimer->caller_thread); >> >> if (result == (DWORD)-1) >> - return 2; >> + { >> + if (dwMainThreadId) >> + leave_crit (); >> + return 2; >> + } >> >> handler (sig); >> ResumeThread (itimer->caller_thread); >> + >> + if (dwMainThreadId) >> + leave_crit (); >> } >> >> /* Update expiration time and loop. */ >> > > I applied this to emacs-24 branch (r110866) this morning. So far I've not seen > a lockup, but I'll to run it for a day or two to be sure. After longer uptime, it seems this patch is not successful. I haven't had a complete lockup, but I have seen a couple of glitches where it froze but then recovered a short while later. The unfreeze may have been due to capturing a stack trace with Process Explorer (I have upgraded to the latest version which is less buggy). The patched emacs-24 does seem to leak handles: at the moment Process Explorer report that emacs has 50805 handles in all, most of which are thread handles. The number of handles seems to increase at a rate of 2 to 4 per second. AndyM