GNU bug report logs - #54677
Creating core files on macOS (Monterey)

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Perry Smith <pedz@HIDDEN>; dated Sat, 2 Apr 2022 01:31:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 54677 <at> debbugs.gnu.org:


Received: (at 54677) by debbugs.gnu.org; 2 Apr 2022 14:16:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 02 10:16:43 2022
Received: from localhost ([127.0.0.1]:46368 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1naeYV-0001ZF-7b
	for submit <at> debbugs.gnu.org; Sat, 02 Apr 2022 10:16:43 -0400
Received: from quimby.gnus.org ([95.216.78.240]:49536)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1naeYT-0001Tf-EE
 for 54677 <at> debbugs.gnu.org; Sat, 02 Apr 2022 10:16:41 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=GctQ+b5UOPtFh7mmvJIPZN/tKYmFAOy+F4DrJkV+G0M=; b=rKX8/5/U9zLnH5b54HqcpCQIYj
 XWw6WCSTectVcDheUCoASknuDcVtecgVc6ho5Uf3DqSSB1fG3L2CXYZjDfwhW8GGEvhbgWkMk19C6
 junasn+ScSKa3o1kedRSkc9QaJdtzsLb+gDEAR1A0d9GNfQryKdfiorFDEdFdiaBvfhU=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1naeYK-0006SZ-2m; Sat, 02 Apr 2022 16:16:34 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Perry Smith <pedz@HIDDEN>
Subject: Re: bug#54677: Creating core files on macOS (Monterey)
References: <1DAC996D-BBF6-4E3E-A0FB-EBD05CC9AFD2@HIDDEN>
X-Now-Playing: Pet Shop Boys's _Actually_: "It's a sin"
Date: Sat, 02 Apr 2022 16:16:31 +0200
In-Reply-To: <1DAC996D-BBF6-4E3E-A0FB-EBD05CC9AFD2@HIDDEN> (Perry
 Smith's message of "Fri, 1 Apr 2022 18:54:56 -0500")
Message-ID: <87fsmvk1ts.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Perry Smith <pedz@HIDDEN> writes: > As I mentioned
 in an email on the developers list, making emacs > remains a drop dead easy
 process where > > ./configure ; make ; make install Note that you don't have
 to say "make install" -- you can just run it from src/emacs in the build
 directory (and that's usually a lot more convenient when building things
 yourself).
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 54677
Cc: Alan Third <alan@HIDDEN>, 54677 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Perry Smith <pedz@HIDDEN> writes:

> As I mentioned in an email on the developers list, making emacs
> remains a drop dead easy process where
>
> ./configure ; make ; make install

Note that you don't have to say "make install" -- you can just run it
from src/emacs in the build directory (and that's usually a lot more
convenient when building things yourself).

> To get the Emacs.app to launch, the quarantine needs to be removed and
> that is done with:
>
> sudo xattr -rds com.apple.quarantine nextstep/Emacs.app

And then you don't have to do this, for instance.

> To get an application to create a core file two particular things need
> to be done.  The resource limit for core files needs to be set to the
> max.  And an entitlement needs to be applied to the application.
>
> The first I accomplished with this code change:
>
> diff -r emacs-orig-27.2/src/emacs.c emacs-new-27.2/src/emacs.c
> 1226c1226,1234
> < 
> ---
>> #if defined (HAVE_SETRLIMIT) && defined (RLIMIT_CORE) && !defined (CYGWIN)
>>   if (getrlimit (RLIMIT_CORE, &rlim) == 0
>>       && 0 <= rlim.rlim_cur && rlim.rlim_cur <= rlim.rlim_max)
>>     {
>>       rlim.rlim_cur = rlim.rlim_max;
>>       setrlimit (RLIMIT_CORE, &rlim); /* Error??? */
>>     }  
>> #endif /* HAVE_SETRLIMIT and RLIMIT_CORE and not CYGWIN */

Is this necessary when you're not running installed?

I've added Alan to the CCs; perhaps he has some comments.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#54677; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 2 Apr 2022 01:30:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 01 21:30:11 2022
Received: from localhost ([127.0.0.1]:44016 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1naSah-00074q-0V
	for submit <at> debbugs.gnu.org; Fri, 01 Apr 2022 21:30:11 -0400
Received: from lists.gnu.org ([209.51.188.17]:36094)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pedz@HIDDEN>) id 1naR6f-0004OY-Qd
 for submit <at> debbugs.gnu.org; Fri, 01 Apr 2022 19:55:06 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45760)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <pedz@HIDDEN>)
 id 1naR6f-000324-DR
 for bug-gnu-emacs@HIDDEN; Fri, 01 Apr 2022 19:55:05 -0400
