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

From: Aaron Jensen <[email-masked]>
Date: Sun, 25 Dec 2022 14:30:14 -0500

Unfortunately, I just got a crash:

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               Emacs [642]
Path:                  /opt/homebrew/*/Emacs.app/Contents/MacOS/Emacs
Identifier:            org.gnu.Emacs
Version:               Version 29.0.60 (9.0)
Code Type:             ARM-64 (Native)
Parent Process:        launchd [1]
User ID:               501

Date/Time:             2022-12-25 14:28:45.8693 -0500
OS Version:            macOS 13.1 (22C65)
Report Version:        12
Anonymous UUID:        CD1F31D7-5E61-2935-643D-55F58CD29C12

Sleep/Wake UUID:       2679CDEF-2FD4-4A89-92F7-619CD5C1E50A

Time Awake Since Boot: 60000 seconds
Time Since Wake:       2033 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGABRT)
Exception Codes:       KERN_INVALID_ADDRESS at 0x00000000000000f9
Exception Codes:       0x0000000000000001, 0x00000000000000f9

VM Region Info: 0xf9 is not in any region.  Bytes before following
region: 105553518919431
      REGION TYPE                    START - END         [ VSIZE]
PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->
      MALLOC_NANO (reserved)   600018000000-600020000000 [128.0M]
rw-/rwx SM=NUL  ...(unallocated)

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib               0x1a6d621b0 __pthread_kill + 8
1   libsystem_pthread.dylib               0x1a6d98cec pthread_kill + 288
2   libsystem_c.dylib                     0x1a6c9aa50 raise + 32
3   Emacs                                 0x10431daec
terminate_due_to_signal + 204
4   Emacs                                 0x10431e2f0 emacs_abort + 20
5   Emacs                                 0x1042ecdb0 ns_term_shutdown + 132
6   Emacs                                 0x1041d8b94 shut_down_emacs + 332
7   Emacs                                 0x10431dab4
terminate_due_to_signal + 148
8   Emacs                                 0x1041fb084 handle_fatal_signal + 16
9   Emacs                                 0x1041fb100
deliver_thread_signal + 124
10  Emacs                                 0x1041f9700
deliver_fatal_thread_signal + 12
11  Emacs                                 0x1041fb160 handle_sigsegv + 96
12  libsystem_platform.dylib             0x1a6dc72a4 _sigtramp + 56
13  ???                            0xffff8001a6a99380 ???
14  dyld                                 0x1a6a99d54
lsl::BTree<lsl::Allocator::Buffer,
std::__1::less<lsl::Allocator::Buffer>,
false>::erase(lsl::BTree<lsl::Allocator::Buffer,
std::__1::less<lsl::Allocator::Buffer>, false>::const_iterator) + 76
15  dyld                                 0x1a6a999fc
lsl::PersistentAllocator::reserveRange(lsl::BTree<lsl::Allocator::Buffer,
lsl::PersistentAllocator::RegionSizeCompare, false>::const_iterator&,
lsl::Allocator::Buffer) + 264
16  dyld                                 0x1a6a9a0b0
lsl::PersistentAllocator::allocate_buffer(unsigned long, unsigned
long, unsigned long, lsl::Allocator**) + 624
17  dyld                                 0x1a6a991e0
lsl::Allocator::aligned_alloc(unsigned long, unsigned long) + 180
18  dyld                                 0x1a6a99230
lsl::Allocator::strdup(char const*) + 48
19  dyld                                 0x1a6a968b8
dyld4::FileManager::fileRecordForPath(char const*) + 40
20  dyld                                 0x1a6ab4624
dyld4::Atlas::ProcessSnapshot::Serializer::readMappedFileInfo(std::__1::span<std::byte,
18446744073709551615ul>&, unsigned long long&, lsl::UUID&,
dyld4::FileRecord&) + 132
21  dyld                                 0x1a6ab3170
dyld4::Atlas::ProcessSnapshot::Serializer::deserialize(std::__1::span<std::byte,
18446744073709551615ul>) + 928
22  dyld                                 0x1a6ab2cec
dyld4::Atlas::ProcessSnapshot::ProcessSnapshot(lsl::Allocator&,
dyld4::FileManager&, bool, std::__1::span<std::byte,
18446744073709551615ul>) + 304
23  dyld                                 0x1a6a7ef64
lsl::UniquePtr<dyld4::Atlas::ProcessSnapshot>
lsl::Allocator::makeUnique<dyld4::Atlas::ProcessSnapshot,
lsl::EphemeralAllocator&, dyld4::FileManager&, bool,
std::__1::span<std::byte, 18446744073709551615ul>
const&>(lsl::EphemeralAllocator&, dyld4::FileManager&, bool&&,
std::__1::span<std::byte, 18446744073709551615ul> const&) + 80
24  dyld                                 0x1a6a7bafc
dyld4::RuntimeState::getCurrentProcessSnapshot() + 96
25  dyld                                 0x1a6a7b8cc
dyld4::RuntimeState::notifyDebuggerLoad(std::__1::span<dyld4::Loader
const*, 18446744073709551615ul> const&) + 72
26  dyld                                 0x1a6aaaf3c
dyld4::APIs::dlopen_from(char const*, int, void*)::$_0::operator()()
const + 748
27  dyld                                 0x1a6aa4968
dyld4::APIs::dlopen_from(char const*, int, void*) + 892
28  Emacs                                 0x1042a0db0 Fnative_elisp_load + 356
29  Emacs                                 0x10427c88c Fload + 2104
30  Emacs                                 0x10427e5f0 save_match_data_load + 92
31  Emacs                                 0x104258928
load_with_autoload_queue + 120
32  Emacs                                 0x104264d84 Frequire + 560
33  Emacs                                 0x104254a30 eval_sub + 2236
34  Emacs                                 0x104257158
internal_lisp_condition_case + 884
35  Emacs                                 0x10425489c eval_sub + 1832
36  Emacs                                 0x104254bac Fprogn + 48
37  Emacs                                 0x1042563a8 Fwhile + 80
38  Emacs                                 0x10425489c eval_sub + 1832
39  Emacs                                 0x104254bac Fprogn + 48
40  Emacs                                 0x10425a10c funcall_lambda + 1316
41  Emacs                                 0x104256724 Ffuncall + 316
42  Emacs                                 0x104256724 Ffuncall + 316
43  timer-3ee7cfd9-d55357b5.eln           0x10b104e44
F74696d65722d6576656e742d68616e646c6572_timer_event_handler_0 + 832
44  Emacs                                 0x104256724 Ffuncall + 316
45  Emacs                                 0x1041e5288 timer_check + 892
46  Emacs                                 0x1041e3634 readable_events + 36
47  Emacs                                 0x1041e4eb4 get_input_pending + 56
48  Emacs                                 0x1041e3364
detect_input_pending_run_timers + 48
49  Emacs                                 0x1042ab064
wait_reading_process_output + 3824
50  Emacs                                 0x1041e11e0 read_char + 8656
51  Emacs                                 0x1041dd548 read_key_sequence + 1056
52  Emacs                                 0x1041dbdb8 command_loop_1 + 700
53  Emacs                                 0x10425732c
internal_condition_case + 96
54  Emacs                                 0x1041dbae8 command_loop_2 + 52
55  Emacs                                 0x104256d50 internal_catch + 88
56  Emacs                                 0x10431df18 command_loop.cold.1 + 80
57  Emacs                                 0x1041db488 command_loop + 152
58  Emacs                                 0x1041db344 recursive_edit_1 + 148
59  Emacs                                 0x1041db5a8 Frecursive_edit + 264
60  Emacs                                 0x1041da924 main + 7484
61  dyld                                 0x1a6a6fe50 start + 2544

Thread 1:
0   libsystem_pthread.dylib               0x1a6d93e18 start_wqthread + 0

Thread 2:
0   libsystem_pthread.dylib               0x1a6d93e18 start_wqthread + 0

Thread 3:: gmain
0   libsystem_kernel.dylib               0x1a6d64a00 __select + 8
1   libglib-2.0.0.dylib                   0x10517fb20 g_poll + 424
2   libglib-2.0.0.dylib                   0x105172cc4
g_main_context_iterate + 340
3   libglib-2.0.0.dylib                   0x105172d8c
g_main_context_iteration + 60
4   libglib-2.0.0.dylib                   0x105174124 glib_worker_main + 48
5   libglib-2.0.0.dylib                   0x1051973a8 g_thread_proxy + 68
6   libsystem_pthread.dylib               0x1a6d9906c _pthread_start + 148
7   libsystem_pthread.dylib               0x1a6d93e2c thread_start + 8

Thread 4:
0   libsystem_pthread.dylib               0x1a6d93e18 start_wqthread + 0

Thread 5:
0   libsystem_pthread.dylib               0x1a6d93e18 start_wqthread + 0

Thread 6:
0   libsystem_pthread.dylib               0x1a6d93e18 start_wqthread + 0

Thread 7:
0   libsystem_kernel.dylib               0x1a6d5ffa4 __pselect + 8
1   libsystem_kernel.dylib               0x1a6d5fe7c pselect$DARWIN_EXTSN + 64
2   Emacs                                 0x1042ede90 -[EmacsApp
fd_handler:] + 184
3   Foundation                           0x1a7d79470 __NSThread__start__ + 716
4   libsystem_pthread.dylib               0x1a6d9906c _pthread_start + 148
5   libsystem_pthread.dylib               0x1a6d93e2c thread_start + 8

Thread 8:: com.apple.NSEventThread
0   libsystem_kernel.dylib               0x1a6d59d70 mach_msg2_trap + 8
1   libsystem_kernel.dylib               0x1a6d6b8a4 mach_msg2_internal + 80
2   libsystem_kernel.dylib               0x1a6d625c4 mach_msg_overwrite + 540
3   libsystem_kernel.dylib               0x1a6d5a0ec mach_msg + 24
4   CoreFoundation                       0x1a6e78bc0
__CFRunLoopServiceMachPort + 160
5   CoreFoundation                       0x1a6e774ac __CFRunLoopRun + 1232
6   CoreFoundation                       0x1a6e76888 CFRunLoopRunSpecific + 612
7   AppKit                               0x1aa222410 _NSEventThread + 172
8   libsystem_pthread.dylib               0x1a6d9906c _pthread_start + 148
9   libsystem_pthread.dylib               0x1a6d93e2c thread_start + 8

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000000000000   x2:
0x0000000000000000   x3: 0x0000600003839480
    x4: 0x0000600003839460   x5: 0x0000000000000000   x6:
0x0000000000000067   x7: 0x000000000000001c
    x8: 0xf7585af72d0ca2d0   x9: 0xf7585af52f035850  x10:
0x0000000000000001  x11: 0x0000000000000003
   x12: 0x0000000000000001  x13: 0x0000600002c7cc00  x14:
0x010000020211fee9  x15: 0x000000020211fee8
   x16: 0x0000000000000148  x17: 0x0000000206f407f0  x18:
0x0000000000000000  x19: 0x0000000000000006
   x20: 0x00000002020ffa80  x21: 0x0000000000000103  x22:
0x00000002020ffb60  x23: 0x000002094c88f008
   x24: 0x000000016bce9e01  x25: 0x0000000000000008  x26:
0x00000000000002c0  x27: 0x0000000163bfb7d0
   x28: 0x0000000163bfb840   fp: 0x00000001048d9910   lr: 0x00000001a6d98cec
    sp: 0x00000001048d98f0   pc: 0x00000001a6d621b0 cpsr: 0x40001000
   far: 0x000001374cb34000  esr: 0x56000080  Address size fault

Binary Images:
       0x1a6d59000 -        0x1a6d91ff3 libsystem_kernel.dylib (*)
<aebf397e-e2ef-3a49-be58-23d4558511f6>
/usr/lib/system/libsystem_kernel.dylib
       0x1a6d92000 -        0x1a6d9effb libsystem_pthread.dylib (*)
<132084c6-c347-3489-9ac2-fcaad21cdb73>
/usr/lib/system/libsystem_pthread.dylib
       0x1a6c59000 -        0x1a6cd9ff3 libsystem_c.dylib (*)
<756cd0d2-3241-3a74-8c59-02632dcee221>
/usr/lib/system/libsystem_c.dylib
       0x104110000 -        0x104367fff org.gnu.Emacs (Version
29.0.60) <05fbbbfb-3405-3d9f-a7a0-4fd6430863ba>
/opt/homebrew/*/Emacs.app/Contents/MacOS/Emacs
       0x1a6dc3000 -        0x1a6dcaffb libsystem_platform.dylib (*)
