From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Michael Dixon Newsgroups: gmane.emacs.bugs Subject: bug#38031: 26.3; Trying to invoke the macOS File Open window causes Emacs to crash on macOS Catalina Date: Sun, 3 Nov 2019 16:02:39 -0500 Message-ID: <435F198B-3771-4E70-9A5F-F263AC34B2A0@gmail.com> References: <20191103203946.GB37523@breton.holly.idiocy.org> Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3601.0.10\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_132DE6EA-2D41-4E7C-9648-0E444CF2CE7F" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="28782"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 38031@debbugs.gnu.org To: Alan Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Nov 03 22:51:14 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iRNmD-0007LM-Kn for geb-bug-gnu-emacs@m.gmane.org; Sun, 03 Nov 2019 22:51:14 +0100 Original-Received: from localhost ([::1]:56540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iRNmC-0001SK-HP for geb-bug-gnu-emacs@m.gmane.org; Sun, 03 Nov 2019 16:51:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57796) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iRNm4-0001QU-6a for bug-gnu-emacs@gnu.org; Sun, 03 Nov 2019 16:51:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iRNm2-0006nX-K5 for bug-gnu-emacs@gnu.org; Sun, 03 Nov 2019 16:51:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55008) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iRNm2-0006nT-Gz for bug-gnu-emacs@gnu.org; Sun, 03 Nov 2019 16:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iRNm2-00066b-Do for bug-gnu-emacs@gnu.org; Sun, 03 Nov 2019 16:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Dixon Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 03 Nov 2019 21:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38031 X-GNU-PR-Package: emacs Original-Received: via spool by 38031-submit@debbugs.gnu.org id=B38031.157281784823434 (code B ref 38031); Sun, 03 Nov 2019 21:51:02 +0000 Original-Received: (at 38031) by debbugs.gnu.org; 3 Nov 2019 21:50:48 +0000 Original-Received: from localhost ([127.0.0.1]:35595 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iRNlo-00065t-0m for submit@debbugs.gnu.org; Sun, 03 Nov 2019 16:50:48 -0500 Original-Received: from mail-qt1-f181.google.com ([209.85.160.181]:36180) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iRN1L-0004dI-NG for 38031@debbugs.gnu.org; Sun, 03 Nov 2019 16:02:48 -0500 Original-Received: by mail-qt1-f181.google.com with SMTP id y10so14071457qto.3 for <38031@debbugs.gnu.org>; Sun, 03 Nov 2019 13:02:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=S1d8R4fxSbVurDHEW7+ecfC3jg7gWo/Eeo/+fPr7q8Q=; b=FFyMCsfn92LFMTam5DARLCbTu9h3S9a0hIZ8wLwtPbkgupb5ZkafSzCgIGJoGKiWdJ b5aanI8ByNGJQRjQMxNuP8Y8EGs/mZQKlQDrmBRUgCnjZ5wDrHX4RZhZ7K2yGqrsS0pE AMZsCmarUvmtz7HPXQhrK0mmNGCBoBNI3l25y04p2PvEHvWsH5YNlwHYiArTiEYs3/TF I+eBcQypZ0gS7f889DIJNrr9BziPE8lNBNlB9/2nl2VBKrprhyRv3q7cix4CLgz+Qf3y aPqNp1A65fqxY3U+oUMbjgDttv0Pri8VJyBQlK0JwykpevQZlzT8UgDebjx6yX82pltu kjxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=S1d8R4fxSbVurDHEW7+ecfC3jg7gWo/Eeo/+fPr7q8Q=; b=oCeQiMVaOs++tu0OKgvfHy9zBboSUeN81ry5tAY5PO83qaLm/nD8GWPP81GRBmyJ7t RMIHhJdSBa5vZLIIJqld6D1l14NeqV1eszJfE81cjyV8Z5DIKPJjum6Y+hRryXj0+YPf lqo6qX1dUY/vTCpH3cVkt4FUNBDcnKi+IXA0K5zrBslA793AgTYgq42IsJ0NOT26fred VOQ0gyAqIzKH7/kFLVbJfXm1USLjZs7v5NabTg0w9c4YzM0YFMK2381u5xyZT+3VRV0e MtHD0jT5N1hFUW0xBiiy/AGhK+nb6Eomz98F3feoBJtTSp8KK9bnT3Yw/bd4DITHUf1E Sfyw== X-Gm-Message-State: APjAAAXWhgIs5Zy2li8ezpCsF7KpEEgaGE2fvaIB7E6N9pcTe7GK9p2t TPjJn7bvOkJgYZtc7TmEpQ58Q2+TjqE= X-Google-Smtp-Source: APXvYqwo9zafkjP6lu8LAO6vOFHGJq1ArI9mdYYYZzDx1jiejej2wr6TtZVLXHHvkZYETk82vP8OpQ== X-Received: by 2002:ac8:43cc:: with SMTP id w12mr9663795qtn.231.1572814962131; Sun, 03 Nov 2019 13:02:42 -0800 (PST) Original-Received: from ?IPv6:2607:f2c0:e176:2c:4d18:683c:fcb2:ffb1? ([2607:f2c0:e176:2c:4d18:683c:fcb2:ffb1]) by smtp.gmail.com with ESMTPSA id x12sm6274796qkh.96.2019.11.03.13.02.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Nov 2019 13:02:41 -0800 (PST) In-Reply-To: <20191103203946.GB37523@breton.holly.idiocy.org> X-Mailer: Apple Mail (2.3601.0.10) X-Mailman-Approved-At: Sun, 03 Nov 2019 16:50:47 -0500 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: 209.51.188.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:170904 Archived-At: --Apple-Mail=_132DE6EA-2D41-4E7C-9648-0E444CF2CE7F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Thanks Alan. I might be a little over my head here, as I=E2=80=99m not = sure how to apply a patch. I presume I would have to build from = source... > On Nov 3, 2019, at 3:39 PM, Alan Third wrote: >=20 > On Sat, Nov 02, 2019 at 06:19:27AM -0400, Michael Dixon wrote: >>=20 >> On macOS Catalina, if I attempt to open a file using >> * File > Open >> * The toolbar button >> * "Open a File" on the splash screen >>=20 >> Emacs crashes. I am using the Homebrew formula with GUI. I have tried >> with other Mac Emacs distributions, such as GNU Emacs for Mac OS X = and >> the Homebrew emacs-plus formula with the same result. >>=20 >> Here's the part of the macOS crash report that I think is useful: >>=20 >> Application Specific Information: >> *** Terminating app due to uncaught exception = 'NSObjectNotAvailableException', >> reason: 'EmacsSavePanel is not a supported subclass for sandboxing' >> abort() called >> terminating with uncaught exception of type NSException >=20 > That sounds suspiciously like the fact we=E2=80=99ve subclassed the = save panel > class means it=E2=80=99s no longer considered =E2=80=98safe=E2=80=99 = by Cocoa. >=20 > I suspect there=E2=80=99s no immediate work=E2=80=90around other than = trying to work > out what about EmacsSavePanel is problematic. >=20 > Can you try applying the patch below? I don=E2=80=99t think it=E2=80=99l= l fix > anything, but it should at least rule out that it=E2=80=99s something = in these > functions that=E2=80=99s causing this. >=20 > modified src/nsfns.m > @@ -3067,25 +3067,25 @@ The position is returned as a cons cell (X . = Y) of the > } >=20 > @implementation EmacsSavePanel > -- (BOOL)performKeyEquivalent:(NSEvent *)theEvent > -{ > - BOOL ret =3D handlePanelKeys (self, theEvent); > - if (! ret) > - ret =3D [super performKeyEquivalent:theEvent]; > - return ret; > -} > +// - (BOOL)performKeyEquivalent:(NSEvent *)theEvent > +// { > +// BOOL ret =3D handlePanelKeys (self, theEvent); > +// if (! ret) > +// ret =3D [super performKeyEquivalent:theEvent]; > +// return ret; > +// } > @end >=20 >=20 > @implementation EmacsOpenPanel > -- (BOOL)performKeyEquivalent:(NSEvent *)theEvent > -{ > - // NSOpenPanel inherits NSSavePanel, so passing self is OK. > - BOOL ret =3D handlePanelKeys (self, theEvent); > - if (! ret) > - ret =3D [super performKeyEquivalent:theEvent]; > - return ret; > -} > +// - (BOOL)performKeyEquivalent:(NSEvent *)theEvent > +// { > +// // NSOpenPanel inherits NSSavePanel, so passing self is OK. > +// BOOL ret =3D handlePanelKeys (self, theEvent); > +// if (! ret) > +// ret =3D [super performKeyEquivalent:theEvent]; > +// return ret; > +// } > @end >=20 > --=20 > Alan Third --Apple-Mail=_132DE6EA-2D41-4E7C-9648-0E444CF2CE7F Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Thanks Alan. I might be a little over my head here, as I=E2=80=99= m not sure how to apply a patch. I presume I would have to build from = source...