Received: from bird.elm.relay.mailchannels.net ([23.83.212.17]:50997)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <pedz@HIDDEN>)
 id 1naR6d-0006FB-Do
 for bug-gnu-emacs@HIDDEN; Fri, 01 Apr 2022 19:55:05 -0400
X-Sender-Id: a2hosting|x-authuser|pedz+easesoftware.com@HIDDEN
Received: from relay.mailchannels.net (localhost [127.0.0.1])
 by relay.mailchannels.net (Postfix) with ESMTP id 5C1CE1213C7
 for <bug-gnu-emacs@HIDDEN>; Fri,  1 Apr 2022 23:54:58 +0000 (UTC)
Received: from mi3-ss4.a2hosting.com (unknown [127.0.0.6])
 (Authenticated sender: a2hosting)
 by relay.mailchannels.net (Postfix) with ESMTPA id C47231214DE
 for <bug-gnu-emacs@HIDDEN>; Fri,  1 Apr 2022 23:54:57 +0000 (UTC)
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1648857297; a=rsa-sha256;
 cv=none;
 b=SCjMMaFJRBI+T7cCps8iQ6d1W9n0cDZveXDB5MOxeZzj3nkTD9TJl+/LsMoRqKzmgU5Nb7
 zzZMTEdDkllwB9GGy1ITJrT/aMBmVyrPRbfX1YCAYX9IrJA2/urxHSGwvcw9XGSBTH9f7u
 e7lT9bs/6Ve94pspwO+9PLGaExqavFM69mZKsngZ7eXxAKANVVxxtW1Owahh+DsoV8vH++
 i+RCNCUc150eyhphxqBEH0mtX8OgPYIQTxaIHy9j58Flsh3K0txUgAfBeTKjwc+2zHai6L
 tknE3G6wcm4ywVUxNlT5X5tmz6zu6a/+d8lBzPinHHUrtVdk1OcCICH6J7LN4g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
 d=mailchannels.net; s=arc-2022; t=1648857297;
 h=from:from: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:dkim-signature;
 bh=poqmwDb5W1NY1Vx3bgJITbGgJqJYSFUwl7E2KCUSGyI=;
 b=HQUX1LSVFCeiwSx/WvgCv2zLWkRm4noPP+uPzZZL9fhJFAUYZN/pBtwoY8SaioFDevFbtp
 7AVy1Qq1ZHKXsIrVMZlFaRnomYdgBL2mGBgUTdx4rwLSW4fQqNVS4CmFicDfGcMXWJRdMy
 d26PDDNoNFoEGQY4Qu8zmPICRNqMx3zEFQgTC7UtHdeRXtoHzJwHbumarxiJwSCLZHIdAK
 tIHFkpRm7Oulz4DbPCP66UudohG39Ttm9BXoKkcxQkHGIx3ITceyC4Ml7rNfuLMHk6LCL2
 DQDGaCS+hMo5EBnPrWkOHNHfMSDrrlO98lR4xo6oYO7WSOBfw90KksR1k3iSZQ==
ARC-Authentication-Results: i=1; rspamd-786f77c8d-9vgs5;
 auth=pass smtp.auth=a2hosting smtp.mailfrom=pedz@HIDDEN
X-Sender-Id: a2hosting|x-authuser|pedz+easesoftware.com@HIDDEN
Received: from mi3-ss4.a2hosting.com (mi3-ss4.a2hosting.com [68.66.200.199])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384)
 by 100.124.238.97 (trex/6.7.1); Fri, 01 Apr 2022 23:54:58 +0000
X-MC-Relay: Neutral
X-MailChannels-SenderId: a2hosting|x-authuser|pedz+easesoftware.com@HIDDEN
X-MailChannels-Auth-Id: a2hosting
X-Attack-Share: 0e49e1e056a62563_1648857298128_3463995116
X-MC-Loop-Signature: 1648857298128:1546667119
X-MC-Ingress-Time: 1648857298128
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=easesoftware.com; s=default; h=To:Date:Message-Id:Subject:Mime-Version:
 Content-Transfer-Encoding:Content-Type:From:Sender:Reply-To:Cc:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=ZutN2jPg2/XHRPm/qrlae5YEOMWkAMS6l8Au4ZtkLSI=; b=HySduRHxqF5t8iF0iMUoVSkX1L
 7G0/JUtgiswQOcdtAyuXMnQPfe9tMxZn7HuqgCRD0p78BkZPePHc+2PPKY+Y6ef76STsynG/Ypv/8
 oLipGLHaPrtV9oiDwBXfOMBaRstjKpbvCZQj+WNju7R5d/mE5vhytB/7K+bEuKJXwlxBl89EdCclk
 SuUxhH3Tm3pHztZnZXmm696WX7Zkf3OuauDZUjFOMSs4oq/l4nOjVoi9AMlFHyMEr0Fgf6RLkCyVy
 BXEUEu2Ru8MgMkKOHjiJXcy/Rp7xiteAYWl/2a3bQLl84rC1NJf7+khJGapIYsZSU7yZOWkCVxDad
 4Llbev2Q==;
