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#25265: make-thread crashes in OS X 10.6 Date: Mon, 26 Dec 2016 17:52:30 +0200 Message-ID: <8337hay9fl.fsf@gnu.org> References: <83r34xxlke.fsf@gnu.org> <83d1ggxayi.fsf@gnu.org> <20161226130917.GA36471@breton.holly.idiocy.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 1482767593 26789 195.159.176.226 (26 Dec 2016 15:53:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 26 Dec 2016 15:53:13 +0000 (UTC) Cc: charles@aurox.ch, 25265@debbugs.gnu.org To: Alan Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 26 16:53:09 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 1cLXaF-0006PU-Cv for geb-bug-gnu-emacs@m.gmane.org; Mon, 26 Dec 2016 16:53:07 +0100 Original-Received: from localhost ([::1]:50754 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLXaK-000079-5O for geb-bug-gnu-emacs@m.gmane.org; Mon, 26 Dec 2016 10:53:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLXaE-00006s-CA for bug-gnu-emacs@gnu.org; Mon, 26 Dec 2016 10:53:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cLXaA-0001gu-FW for bug-gnu-emacs@gnu.org; Mon, 26 Dec 2016 10:53:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40438) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cLXaA-0001go-Bw for bug-gnu-emacs@gnu.org; Mon, 26 Dec 2016 10:53:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cLXaA-0004qk-5R for bug-gnu-emacs@gnu.org; Mon, 26 Dec 2016 10:53: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: Mon, 26 Dec 2016 15:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25265 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25265-submit@debbugs.gnu.org id=B25265.148276757618629 (code B ref 25265); Mon, 26 Dec 2016 15:53:02 +0000 Original-Received: (at 25265) by debbugs.gnu.org; 26 Dec 2016 15:52:56 +0000 Original-Received: from localhost ([127.0.0.1]:55837 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cLXa4-0004qP-3f for submit@debbugs.gnu.org; Mon, 26 Dec 2016 10:52:56 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43621) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cLXa2-0004qA-20 for 25265@debbugs.gnu.org; Mon, 26 Dec 2016 10:52:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cLXZs-0001cn-LO for 25265@debbugs.gnu.org; Mon, 26 Dec 2016 10:52:48 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41728) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLXZs-0001cj-IE; Mon, 26 Dec 2016 10:52:44 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3195 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cLXZr-0006Ne-NU; Mon, 26 Dec 2016 10:52:44 -0500 In-reply-to: <20161226130917.GA36471@breton.holly.idiocy.org> (message from Alan Third on Mon, 26 Dec 2016 13:09:17 +0000) 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:127453 Archived-At: > Date: Mon, 26 Dec 2016 13:09:17 +0000 > From: Alan Third > Cc: charles@aurox.ch, 25265@debbugs.gnu.org > > I’ve just tried the below patch and it doesn’t make any difference: it > still hangs immediately. Can you try and figure out why it hangs? > Back in October Ken Raeburn listed some things that need done in > ns_select which are probably relevant: > > https://lists.gnu.org/archive/html/emacs-devel/2016-10/msg00525.html Hmm... none of the changes Ken mentioned were in the concurrency branch when I merged it. Perhaps Ken didn't push the changes back then. The problems in xg_select were solved in a different way, I believe. The problems in ns_select are the issue at hand here. Wrt static variables used by ns_select: either they should become members of struct thread_state, or the calls to release_global_lock and acquire_global_lock should be moved into ns_select (which was what Ken was proposing, AFAIU). I'm not sure which possibility is better, nor whether this is all that needs to be done, because I don't understand well enough the semantics of some parts of ns_select, in particular where it says [NSApp run]; Can this part and its surrounding code be made thread-safe? The call to record_unwind_protect in particular confuses me: that seems to hint the code wants to be interruptible here, which might require stuff like maybe_reacquire_global_lock I added to keyboard.c, to avoid problems when Emacs gets SIGINT on a TTY frame. Thanks.