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: Tue, 27 Dec 2016 09:30:28 +0200 Message-ID: <83k2alx20b.fsf@gnu.org> References: <83r34xxlke.fsf@gnu.org> <83d1ggxayi.fsf@gnu.org> <20161226130917.GA36471@breton.holly.idiocy.org> <8337hay9fl.fsf@gnu.org> <20161226205632.GA36805@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 1482823887 21469 195.159.176.226 (27 Dec 2016 07:31:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 27 Dec 2016 07:31:27 +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 Tue Dec 27 08:31:22 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 1cLmE0-0003YO-Sz for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Dec 2016 08:31:08 +0100 Original-Received: from localhost ([::1]:53069 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLmE5-0000zB-JU for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Dec 2016 02:31:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40508) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLmDx-0000xY-3u for bug-gnu-emacs@gnu.org; Tue, 27 Dec 2016 02:31:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cLmDu-0001t1-19 for bug-gnu-emacs@gnu.org; Tue, 27 Dec 2016 02:31:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40865) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cLmDt-0001sv-Tq for bug-gnu-emacs@gnu.org; Tue, 27 Dec 2016 02:31:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cLmDt-00062s-Ok for bug-gnu-emacs@gnu.org; Tue, 27 Dec 2016 02:31:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Dec 2016 07:31:01 +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.148282385023221 (code B ref 25265); Tue, 27 Dec 2016 07:31:01 +0000 Original-Received: (at 25265) by debbugs.gnu.org; 27 Dec 2016 07:30:50 +0000 Original-Received: from localhost ([127.0.0.1]:56264 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cLmDi-00062T-IQ for submit@debbugs.gnu.org; Tue, 27 Dec 2016 02:30:50 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:49366) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cLmDh-00062G-G6 for 25265@debbugs.gnu.org; Tue, 27 Dec 2016 02:30:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cLmDZ-0001l0-6L for 25265@debbugs.gnu.org; Tue, 27 Dec 2016 02:30:44 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49461) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLmDZ-0001ku-1Q; Tue, 27 Dec 2016 02:30:41 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1650 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cLmDX-0001fM-V5; Tue, 27 Dec 2016 02:30:40 -0500 In-reply-to: <20161226205632.GA36805@breton.holly.idiocy.org> (message from Alan Third on Mon, 26 Dec 2016 20:56:32 +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:127484 Archived-At: > Date: Mon, 26 Dec 2016 20:56:32 +0000 > From: Alan Third > Cc: charles@aurox.ch, 25265@debbugs.gnu.org > > > Can you try and figure out why it hangs? > > I’m not having any luck with this. My entirely uneducated guess is > that the main thread can’t access the contents of current_thread. It > crashes on this line: > > while (specpdl_ptr != specpdl + count) > > with EXC_BAD_ACCESS. Only three things are being accessed: count, > which is a function argument, and specpdl and specpdl_ptr are > #defines to variables within current_thread. The loop above is in unbind_to, right? > I can’t access anything within current_thread using lldb, but I can > see current_thread itself. I don’t know if that signifies anything. I have bad experience with using lldb (not on OS X, though), so I don't trust it. Can you use GDB instead? Failing that, is it possible to just fprintf these values to stderr? It is strange that this is where it hangs, since these are thread-specific variables. Maybe the problem is that apploopnr is a static variable, and some other thread stomps on it? > I’ll put the complete backtrace at the bottom of this email. I don't see any backtraces attached. > > [NSApp run]; > > > > Can this part and its surrounding code be made thread-safe? > > I think this particular method call has to be done *only* from the > main thread. I imagine that could be a problem. It could be a problem, yes. But what does this do, exactly, and why does it need to be called as part of ns_select? Also, why does ns_select sometimes call pselect instead -- is that for non-interactive or non-GUI sessions or something? Thanks.