Received: from cpe-70-94-128-193.satx.res.rr.com ([70.94.128.193]:50284
 helo=smtpclient.apple)
 by mi3-ss4.a2hosting.com with esmtpsa (TLS1.2) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2)
 (envelope-from <pedz@HIDDEN>) id 1naR6W-0000jM-TN
 for bug-gnu-emacs@HIDDEN; Fri, 01 Apr 2022 19:54:56 -0400
From: Perry Smith <pedz@HIDDEN>
Content-Type: text/plain;
	charset=utf-8
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\))
Subject: Creating core files on macOS (Monterey)
Message-Id: <1DAC996D-BBF6-4E3E-A0FB-EBD05CC9AFD2@HIDDEN>
Date: Fri, 1 Apr 2022 18:54:56 -0500
To: bug-gnu-emacs@HIDDEN
X-Mailer: Apple Mail (2.3696.80.82.1.1)
X-AuthUser: pedz+easesoftware.com@HIDDEN
Received-SPF: pass client-ip=23.83.212.17; envelope-from=pedz@HIDDEN;
 helo=bird.elm.relay.mailchannels.net
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,
 RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Fri, 01 Apr 2022 21:30:10 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

The CONTRIBUTE document says to submit feature requests, etc to this
list.

I wish I could provide more expertise on this topic but I=E2=80=99m not =
a
serious macOS developer.  I've cobbled together the info below over
the past few days.

Apple (like AIX) has decided that core files are bad and so has
disabled them in the normal activities.  So, a few things need to be
done to get a core file from a particular applicaiton.

Another Apple trait seems to be that if they did it yesterday, it must
be changed for today.  Thus, what follows is ONLY for Monterey (I've
been told).  The previous Apple releases require some but not all of
these changes.  AND... it appears that what is required for the M1
chips (Arm / Apple silicon) is not the same as what is required for
Intel chips.  So... I know that without these changes core dumps on
Monterey with an M1 chip were not created and after these changes they
are.

As I mentioned in an email on the developers list, making emacs
remains a drop dead easy process where

./configure ; make ; make install

creates nextstep/Emacs.app

ls -ld@ nextstep/Emacs.app

shows:

drwxr-xr-x@ 3 pedz  staff  96 Apr  1 18:08 nextstep/Emacs.app
	com.apple.quarantine	57=20

To get the Emacs.app to launch, the quarantine needs to be removed and
that is done with:

sudo xattr -rds com.apple.quarantine nextstep/Emacs.app

The app can then be moved to /Applications and it will launch via
Finder, etc but will not create a core file.

To get an application to create a core file two particular things need
to be done.  The resource limit for core files needs to be set to the
max.  And an entitlement needs to be applied to the application.

The first I accomplished with this code change:

diff -r emacs-orig-27.2/src/emacs.c emacs-new-27.2/src/emacs.c
1226c1226,1234
<=20
---
> #if defined (HAVE_SETRLIMIT) && defined (RLIMIT_CORE) && !defined =
(CYGWIN)
>   if (getrlimit (RLIMIT_CORE, &rlim) =3D=3D 0
>       && 0 <=3D rlim.rlim_cur && rlim.rlim_cur <=3D rlim.rlim_max)
>     {
>       rlim.rlim_cur =3D rlim.rlim_max;
>       setrlimit (RLIMIT_CORE, &rlim); /* Error??? */
>     } =20
> #endif /* HAVE_SETRLIMIT and RLIMIT_CORE and not CYGWIN */
>  =20

The second I accomplished with this small script:

#!/bin/zsh

EMACS=3D/Applications/Emacs.app
if [[ -d nextstep/Emacs.app ]] ; then
  sudo rm -rf ${EMACS}
  sudo mv nextstep/Emacs.app ${EMACS}
  rm -f /tmp/entitlements
  /usr/libexec/PlistBuddy -c "Add :com.apple.security.get-task-allow =
bool true" /tmp/entitlements
  sudo codesign -s - -f --deep --entitlements tmp.entitlements ${EMACS}
else
  echo nextstep/Emacs.app is not present
fi

The PlistBuddy command will spew out a message:

File Doesn't Exist, Will Create: /tmp/entitlements





Acknowledgement sent to Perry Smith <pedz@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#54677; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 2 Apr 2022 14:15:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.