Subject: bug#60220: 29.0.60; macOS 13.1 crash shortly after starting Emacs

From: Aaron Jensen <[email-masked]>
Date: Sat, 24 Dec 2022 10:11:02 -0500

On Fri, Dec 23, 2022 at 12:56 AM Paul Eggert <[email-masked]> wrote:
>
> On 12/22/22 18:22, Aaron Jensen wrote:
> > Task policy
> > set failed: 4 ((os/kern) invalid argument)
>
> A Google search reports that message only here:
>
> https://developer.apple.com/forums/thread/670595
>
> and that was solved by invoking Apple support. Is that something you can do?

I don't know if it's related or just because I am running in the
XCode's debugger, but when I do that, I see additional messages:

2022-12-24 10:05:30.309314-0500 emacs[5082:176291] [assertion] Error
acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2
"Specified target process does not exist"
UserInfo={NSLocalizedFailureReason=Specified target process does not
exist}>

2022-12-24 10:05:30.309369-0500 emacs[5082:176291] [process] Failed to
acquire AppNap adapter assertion with error Error
Domain=RBSAssertionErrorDomain Code=2 "Specified target process does
not exist" UserInfo={NSLocalizedFailureReason=Specified target process
does not exist}

2022-12-24 10:05:30.309394-0500 emacs[5082:176291] Task policy set
failed: 4 ((os/kern) invalid argument)

Also, when running from the `src/emacs` binary, after a restart the
application icon in macOS changes to the terminal icon with the word
`exec` in it.

Per: https://stackoverflow.com/questions/27479801/restart-application-programmatically
and: http://13bold.com/tutorials/relaunching-your-application/

I wonder if this method of restarting is just not the right idea on
macOS and it either needs to be relaunched with a helper utility or in
a completely separate process directly as described in some of the
further down stackoverflow answers.

Aaron