From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#25247: 26.0.50; Concurrency crashes with XLib Date: Fri, 30 Dec 2016 10:37:12 +0200 Message-ID: <83bmvtu81z.fsf@gnu.org> References: <87bmw4w9i2.fsf@gmail.com> <83a8bn27qn.fsf@gnu.org> <87h95vmi7b.fsf@gmail.com> <83wperyrgj.fsf@gnu.org> <878tr651a9.fsf@gmail.com> <83mvfmzq9n.fsf@gnu.org> <87shp7j790.fsf_-_@gmail.com> <06A3A860-6057-4932-A654-F7663B432DEB@raeburn.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1483087094 30452 195.159.176.226 (30 Dec 2016 08:38:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 30 Dec 2016 08:38:14 +0000 (UTC) Cc: tino.calancha@gmail.com, 25247@debbugs.gnu.org To: Ken Raeburn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 30 09:38:10 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMshT-00071V-US for geb-bug-gnu-emacs@m.gmane.org; Fri, 30 Dec 2016 09:38:08 +0100 Original-Received: from localhost ([::1]:38893 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMshY-0005t4-Ju for geb-bug-gnu-emacs@m.gmane.org; Fri, 30 Dec 2016 03:38:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMshS-0005sz-MK for bug-gnu-emacs@gnu.org; Fri, 30 Dec 2016 03:38:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cMshO-0005ly-DF for bug-gnu-emacs@gnu.org; Fri, 30 Dec 2016 03:38:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44136) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cMshO-0005lu-9S for bug-gnu-emacs@gnu.org; Fri, 30 Dec 2016 03:38:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cMshO-0008Ah-3W for bug-gnu-emacs@gnu.org; Fri, 30 Dec 2016 03:38:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 30 Dec 2016 08:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25247 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25247-submit@debbugs.gnu.org id=B25247.148308704731371 (code B ref 25247); Fri, 30 Dec 2016 08:38:02 +0000 Original-Received: (at 25247) by debbugs.gnu.org; 30 Dec 2016 08:37:27 +0000 Original-Received: from localhost ([127.0.0.1]:59535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMsgp-00089v-6E for submit@debbugs.gnu.org; Fri, 30 Dec 2016 03:37:27 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:40519) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMsgn-00089g-Rm for 25247@debbugs.gnu.org; Fri, 30 Dec 2016 03:37:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cMsge-0005d5-5p for 25247@debbugs.gnu.org; Fri, 30 Dec 2016 03:37:20 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38177) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMsge-0005d1-2o; Fri, 30 Dec 2016 03:37:16 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2097 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cMsgc-0004iM-KZ; Fri, 30 Dec 2016 03:37:15 -0500 In-reply-to: <06A3A860-6057-4932-A654-F7663B432DEB@raeburn.org> (message from Ken Raeburn on Fri, 30 Dec 2016 02:19:29 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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" Xref: news.gmane.org gmane.emacs.bugs:127574 Archived-At: > From: Ken Raeburn > Date: Fri, 30 Dec 2016 02:19:29 -0500 > Cc: Eli Zaretskii , > 25247@debbugs.gnu.org > > As for Eli’s comments about moving the locking code into xgselect.c, I think that’s going to be needed. I’ve got a patch in my private repository from a while back, waiting for some cleanup, that started doing something like that, but didn’t cover the Mac ns_select version because I’m unfamiliar with that code. The unblock_input code accesses global variables like interrupt_input_blocked and pending_signals, but it can be called from xg_select without holding the global lock. I think I also hit a case where current_thread was null due to the exiting of the “current” Lisp thread, and something called via unblock_input tried to use it to access one of the now-per-Lisp-thread variables. My view of this is that calling unblock_input might call handle_async_input, which in effect (and sometimes literally) will run Lisp. So we cannot do that in places that can be run by more than one thread. I will try to push a change that moves global lock acquiring into xgselect.c later today. As for ns_select, it sounds like the situation there is much more complex, see the discussion in bug#25265. > +#ifdef THREADS_ENABLED Please use "#if THREADS_ENABLED" instead. Thanks.