From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#25265: make-thread crashes in OS X 10.6 Date: Mon, 26 Dec 2016 20:56:32 +0000 Message-ID: <20161226205632.GA36805@breton.holly.idiocy.org> References: <83r34xxlke.fsf@gnu.org> <83d1ggxayi.fsf@gnu.org> <20161226130917.GA36471@breton.holly.idiocy.org> <8337hay9fl.fsf@gnu.org> 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 1482785848 5363 195.159.176.226 (26 Dec 2016 20:57:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 26 Dec 2016 20:57:28 +0000 (UTC) User-Agent: Mutt/1.7.1 (2016-10-04) Cc: charles@aurox.ch, 25265@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 26 21:57:20 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 1cLcKV-000817-RL for geb-bug-gnu-emacs@m.gmane.org; Mon, 26 Dec 2016 21:57:12 +0100 Original-Received: from localhost ([::1]:51691 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLcKa-0004PT-8p for geb-bug-gnu-emacs@m.gmane.org; Mon, 26 Dec 2016 15:57:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLcKT-0004PB-MU for bug-gnu-emacs@gnu.org; Mon, 26 Dec 2016 15:57:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cLcKP-0001hD-Qz for bug-gnu-emacs@gnu.org; Mon, 26 Dec 2016 15:57:09 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40648) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cLcKP-0001gf-Mx for bug-gnu-emacs@gnu.org; Mon, 26 Dec 2016 15:57:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cLcKM-0007xw-2O for bug-gnu-emacs@gnu.org; Mon, 26 Dec 2016 15:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 26 Dec 2016 20:57: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.148278580230595 (code B ref 25265); Mon, 26 Dec 2016 20:57:02 +0000 Original-Received: (at 25265) by debbugs.gnu.org; 26 Dec 2016 20:56:42 +0000 Original-Received: from localhost ([127.0.0.1]:56047 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cLcK2-0007xP-9L for submit@debbugs.gnu.org; Mon, 26 Dec 2016 15:56:42 -0500 Original-Received: from mail-wj0-f180.google.com ([209.85.210.180]:34465) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cLcK0-0007xC-Ld for 25265@debbugs.gnu.org; Mon, 26 Dec 2016 15:56:41 -0500 Original-Received: by mail-wj0-f180.google.com with SMTP id sd9so120756836wjb.1 for <25265@debbugs.gnu.org>; Mon, 26 Dec 2016 12:56:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=4rWjVWx4G9BRxKpGo6DbNLItlIRW79jh4jbLheHNefc=; b=dM2fn2LFyj8sDWCk7XMfehcSK84PgTqnKWSTb6ZT5DCBxQMpIBSAvw648bfrN9L0f1 8097Elf80D6IpUKLA4IvBZ8ErBJN2NlbW4zOEp01SPmDJnxwIdUCSsrj9RJjZIcdvmaW i4yXfVHCGPi90f3EMt4wc3Lfn2HC++5xzZZmZIwDhxqvmKmMV64hMtTtutnSZHb7Ru9r Z6w/yFaO0kmNhB4LlpGmXaDUYCm55A7jGkoDiF89XKioVlRX7E3GU9ii0ZnAFvsQ6DuR TbhCZjl6Xlzz7GfkA5oqB+Uto34919FcpNlK1Jz2G4QreQQeffZ4LQAOQSKuh2tXKzbw 7nvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=4rWjVWx4G9BRxKpGo6DbNLItlIRW79jh4jbLheHNefc=; b=nn+QOW1E7thRIACOqsd5gawZ8qyQ/YN/FE4FdQBNzTe7tteJmzRd+/dPZ8psxiGRYz 8scECV1nXi17p55HpcivkTRugeG4gso47LaEPY+AQTSYw14u1XYuBWJkKGhTtX+pTb4y MWRJabwFfZK3q+wPFwF2KIekQIRo5L/Q0s5+EBkwS/ocP/4eXBnA9nHz38Dt6kAhvMuY XpNr1bQNeeN8qvvptEpMg5gtRfj4Hi1wtQ87uUiIgM9Q1aPLMCV3sLp8E1E7Au14p+Tb j98T9zVJO6MDw846inTqc0R52M1D9xLmL60XN9q/yarnvxcc12widsEePC1qjRet+uVy YOxA== X-Gm-Message-State: AIkVDXLvoRxvBBNIsUzI+0PPEKPTqKCT8k/DRZYmAbUwnI+6WOctRSd8FIJzN0QbBfc1Kw== X-Received: by 10.194.87.230 with SMTP id bb6mr29104860wjb.163.1482785794902; Mon, 26 Dec 2016 12:56:34 -0800 (PST) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-413d-7770-bc2d-ff97.holly.idiocy.org. [2001:8b0:3f8:8129:413d:7770:bc2d:ff97]) by smtp.gmail.com with ESMTPSA id i15sm56249625wjs.16.2016.12.26.12.56.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Dec 2016 12:56:34 -0800 (PST) Content-Disposition: inline In-Reply-To: <8337hay9fl.fsf@gnu.org> 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:127468 Archived-At: On Mon, Dec 26, 2016 at 05:52:30PM +0200, Eli Zaretskii wrote: > > 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? 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. 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’ll put the complete backtrace at the bottom of this email. > > 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? I think this particular method call has to be done *only* from the main thread. I imagine that could be a problem. > 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. -- Alan Third