From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Zack Piper" Newsgroups: gmane.emacs.bugs Subject: bug#32812: 27.0.50; macOS Mojave GNU Emacs crash after 5-10 minutes or so Date: Mon, 24 Sep 2018 12:39:22 +0100 Message-ID: <44769E5D-B37C-48AF-9C17-38264CE6224A@apertron.com> References: <8C435A35-6F98-45D4-AF3E-1052E9420212@apertron.com> <20180924101706.GA24015@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 1537789091 4591 195.159.176.226 (24 Sep 2018 11:38:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 24 Sep 2018 11:38:11 +0000 (UTC) To: 32812@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 24 13:38:07 2018 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 1g4PBm-0000xn-Q3 for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Sep 2018 13:38:07 +0200 Original-Received: from localhost ([::1]:44624 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4PDo-0002YA-FP for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Sep 2018 07:40:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48086) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4PDi-0002Xt-HV for bug-gnu-emacs@gnu.org; Mon, 24 Sep 2018 07:40:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4PDf-00086y-Ci for bug-gnu-emacs@gnu.org; Mon, 24 Sep 2018 07:40:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47141) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g4PDf-00086b-2W for bug-gnu-emacs@gnu.org; Mon, 24 Sep 2018 07:40:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g4PDe-0002Tt-Mx for bug-gnu-emacs@gnu.org; Mon, 24 Sep 2018 07:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Zack Piper" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Sep 2018 11:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32812 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32812-submit@debbugs.gnu.org id=B32812.15377891709489 (code B ref 32812); Mon, 24 Sep 2018 11:40:02 +0000 Original-Received: (at 32812) by debbugs.gnu.org; 24 Sep 2018 11:39:30 +0000 Original-Received: from localhost ([127.0.0.1]:51399 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4PD7-0002Sy-Mb for submit@debbugs.gnu.org; Mon, 24 Sep 2018 07:39:29 -0400 Original-Received: from 183.ip-51-68-126.eu ([51.68.126.183]:37284 helo=zmail.apertron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4PD5-0002Sq-6l for 32812@debbugs.gnu.org; Mon, 24 Sep 2018 07:39:28 -0400 Original-Received: from [172.25.55.63] (unknown [86.8.202.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: zack@apertron.com) by zmail.apertron.com (Postfix) with ESMTPSA id 318C66002A for <32812@debbugs.gnu.org>; Mon, 24 Sep 2018 11:39:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apertron.com; s=dkim; t=1537789159; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2/cpk6bxhSCnU4MsFz6UkdG8db8WRcuaxeAjRIHEm5Y=; b=kfNrK1HvdhZmMAYLXxRdddEAyZdQKa3RaeWrQJ7sqY5YKvyge0Ti0BHevwHjKCOZuTqn7e 7odPVDJQrGs2C6rZ/oeisNByZ952y3gSZtGwhDOxYC7+NmUeuq043M96TGYxMJ9Rskt4V9 GHeT9yz9YoWpJJ1YDArB0gjofIiaUA4= In-Reply-To: <20180924101706.GA24015@breton.holly.idiocy.org> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=apertron.com; s=dkim; t=1537789159; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2/cpk6bxhSCnU4MsFz6UkdG8db8WRcuaxeAjRIHEm5Y=; b=Nz6T9E+nJTjA2goRiD7EsqYzd5qCUhxouGtF4zAMjfd+ZkTCs3zakQ4MGoHq788Um4qROY 6qoUrV+I7izsjbuG9S05hDP8kvB5aXnAZHwtDOqQgu0QwPHq58kx0A3ruc5Ee54WmoxhZh +cc6JiA1CAOdD/pjYjxfKMdAYusAK30= ARC-Seal: i=1; s=dkim; d=apertron.com; t=1537789159; a=rsa-sha256; cv=none; b=a2aQWGWPbem7VVgewYzdM0Joq1sk/U9YEmmL42tmY5ije525sZaIDtbvpGEo7fnhbqViBqagm3lCq57evgB/S6yAs5i1LgKT5Hji2hADcpeF6scPvJKOnpfYTlU0R1ByDAEWb8V+oahgaArfy9MP0Oz+t/g6AhHhHT4Hj+EWvhQ= ARC-Authentication-Results: i=1; zmail.apertron.com; auth=pass smtp.auth=zack@apertron.com smtp.mailfrom=zack@apertron.com 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:150596 Archived-At: (Final attempt at sending, TLS was being enforced for my outgoing emails, sorry Alan for the spam!) Hi Alan, On 24 Sep 2018, at 11:17, Alan Third wrote: > On Sun, Sep 23, 2018 at 04:21:13PM +0100, Zack Piper wrote: >> Hi! >> >> (Replacing my post in #31904 with this since they're separate >> issues(?)) > > Sorry, I somehow missed that previous email. No worries at all! >> I've applied a slightly modified (i.e. updated) version of Alan's >> patch from >> bug #31904 >> (attached) to fix an issue concerning the buffer and mode-line not >> being >> rendered. The patch works great, everything is now rendered. >> >> Now I notice that after 5-10 minutes (or even before), Emacs crashes >> with >> the below: >> >> ``` >> objc[82784]: Invalid or prematurely-freed autorelease pool >> 0x1030032e0. >> ``` >> >> This started occurring since upgrading to macOS Mojave, so possibly >> there's >> a bug with Mojave or just some incompatibility, not really sure! > > It’s a bit strange looking, and autorelease pools are something of a > mystery to me. > > I have a suspicion, though, that just creating a new autorelease pool > may solve this. I’ve attached a patch. It’s for emacs-26, but > should > apply OK to master, or without too much work anyway. > > It simply wraps the call to displayIfNeeded in a new pool: > > static void > ns_flush_display (struct frame *f) > /* Force the frame to redisplay. If areas have previously been marked > dirty by setNeedsDisplayInRect (in ns_focus), then this will call > draw_rect: which will "expose" those areas. */ > { > NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; > [FRAME_NS_VIEW (f) displayIfNeeded]; > [pool release]; > } > > Thanks for testing the patch and raising this issue. There’s not > been > a lot of feedback so far and I think we’re going to have to commit > the > patch soon given that Mojave is out today. You're very welcome, and thanks for providing the additional patch! (Later email): > This patch doesn’t help, I finally reproduced the crash with it in > place. Oh, damn. I truly wish I could help somewhat, if you need anything additional from me let me know. I've never really meddled Objective C before, so I'd likely not be able to help much. Obviously I'm more than happy to test any patches you throw at me! :-) I did look at the autorelease pool thing and tried to see where it would fit in, to no avail. Let me know if you need anything. > -- > Alan Third Thanks, Zack