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: Thu, 15 Jun 2017 20:57:45 +0200 Message-ID: References: <20170502204935.GA79100@breton.holly.idiocy.org> <20170613204643.GA98084@breton.holly.idiocy.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1497553152 648 195.159.176.226 (15 Jun 2017 18:59:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 15 Jun 2017 18:59:12 +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 Thu Jun 15 20:59:08 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 1dLZz0-0008I2-Lj for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Jun 2017 20:59:07 +0200 Original-Received: from localhost ([::1]:55469 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLZz6-00086o-3p for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Jun 2017 14:59:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55480) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLZyz-00086Y-Kx for bug-gnu-emacs@gnu.org; Thu, 15 Jun 2017 14:59:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dLZyw-00022E-54 for bug-gnu-emacs@gnu.org; Thu, 15 Jun 2017 14:59:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47223) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dLZyv-000222-UE for bug-gnu-emacs@gnu.org; Thu, 15 Jun 2017 14:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dLZyv-00079X-NR for bug-gnu-emacs@gnu.org; Thu, 15 Jun 2017 14:59: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: Thu, 15 Jun 2017 18:59: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.149755308227416 (code B ref 25265); Thu, 15 Jun 2017 18:59:01 +0000 Original-Received: (at 25265) by debbugs.gnu.org; 15 Jun 2017 18:58:02 +0000 Original-Received: from localhost ([127.0.0.1]:49900 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLZxx-000784-TW for submit@debbugs.gnu.org; Thu, 15 Jun 2017 14:58:02 -0400 Original-Received: from sinyavsky.aurox.ch ([37.35.109.145]:41892) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLZxv-00077p-Ho for 25265@debbugs.gnu.org; Thu, 15 Jun 2017 14:58:00 -0400 Original-Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id E8DC322475 for <25265@debbugs.gnu.org>; Thu, 15 Jun 2017 18:53:05 +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=1497552780; x= 1498416781; bh=nooOi2slSHLqA8yGtbc0ysfVV48A+tZK9qY8pQl/Sz0=; b=w kyoiTyOkNUgB76UPi0FYBeC/5r6rZkmN8rAPMhuXxzM5ErvF1UdfxO7mtCmIG4RK //yVKoWwDuO9Z2rTqdylXvREJXlqDf3EoINPSQ4tPwhhDqiqxTjg1AoO0sLhIj/U 73fEwLTEtcZ7bzLslD2ZpZfhN54yn2CyzCav6GhJUE= 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 ZXLg-K9O1__T for <25265@debbugs.gnu.org>; Thu, 15 Jun 2017 18:53:00 +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 D9A8C22457; Thu, 15 Jun 2017 18:52:59 +0000 (UTC) In-Reply-To: <20170613204643.GA98084@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:133623 Archived-At: Well done, it works here without a crash. I ran all the tests and 'thread-tests.el' passed. But I couldn't find how to rerun it. What command did you use? On 13/06/2017 22:46, Alan Third wrote: > On Mon, Jun 12, 2017 at 09:32:21PM +0200, Charles A. Roelli wrote: >> 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 went back and noticed an approach Eli suggested that I had given up > on, but understood this time round. > > I’ve attached a patch that seems to not crash. It introduces a warning > or two, and test/src/thread-tests.el randomly fails up to two tests, > but no crashes afaics. > >> 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 > It must be a sub‐thread running some objective c code without an > autorelease pool. It would be nice to be able to work out where that’s > happening. Perhaps threads will need to define an autorelease pool on > creation, and drain it on ending...