From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrew De Angelis Newsgroups: gmane.emacs.devel Subject: Re: Volunteering to help on etc/TODO item: Improved xwidgets support Date: Fri, 21 Oct 2022 19:29:52 -0400 Message-ID: References: <87k04wa97f.fsf@yahoo.com> <5E2D44D4-1D11-4531-9F0E-FD46F2B86FE1@stanford.edu> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000417f4505eb93d2a4" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21662"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Qiantan Hong , Po Lu , "emacs-devel@gnu.org" To: =?UTF-8?Q?Daniel_Mart=C3=ADn?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Oct 22 08:33:16 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1om84K-0005TA-AA for ged-emacs-devel@m.gmane-mx.org; Sat, 22 Oct 2022 08:33:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1om7hd-0006Av-Th; Sat, 22 Oct 2022 02:09:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1om1T0-0003UG-Qa for emacs-devel@gnu.org; Fri, 21 Oct 2022 19:30:18 -0400 Original-Received: from mail-vs1-xe2d.google.com ([2607:f8b0:4864:20::e2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1om1Sn-000416-B4 for emacs-devel@gnu.org; Fri, 21 Oct 2022 19:30:18 -0400 Original-Received: by mail-vs1-xe2d.google.com with SMTP id p7so2739161vsr.7 for ; Fri, 21 Oct 2022 16:30:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=1BgUELobp9R9NdqVMksl/8wrU/9mcikvu5RkvcGQHlk=; b=pWQ1TCiJw3iudDcEzkuBLHpTj+CRVtBzc0Tl7UEAHRSF7uLKsm/GkReVQL3cDfkRYH 72y5ksC3dDpnYKUso3dI2hSu+fhd81Kn3MoUQdp6F31OxqE8amdjbJEGv29yXiNi9FxB 5peFnZa9K5xaqFs5L7lMBDS/l5al9idowTxWsCg0M+1csoVRikIx361+vNtwJiZdyUVv r9bJjgUDhgzh3oe42rBtPhW5RK5mR0qveWfINfM8/lzr0Mu1k3klyH+sYrdgMK1fHC2L eHvT3umGSEwnPvsqxjRYc/AMndV969rc6ns9RuCh1K2gt6gDraXIbqqDZqzXqEhchh6l 71Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1BgUELobp9R9NdqVMksl/8wrU/9mcikvu5RkvcGQHlk=; b=d674slVyEu7fUdc3DaVIENy61HgMUDFr/cDDpB9RkJnxY8cEp4oN4iFXI9nf/5nO8k A3s3B6Ncw3//4eaSdJW2VfEA8PtVdIM1D2QLoMxKoSGTKdLI86FGAVW2a4AHSjXvSVeY oG2ME8qxMljQL+1QTWMPeXTmQdWfMahtGBqIG7bqZqqngmuep8xaF6+cw25f+bCzItKk vHyBi5Vv7qrEQN736S8lKATYfMazwLHCi9hoAcz7eaBH6aWa0tvl4p3KZyt045mmQEiN 2fpkf9bv0MMj0nVqiUDXC+Kx7e7xGCxSOGPZ998sS8DcNE5X5OIMuy2b+ozRSW3PRWLH 8XRQ== X-Gm-Message-State: ACrzQf3V9fKiXngXQ+l9ozju4uMo7d9mpvoZSOGpu6decL+eGTl3Kvzh 2PUzaOkG93+Z4oZc/74cjEg41ahR0C21Jj3w4ws= X-Google-Smtp-Source: AMsMyM4d5iey94z4TUN81QqmjVS93Fp7Bic8p/xurfwQ73jEzQC/U+tnudFMXtHo2jeJIU16kYqYcrgxu3STt8+t7qU= X-Received: by 2002:a05:6102:3c90:b0:3a7:d1d3:10d3 with SMTP id c16-20020a0561023c9000b003a7d1d310d3mr13699666vsv.50.1666395003779; Fri, 21 Oct 2022 16:30:03 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::e2d; envelope-from=bobodeangelis@gmail.com; helo=mail-vs1-xe2d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 22 Oct 2022 02:09:46 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "Emacs-devel" Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:298255 Archived-At: --000000000000417f4505eb93d2a4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks Daniel! That's very helpful. I was looking at documentation online regarding profiling Emacs, but most of it is GNU/Linux focused so they'd all mention gprof, which to my understanding doesn't work on Mac. I'll work on using the Instruments.app, that should be very helpful in finding the leaks. On Thu, Oct 20, 2022 at 7:13 AM Daniel Mart=C3=ADn wro= te: > Andrew De Angelis writes: > > > Great, thanks Qiantian for the info. > > I'm looking into ways to adapt the Objective C code to use manual > reference > > counting rather than ARC. Is this a problem that other Objective-C Emac= s > > files have? Maybe I can also come up with some general rules/approaches > to > > help people fix the problem in other files. > > One thing that would be very helpful is if you (or anyone else) is awar= e > of > > somebody making this fix (ARC -> MRC in Objective C) before: most of th= e > > tutorials/documentation I'm finding on the topic is on how to go in the > > opposite direction, which is helpful information but I'm stuck "reverse > > engineering" the whole approach. > > > > I'd also suggest instrumenting Emacs with Instruments.app and the > "Leaks" profile. The generated profile will indicate if there are > retain/release/autorelease problems that led to leaked objects under > the MRC model. > > In recent versions of macOS you might have problems running Emacs under > Instruments.app. One way to resolve this problem is by embedding a > custom entitlement that sets "com.apple.security.get-task-allow" and > then signing the binary again. That is, run this command from a shell: > > $ codesign -s - -v -f --entitlements Entitlements.plist emacs > > In the command above, "emacs" is the built Emacs binary and > Entitlements.plist should contain this text: > > > https://www.apple.com/DTDs/PropertyList-1.0.dtd"> > > > com.apple.security.get-task-allow > > > > > > I suspect this tweak could perfectly be part of the Emacs build system > for NS, but I haven't investigated further. > --000000000000417f4505eb93d2a4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks Daniel! That's very helpful. I was looking at d= ocumentation online regarding profiling Emacs, but most of it is GNU/Linux = focused so they'd all mention gprof, which to my understanding doesn= 9;t work on Mac.=C2=A0
I'll work on using the Instruments.app, that= should be very helpful in finding the leaks.

On Thu, Oct 20, 2022 at = 7:13 AM Daniel Mart=C3=ADn <mardan= i29@yahoo.es> wrote:
Andrew De Angelis <bobodeangelis@gmail.com> writes:

> Great, thanks Qiantian for the info.
> I'm looking into ways to adapt the Objective C code to use manual = reference
> counting rather than ARC. Is this a problem that other Objective-C Ema= cs
> files have? Maybe I can also come up with some general rules/approache= s to
> help people fix the problem in other files.
> One thing that would be very helpful is if you (or anyone else) is awa= re of
> somebody making this fix (ARC -> MRC in Objective C) before: most o= f the
> tutorials/documentation I'm finding on the topic is on how to go i= n the
> opposite direction, which is helpful information but I'm stuck &qu= ot;reverse
> engineering" the whole approach.
>

I'd also suggest instrumenting Emacs with Instruments.app and the
"Leaks" profile.=C2=A0 The generated profile will indicate if the= re are
retain/release/autorelease problems that led to leaked objects under
the MRC model.

In recent versions of macOS you might have problems running Emacs under
Instruments.app.=C2=A0 One way to resolve this problem is by embedding a custom entitlement that sets "com.apple.security.get-task-allow" = and
then signing the binary again.=C2=A0 That is, run this command from a shell= :

$ codesign -s - -v -f --entitlements Entitlements.plist emacs

In the command above, "emacs" is the built Emacs binary and
Entitlements.plist should contain this text:

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd"= ;>
<plist version=3D"1.0">
=C2=A0 <dict>
=C2=A0 =C2=A0 <key>com.apple.security.get-task-allow
=C2=A0 =C2=A0 </key>
=C2=A0 =C2=A0 <true/>
=C2=A0 </dict>
</plist>

I suspect this tweak could perfectly be part of the Emacs build system
for NS, but I haven't investigated further.
--000000000000417f4505eb93d2a4--