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

From: Aaron Jensen <[email-masked]>
Date: Fri, 30 Dec 2022 10:50:42 -0500

On Fri, Dec 30, 2022 at 10:27 AM Gerd Möllmann <[email-masked]> wrote:
>
> On 30.12.22 14:52, Aaron Jensen wrote:
> > On Fri, Dec 30, 2022 at 8:37 AM Aaron Jensen <[email-masked]> wrote:
> >>
> >> On Fri, Dec 30, 2022 at 3:42 AM Gerd Möllmann <[email-masked]> wrote:
> >>>
> >>> 13.1 on an M1.
> >>
> >> Ok, same. Did you allow everything to native compile before starting
> >> the restart loop?
> >
> > Also, please try to run it outside of LLDB and see if it crashes there.
>
> It seem to depend on "-g -O0" plus running in LLDB.
>
> With "-g -O0" and without LLDB, the first restart terminates with
>
> ~/tmp/ > HOME=. ~/emacs/master/src/emacs
> dyld[4467]: Assertion failed: (this->magic == kMagic), function
> contains, file Loader.cpp, line 144.

Yes, this is what I see. The Apple error reporter shows me the full
stack trace I've submitted. I'm glad I'm not the only one. For me, it
does not depend on "-g -O0", but that does appear to make it more
likely.

> With LLDB, it stops like this between restarts
>
> * thread #21, stop reason = exec
>      frame #0: 0x0000000100b50950 dyld`_dyld_start
>
> but happily chips on after each "continue" in LLDB.

I'm guessing the exec breakpoint is expected and not problematic.
Xcode doesn't do this, and I can make LLDB crash, it just takes a few
times for me.

> I don't see at the moment how to proceed with this.  Maybe it's worth
> trying to use a helper process for restarting Emacs, as you described
> elsewhere if I remember that right.

I don't think this is necessary since I've seen what appears to be the
same crash on a fresh start (without restarting).

I don't know how to proceed either. Without any additional evidence,
the only thing I can guess is that we are hitting the same thing that
Xojo is:

https://www.mbs-plugins.de/archive/2022-12-28/Avoiding_macOS_Ventura_crashes/monkeybreadsoftware_blog_xojo

Their current plan is to wait and see if Apple fixes it, but 13.2 beta
doesn't appear to have fixed it yet, so it may be a while. In the
interim, I'm just sending every crash report to Apple and starting
Emacs anew whenever it crashes (which thankfully under normal use
isn't all that often).

Aaron