From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Charles A. Roelli" Newsgroups: gmane.emacs.bugs Subject: bug#25265: make-thread crashes in OS X 10.6 Date: Mon, 12 Jun 2017 21:32:21 +0200 Message-ID: References: <20170502204935.GA79100@breton.holly.idiocy.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1497295995 23921 195.159.176.226 (12 Jun 2017 19:33:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 12 Jun 2017 19:33:15 +0000 (UTC) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Cc: 25265@debbugs.gnu.org To: Alan Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 12 21:33:11 2017 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 1dKV5K-0005u2-U3 for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Jun 2017 21:33:11 +0200 Original-Received: from localhost ([::1]:39732 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKV5Q-0006Df-9o for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Jun 2017 15:33:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52579) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKV5F-0006Ca-O1 for bug-gnu-emacs@gnu.org; Mon, 12 Jun 2017 15:33:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dKV5C-0005Na-LE for bug-gnu-emacs@gnu.org; Mon, 12 Jun 2017 15:33:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41326) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dKV5C-0005NF-C6 for bug-gnu-emacs@gnu.org; Mon, 12 Jun 2017 15:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dKV5B-0007dC-PM for bug-gnu-emacs@gnu.org; Mon, 12 Jun 2017 15:33:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Charles A. Roelli" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 12 Jun 2017 19:33: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.149729595529301 (code B ref 25265); Mon, 12 Jun 2017 19:33:01 +0000 Original-Received: (at 25265) by debbugs.gnu.org; 12 Jun 2017 19:32:35 +0000 Original-Received: from localhost ([127.0.0.1]:44003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKV4l-0007cX-Hi for submit@debbugs.gnu.org; Mon, 12 Jun 2017 15:32:35 -0400 Original-Received: from sinyavsky.aurox.ch ([37.35.109.145]:39488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKV4j-0007cJ-BE for 25265@debbugs.gnu.org; Mon, 12 Jun 2017 15:32:33 -0400 Original-Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id 6EF082246F for <25265@debbugs.gnu.org>; Mon, 12 Jun 2017 19:27:40 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= content-transfer-encoding:content-type:content-type:in-reply-to :mime-version:user-agent:date:date:message-id:from:from :references:to:subject:subject; s=dkim; t=1497295658; x= 1498159659; bh=aUYnbbxAPvynn9xv3aCI4aWd/Er7MNtlO7ZoTIMTY/8=; b=f DA2ENPz94P/2vyGrUf15Z7JxhGwDBU2TIF6XWgSdZ5d3+EC2rZCyEefhkHh6dyCM FXAvrFSSNtnWPqQtwxbR723uyktwrEpXrK4QcmdCh4p69wnRpq9NQQ6zLOWnaqtO y8evL46j28S/F9ciYUFcNrZsk8wvRasQTcycklsU6w= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Original-Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ms4pSip2lexs for <25265@debbugs.gnu.org>; Mon, 12 Jun 2017 19:27:38 +0000 (UTC) Original-Received: from [192.168.1.121] (125.85.192.178.dynamic.wline.res.cust.swisscom.ch [178.192.85.125]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id 7459522469; Mon, 12 Jun 2017 19:27:38 +0000 (UTC) In-Reply-To: <20170502204935.GA79100@breton.holly.idiocy.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:133531 Archived-At: The issue seems to be improved now (not sure what changed it). I tried this sample code, and it worked without a crash: (dotimes (i 100) (make-thread (lambda () "string"))) Then I tried this code, and there's a crash every few runs (or sometimes, an infinite loop that can't be exited without killing the process). The crash normally happens when I supply input (via the keyboard), and the loop seems to be happen randomly. (make-thread (lambda () (dotimes (i 10) (sit-for 1) (goto-char (random (buffer-size)))))) I also noticed GDB's I/O buffer printing many of these warnings as soon as the `make-thread' form was called: 2017-06-12 21:13:55.943 Emacs[10829:6683] *** __NSAutoreleaseNoPool(): Object 0x10216bf50 of class NSBezierPath autoreleased with no pool in place - just leaking 2017-06-12 21:13:55.944 Emacs[10829:6683] *** __NSAutoreleaseNoPool(): Object 0x101ec41b0 of class NSBezierPath autoreleased with no pool in place - just leaking 2017-06-12 21:13:56.443 Emacs[10829:6683] *** __NSAutoreleaseNoPool(): Object 0x10216c0f0 of class NSBezierPath autoreleased with no pool in place - just leaking 2017-06-12 21:13:56.444 Emacs[10829:6683] *** __NSAutoreleaseNoPool(): Object 0x101ec43e0 of class NSBezierPath autoreleased with no pool in place - just leaking On 02/05/2017 22:49, Alan Third wrote: > On Sat, Dec 24, 2016 at 12:06:45PM +0100, Charles A. Roelli wrote: >> Running Emacs -Q on the latest commit (e36a3882), >> >> M-: (make-thread (lambda () "string")) >> >> appears to hang Emacs immediately. > I’ve been working on this on and off for a while now, and I just can’t > fix it. > > I’ve attached two patches that together are the best I’ve managed to > achieve, but unfortunately it randomly freezes up with 100% CPU usage. > > I’ve not yet managed to work out what it’s doing when it goes into the > 100% CPU loop. I can only assume I’ve missed some crucial case in > ns_select or something. > > The first patch stops the NS port from using SIGIO, as it seems to be > the source of a number of problems. The second removes the NS event > loop in ns_select as it requires block_input/unblock_input wrapped > around it, but that’s what’s causing the crash in make-thread. > > Instead it just looks for whether there is a new NS event as I don’t > think that requires blocking input. >