From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.bugs Subject: bug#12832: 24.3.50; Emacs lockup when idle Date: Wed, 14 Nov 2012 17:48:41 +0100 Message-ID: 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> <50A3C701.4090308@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1352911775 22037 80.91.229.3 (14 Nov 2012 16:49:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 Nov 2012 16:49:35 +0000 (UTC) Cc: fni@missioncriticalit.com, 12832@debbugs.gnu.org To: Andy Moreton Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 14 17:49: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 1TYg9m-0007mG-Tm for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Nov 2012 17:49:43 +0100 Original-Received: from localhost ([::1]:47705 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYg9d-0001W6-9m for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Nov 2012 11:49:33 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:45638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYg9Z-0001VD-4s for bug-gnu-emacs@gnu.org; Wed, 14 Nov 2012 11:49:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TYg9W-0007Sd-25 for bug-gnu-emacs@gnu.org; Wed, 14 Nov 2012 11:49:29 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60376) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYg9V-0007SZ-Uz for bug-gnu-emacs@gnu.org; Wed, 14 Nov 2012 11:49:25 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TYgA5-00089S-QB for bug-gnu-emacs@gnu.org; Wed, 14 Nov 2012 11:50:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lennart Borgman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Nov 2012 16:50: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.135291179331315 (code B ref 12832); Wed, 14 Nov 2012 16:50:01 +0000 Original-Received: (at 12832) by debbugs.gnu.org; 14 Nov 2012 16:49:53 +0000 Original-Received: from localhost ([127.0.0.1]:42394 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TYg9x-000890-2j for submit@debbugs.gnu.org; Wed, 14 Nov 2012 11:49:53 -0500 Original-Received: from mail-gg0-f172.google.com ([209.85.161.172]:52429) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TYg9u-00088r-Tl for 12832@debbugs.gnu.org; Wed, 14 Nov 2012 11:49:51 -0500 Original-Received: by mail-gg0-f172.google.com with SMTP id i4so118823ggn.3 for <12832@debbugs.gnu.org>; Wed, 14 Nov 2012 08:49:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=mBSPS0UGX4eH920L9GmrdIR4wmz8QEcDUirYIHLtkdw=; b=KzkjbMD6FSXVfZIjfyNQQgajvW1ggMfVACHObmE/iosLY9wZNRO7h5TDto7HgIiG69 6Sd/ENFHmJt9D3PYv/opyydcEJl8NSbWJMPUSWwWWuwKVejHh+gKR0r6FFmZuHiNgPxv DpdzkLVRH8PmWbfKjkBXRvdlMIOKR1pVSaTzVgcRCd65ZQfU2lGFE6zxVGsZdp9/5gXr LHqKDw5GhawAG6oNtSgZF6NV6cR3AYIuuNgeMFvzPtPVXoDfi/RPYtIFFFDe1RpDVM2A pqsBRGs6dg6klYfnQvBZJ8biclAhIWd8rQHSqTZYLe5e6uS7wQbBrfRAsNXGumEhFjEh YSbw== Original-Received: by 10.236.124.44 with SMTP id w32mr1972085yhh.104.1352911753067; Wed, 14 Nov 2012 08:49:13 -0800 (PST) Original-Received: by 10.147.163.8 with HTTP; Wed, 14 Nov 2012 08:48:41 -0800 (PST) In-Reply-To: <50A3C701.4090308@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:66921 Archived-At: I have no time to build Emacs now and have not had it for a very long time. However I have seen Emacs freeze a lot of times when it is idle. This started to get more common when I moved to a 64-bit windows 7 (from windows xp, 32-bit). I have always thought that this must be bad handling of the messages from the operating systems, but I have had no chance to pin this down. Reading here I wonder if data are accessed somewhere in a system time thread without critical section handling. On Wed, Nov 14, 2012 at 5:29 PM, Andy Moreton wrote: > 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 > > > > > > >