From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Wiegley Newsgroups: gmane.emacs.bugs Subject: bug#21965: 24.5; Emacs freezes when canceling at open file Date: Tue, 24 Nov 2015 17:38:06 -0800 Message-ID: References: <8337vz6ca5.fsf@gnu.org> <83io4sysrk.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1448415565 19402 80.91.229.3 (25 Nov 2015 01:39:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Nov 2015 01:39:25 +0000 (UTC) Cc: 21965@debbugs.gnu.org To: Maneesh Yadav Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 25 02:39:12 2015 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 1a1P36-0008E0-D3 for geb-bug-gnu-emacs@m.gmane.org; Wed, 25 Nov 2015 02:39:08 +0100 Original-Received: from localhost ([::1]:42493 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1P37-0008Rs-5J for geb-bug-gnu-emacs@m.gmane.org; Tue, 24 Nov 2015 20:39:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59745) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1P33-0008Rc-FD for bug-gnu-emacs@gnu.org; Tue, 24 Nov 2015 20:39:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1P30-0001fL-6i for bug-gnu-emacs@gnu.org; Tue, 24 Nov 2015 20:39:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33953) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1P30-0001eu-3W for bug-gnu-emacs@gnu.org; Tue, 24 Nov 2015 20:39:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1a1P2z-0008Fx-Rc for bug-gnu-emacs@gnu.org; Tue, 24 Nov 2015 20:39:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: John Wiegley Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Nov 2015 01:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21965 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21965-submit@debbugs.gnu.org id=B21965.144841551431692 (code B ref 21965); Wed, 25 Nov 2015 01:39:01 +0000 Original-Received: (at 21965) by debbugs.gnu.org; 25 Nov 2015 01:38:34 +0000 Original-Received: from localhost ([127.0.0.1]:51894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a1P2X-0008F6-RO for submit@debbugs.gnu.org; Tue, 24 Nov 2015 20:38:34 -0500 Original-Received: from mail-vk0-f49.google.com ([209.85.213.49]:34494) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a1P2C-0008Ef-Ul for 21965@debbugs.gnu.org; Tue, 24 Nov 2015 20:38:31 -0500 Original-Received: by vkbs1 with SMTP id s1so25233932vkb.1 for <21965@debbugs.gnu.org>; Tue, 24 Nov 2015 17:38:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:in-reply-to:date:message-id:references :user-agent:mime-version:content-type; bh=Tir2UDSWbC2co33xeiHbOKKfWy7hG5HNCShLwxaiK/Q=; b=RZh5Pv0UEREwM4uy0GkYyRf9WXaJdpb66YzlRv9Mej7LKkXycG3b9PV7nFOxqz7xq2 MHABgAX6hfAQOMFmww2Q96TdDXuYVtejV/x6nX18/H+kPOQmYv2GRzikzvETwbbr+N76 Q6l9UME6TavDw11ysXtBf7qWulVCysIEMN32iCVgIuvDUxFl3hm1wPkFgk0WC3uH5NRr zHDJmd+ihUkjM+XFdsZoCWe3kFiGI2LDRuDWGEfhJBuOsAKrUI0QS4pXnh8FAT1U37+C +VlFkNykcT1jpgpKjiZvmWUM9VD6u/vVW/0sLciEz+LZZ57csuyxZOJCMDzklGtjZc3d cG+w== X-Received: by 10.31.16.86 with SMTP id g83mr28797457vki.138.1448415492290; Tue, 24 Nov 2015 17:38:12 -0800 (PST) Original-Received: from Hermes-2.local (mail.johnwiegley.com. [208.82.103.192]) by smtp.gmail.com with ESMTPSA id c190sm16823178vkc.16.2015.11.24.17.38.10 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 24 Nov 2015 17:38:10 -0800 (PST) X-Google-Original-From: "John Wiegley" Original-Received: by Hermes-2.local (Postfix, from userid 501) id 07DD949CF86D; Tue, 24 Nov 2015 17:38:08 -0800 (PST) In-Reply-To: (Maneesh Yadav's message of "Tue, 24 Nov 2015 17:15:10 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.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:109210 Archived-At: >>>>> Maneesh Yadav writes: > I still am uncomfortable with my comprehension of the lldb output but here > is 'backtrace all' after triggering the condition Ok! Now we know what the deadlock situation is: Thread #2: > frame #3: 0x00000001009dd716 libglib-2.0.0.dylib`g_main_context_iteration + 55 ... > frame #0: 0x00007fff8a8613fa libsystem_kernel.dylib`__select + 10 Thread #1: > frame #3: 0x00000001009db284 libglib-2.0.0.dylib`g_main_context_acquire + 42 It turns out that both g_main_context_acquire and g_main_context_iteration (when called with NULL) call LOCK_CONTEXT on the "default context". Now, I *think* the context should be different between these two threads: one should be the default context, and one should be the worker context. But it _looks_ like Thread #1 is being locked out by Thread #2. In fact, reading the glib code, if the call to g_once_init_enter returns FALSE within g_get_worker_context, then the worker context will be NULL! Which seems like a subtle bug waiting to happen, and might be what's biting us. To go deeper, we may need to build a separate copy of glib and start putting some print statements in to find out why there is lock contention. Would you be up for that? I'd like to know if this is happening in g_get_worker_context. John