On Nov 3, 2019, at 3:39 PM, Alan Third <alan@idiocy.org> = wrote:

On Sat, Nov 02, 2019 at = 06:19:27AM -0400, Michael Dixon wrote:

On macOS Catalina, if = I attempt to open a file using
 * File > Open
 * The toolbar button
 * "Open a = File" on the splash screen

Emacs crashes. I = am using the Homebrew formula with GUI. I have tried
with = other Mac Emacs distributions, such as GNU Emacs for Mac OS X and
the Homebrew emacs-plus formula with the same result.

Here's the part of the macOS crash report that = I think is useful:

Application Specific = Information:
*** Terminating app due to uncaught exception = 'NSObjectNotAvailableException',
reason: 'EmacsSavePanel = is not a supported subclass for sandboxing'
abort() = called
terminating with uncaught exception of type = NSException

That sounds suspiciously like the fact we=E2=80=99ve = subclassed the save panel
class means it=E2=80=99s no longer considered =E2=80=98safe=E2=80= =99 by Cocoa.

I suspect = there=E2=80=99s no immediate work=E2=80=90around other than trying to = work
out what = about EmacsSavePanel is problematic.

Can you try applying the patch below? I don=E2=80=99t think = it=E2=80=99ll fix
anything, but it should at least rule out that it=E2=80=99s = something in these
functions that=E2=80=99s causing this.