<b215ae90-4ed2-3fcd-8ccc-6c0d93cc4f41>
/usr/lib/system/libsystem_platform.dylib
               0x0 - 0xffffffffffffffff ??? (*)
<00000000-0000-0000-0000-000000000000> ???
       0x1a6a6a000 -        0x1a6af4b63 dyld (*)
<487cfdeb-9b07-39bf-bfb9-970b61aea2d1> /usr/lib/dyld
       0x10b100000 -        0x10b107fff timer-3ee7cfd9-d55357b5.eln
(*) <0f550bba-4a80-3546-98fe-a92aa0d14158>
/opt/homebrew/*/Emacs.app/Contents/native-lisp/29.0.60-c7b10636/preloaded/timer-3ee7cfd9-d55357b5.eln
       0x10513c000 -        0x105223fff libglib-2.0.0.dylib (*)
<f593e720-37ac-3b64-8d96-f9c330062fec>
/opt/homebrew/*/libglib-2.0.0.dylib
       0x1a7d23000 -        0x1a875bfff com.apple.Foundation (6.9)
<f1f5f857-8c3c-36d5-bc27-7702d6795468>
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
       0x1a6df7000 -        0x1a72cefff com.apple.CoreFoundation (6.9)
<fd16d6d9-10c0-323b-b43b-9781c4a4d268>
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
       0x1aa0bf000 -        0x1aafc9fff com.apple.AppKit (6.9)
<dbbd4dea-6c68-3200-a81b-79b6a62f4669>
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 9464
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 532120
    thread_create: 0
    thread_set_state: 48