modified =   src/nsfns.m
@@ -3067,25 +3067,25 @@ The position is returned as a cons = cell (X . Y) of the
}

@implementation= EmacsSavePanel
-- (BOOL)performKeyEquivalent:(NSEvent *)theEvent
-{
-  BOOL ret =3D handlePanelKeys (self, = theEvent);
-  if (! = ret)
- =    ret =3D [super = performKeyEquivalent:theEvent];
-  return ret;
-}
+// - = (BOOL)performKeyEquivalent:(NSEvent *)theEvent
+// {
+//   BOOL ret =3D = handlePanelKeys (self, theEvent);
+//   if (! ret)
+//     ret =3D [super = performKeyEquivalent:theEvent];
+//   return ret;
+// }
@end


@implementation EmacsOpenPanel
-- (BOOL)performKeyEquivalent:(NSEvent *)theEvent
-{
-  // NSOpenPanel inherits NSSavePanel, so passing self = is OK.
-  BOOL = ret =3D handlePanelKeys (self, theEvent);
-  if (! ret)
-    ret =3D [super = performKeyEquivalent:theEvent];
-  return ret;
-}
+// - = (BOOL)performKeyEquivalent:(NSEvent *)theEvent
+// {
+//   // NSOpenPanel = inherits NSSavePanel, so passing self is OK.
+//   BOOL ret =3D = handlePanelKeys (self, theEvent);
+//   if (! ret)
+//     ret =3D [super = performKeyEquivalent:theEvent];
+//   return ret;
+// }
@end

-- Alan = Third

= --Apple-Mail=_132DE6EA-2D41-4E7C-9648-0E444CF2CE7F--