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

From: Aaron Jensen <[email-masked]>
Date: Tue, 20 Dec 2022 10:25:39 -0500

Here is another trace I just got during a restart. It's slightly
different. This one seems to point to rng-loc at least as part of the
trace.

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

Process:               Emacs [18694]
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-20 10:22:50.8160 -0500
OS Version:            macOS 13.1 (22C65)
Report Version:        12
Anonymous UUID:        CD1F31D7-5E61-2935-643D-55F58CD29C12

Sleep/Wake UUID:       254FA28B-6F01-412E-8D38-DE2EC5BE8B25

Time Awake Since Boot: 17000 seconds
Time Since Wake:       1554 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 0x612f737265735627 ->
0x0000737265735627 (possible pointer authentication failure)
Exception Codes:       0x0000000000000001, 0x612f737265735627

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

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib               0x1820921b0 __pthread_kill + 8
1   libsystem_pthread.dylib               0x1820c8cec pthread_kill + 288
2   libsystem_c.dylib                     0x181fcaa50 raise + 32
3   Emacs                                 0x1045f5af4
terminate_due_to_signal + 204
4   Emacs                                 0x1045f62f0 emacs_abort + 20
5   Emacs                                 0x1045c4db8 ns_term_shutdown + 132
6   Emacs                                 0x1044b0b9c shut_down_emacs + 332
7   Emacs                                 0x1045f5abc
terminate_due_to_signal + 148
8   Emacs                                 0x1044d308c handle_fatal_signal + 16
9   Emacs                                 0x1044d3108
deliver_thread_signal + 124
10  Emacs                                 0x1044d1708
deliver_fatal_thread_signal + 12
11  Emacs                                 0x1044d3168 handle_sigsegv + 96
12  libsystem_platform.dylib             0x1820f72a4 _sigtramp + 56
13  ???                            0xffff800181dce730 ???
14  dyld                                 0x181dc9a7c
lsl::PersistentAllocator::reserveRange(lsl::BTree<lsl::Allocator::Buffer,
lsl::PersistentAllocator::RegionSizeCompare, false>::const_iterator&,
lsl::Allocator::Buffer) + 392
15  dyld                                 0x181dca0b0
lsl::PersistentAllocator::allocate_buffer(unsigned long, unsigned
long, unsigned long, lsl::Allocator**) + 624
16  dyld                                 0x181dc91e0
lsl::Allocator::aligned_alloc(unsigned long, unsigned long) + 180
17  dyld                                 0x181dc9230
lsl::Allocator::strdup(char const*) + 48
18  dyld                                 0x181dc68b8
dyld4::FileManager::fileRecordForPath(char const*) + 40
19  dyld                                 0x181de4624
dyld4::Atlas::ProcessSnapshot::Serializer::readMappedFileInfo(std::__1::span<std::byte,
18446744073709551615ul>&, unsigned long long&, lsl::UUID&,
dyld4::FileRecord&) + 132
20  dyld                                 0x181de3170
dyld4::Atlas::ProcessSnapshot::Serializer::deserialize(std::__1::span<std::byte,
18446744073709551615ul>) + 928
21  dyld                                 0x181de2cec
dyld4::Atlas::ProcessSnapshot::ProcessSnapshot(lsl::Allocator&,
dyld4::FileManager&, bool, std::__1::span<std::byte,
18446744073709551615ul>) + 304
22  dyld                                 0x181daef64
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
23  dyld                                 0x181dabafc
dyld4::RuntimeState::getCurrentProcessSnapshot() + 96
24  dyld                                 0x181dab8cc
dyld4::RuntimeState::notifyDebuggerLoad(std::__1::span<dyld4::Loader
const*, 18446744073709551615ul> const&) + 72
25  dyld                                 0x181ddaf3c
dyld4::APIs::dlopen_from(char const*, int, void*)::$_0::operator()()
const + 748
26  dyld                                 0x181dd4968
dyld4::APIs::dlopen_from(char const*, int, void*) + 892
27  Emacs                                 0x104578db8 Fnative_elisp_load + 356
28  Emacs                                 0x104554894 Fload + 2104
29  Emacs                                 0x1045565f8 save_match_data_load + 92
30  Emacs                                 0x104530930
load_with_autoload_queue + 120
31  Emacs                                 0x10453cd8c Frequire + 560
32  Emacs                                 0x10456f948 exec_byte_code + 2988
33  Emacs                                 0x10456ed6c Fbyte_code + 140
34  Emacs                                 0x10452ca38 eval_sub + 2236
35  Emacs                                 0x104530a54 Feval + 88
36  rng-loc-798ea863-2dd98436.eln        0x13e19abdc top_level_run + 172
37  Emacs                                 0x1045785cc load_comp_unit + 844
38  Emacs                                 0x104578e10 Fnative_elisp_load + 444
39  Emacs                                 0x104554894 Fload + 2104
40  Emacs                                 0x1045565f8 save_match_data_load + 92
41  Emacs                                 0x104530930
load_with_autoload_queue + 120
42  Emacs                                 0x10453cd8c Frequire + 560
43  Emacs                                 0x10456f948 exec_byte_code + 2988
44  Emacs                                 0x10456ed6c Fbyte_code + 140
45  Emacs                                 0x10452ca38 eval_sub + 2236
46  Emacs                                 0x104530a54 Feval + 88
47  ox-odt-c6038b82-f0fa0d16.eln         0x14e65dab4 top_level_run + 2628
48  Emacs                                 0x1045785cc load_comp_unit + 844
49  Emacs                                 0x104578e10 Fnative_elisp_load + 444
50  Emacs                                 0x104554894 Fload + 2104
51  Emacs                                 0x1045565f8 save_match_data_load + 92
52  Emacs                                 0x104530930
load_with_autoload_queue + 120
53  Emacs                                 0x10453cd8c Frequire + 560
54  Emacs                                 0x10456f948 exec_byte_code + 2988
55  Emacs                                 0x10452e72c Ffuncall + 316
56  Emacs                                 0x1045312dc funcall_nil + 12
57  Emacs                                 0x1045311f8 run_hook_with_args + 320
58  subr-13adf6a6-818c6388.eln           0x108906c50
F646f2d61667465722d6c6f61642d6576616c756174696f6e_do_after_load_evaluation_0
+ 576
59  Emacs                                 0x10452e72c Ffuncall + 316
60  Emacs                                 0x10455493c Fload + 2272
61  Emacs                                 0x1045565f8 save_match_data_load + 92
62  Emacs                                 0x104530930
load_with_autoload_queue + 120
63  Emacs                                 0x10453cd8c Frequire + 560
64  Emacs                                 0x10452ca38 eval_sub + 2236
65  Emacs                                 0x10452c734 eval_sub + 1464
66  Emacs                                 0x10452cb58 Fif + 24
67  Emacs                                 0x10452c8a4 eval_sub + 1832
68  Emacs                                 0x10452cbb4 Fprogn + 48
69  Emacs                                 0x104532114 funcall_lambda + 1316
70  Emacs                                 0x10456f7c8 exec_byte_code + 2604
71  Emacs                                 0x10452e72c Ffuncall + 316
72  Emacs                                 0x1045312dc funcall_nil + 12
73  Emacs                                 0x1045311f8 run_hook_with_args + 320
74  subr-13adf6a6-818c6388.eln           0x108906c50
F646f2d61667465722d6c6f61642d6576616c756174696f6e_do_after_load_evaluation_0
+ 576
75  Emacs                                 0x10452e72c Ffuncall + 316
76  Emacs                                 0x10455493c Fload + 2272
77  Emacs                                 0x1045565f8 save_match_data_load + 92
78  Emacs                                 0x104530930
load_with_autoload_queue + 120
79  Emacs                                 0x10453cd8c Frequire + 560
80  Emacs                                 0x10452ca38 eval_sub + 2236
81  Emacs                                 0x10452f160
internal_lisp_condition_case + 884
82  Emacs                                 0x10452c8a4 eval_sub + 1832
83  Emacs                                 0x10452cbb4 Fprogn + 48
84  Emacs                                 0x10452e3b0 Fwhile + 80
85  Emacs                                 0x10452c8a4 eval_sub + 1832
86  Emacs                                 0x10452cbb4 Fprogn + 48
87  Emacs                                 0x104532114 funcall_lambda + 1316
88  Emacs                                 0x10452e72c Ffuncall + 316
89  Emacs                                 0x10452e72c Ffuncall + 316
90  timer-3ee7cfd9-d55357b5.eln           0x10b3dce44
F74696d65722d6576656e742d68616e646c6572_timer_event_handler_0 + 832
91  Emacs                                 0x10452e72c Ffuncall + 316
92  Emacs                                 0x1044bd290 timer_check + 892
93  Emacs                                 0x1044bb63c readable_events + 36
94  Emacs                                 0x1044bcebc get_input_pending + 56
95  Emacs                                 0x1044b7b50 read_char + 2872
96  Emacs                                 0x1044b5550 read_key_sequence + 1056
97  Emacs                                 0x1044b3dc0 command_loop_1 + 700
98  Emacs                                 0x10452f334
internal_condition_case + 96
99  Emacs                                 0x1044b3af0 command_loop_2 + 52
100 Emacs                                 0x10452ed58 internal_catch + 88
101 Emacs                                 0x1045f5f18 command_loop.cold.1 + 80
102 Emacs                                 0x1044b3490 command_loop + 152
103 Emacs                                 0x1044b334c recursive_edit_1 + 148
104 Emacs                                 0x1044b35b0 Frecursive_edit + 264
105 Emacs                                 0x1044b292c main + 7484
106 dyld                                 0x181d9fe50 start + 2544

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

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

Thread 3:: gmain
0   libsystem_kernel.dylib               0x182094a00 __select + 8
1   libglib-2.0.0.dylib                   0x105457b20 g_poll + 424
2   libglib-2.0.0.dylib                   0x10544acc4
g_main_context_iterate + 340
3   libglib-2.0.0.dylib                   0x10544ad8c
g_main_context_iteration + 60
4   libglib-2.0.0.dylib                   0x10544c124 glib_worker_main + 48
5   libglib-2.0.0.dylib                   0x10546f3a8 g_thread_proxy + 68
6   libsystem_pthread.dylib               0x1820c906c _pthread_start + 148
7   libsystem_pthread.dylib               0x1820c3e2c thread_start + 8

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

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

Thread 6:
0   libsystem_kernel.dylib               0x18208ffa4 __pselect + 8
1   libsystem_kernel.dylib               0x18208fe7c pselect$DARWIN_EXTSN + 64
2   Emacs                                 0x1045c5e98 -[EmacsApp
fd_handler:] + 184
3   Foundation                           0x1830a9470 __NSThread__start__ + 716
4   libsystem_pthread.dylib               0x1820c906c _pthread_start + 148
5   libsystem_pthread.dylib               0x1820c3e2c thread_start + 8

Thread 7:: com.apple.NSEventThread
0   libsystem_kernel.dylib               0x182089d70 mach_msg2_trap + 8
1   libsystem_kernel.dylib               0x18209b8a4 mach_msg2_internal + 80
2   libsystem_kernel.dylib               0x1820925c4 mach_msg_overwrite + 540
3   libsystem_kernel.dylib               0x18208a0ec mach_msg + 24
4   CoreFoundation                       0x1821a8bc0
__CFRunLoopServiceMachPort + 160
5   CoreFoundation                       0x1821a74ac __CFRunLoopRun + 1232
6   CoreFoundation                       0x1821a6888 CFRunLoopRunSpecific + 612
7   AppKit                               0x185552410 _NSEventThread + 172
8   libsystem_pthread.dylib               0x1820c906c _pthread_start + 148
9   libsystem_pthread.dylib               0x1820c3e2c thread_start + 8

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000000000000   x2:
0x0000000000000000   x3: 0x0000600003f886c0
    x4: 0x0000600003f886a0   x5: 0x0000000000000000   x6:
0x0000000000000000   x7: 0x0000000000000710
    x8: 0xb04c5173d21794d4   x9: 0xb04c51720f556e54  x10:
0x0000000000000001  x11: 0x0000000000000003
   x12: 0x0000000000000001  x13: 0x0000600002a99480  x14:
0x01000001dd44fee9  x15: 0x00000001dd44fee8
   x16: 0x0000000000000148  x17: 0x00000001e22707f0  x18:
0x0000000000000000  x19: 0x0000000000000006
   x20: 0x00000001dd42fa80  x21: 0x0000000000000103  x22:
0x00000001dd42fb60  x23: 0x0000000000000003
   x24: 0x000000016ba12308  x25: 0x0000000000000006  x26:
0x0000000000000020  x27: 0x0000000104d52d70
   x28: 0x0000000104d52de0   fp: 0x0000000104bb1910   lr: 0x00000001820c8cec
    sp: 0x0000000104bb18f0   pc: 0x00000001820921b0 cpsr: 0x40001000
   far: 0x0000000104ba79f0  esr: 0x56000080  Address size fault

Binary Images:
       0x182089000 -        0x1820c1ff3 libsystem_kernel.dylib (*)
<aebf397e-e2ef-3a49-be58-23d4558511f6>
/usr/lib/system/libsystem_kernel.dylib
       0x1820c2000 -        0x1820ceffb libsystem_pthread.dylib (*)
<132084c6-c347-3489-9ac2-fcaad21cdb73>
/usr/lib/system/libsystem_pthread.dylib
       0x181f89000 -        0x182009ff3 libsystem_c.dylib (*)
<756cd0d2-3241-3a74-8c59-02632dcee221>
/usr/lib/system/libsystem_c.dylib
       0x1043e8000 -        0x10463ffff org.gnu.Emacs (Version
29.0.60) <96c2c81f-a22d-3b5c-b9bc-7b549603be41>
/opt/homebrew/*/Emacs.app/Contents/MacOS/Emacs
       0x1820f3000 -        0x1820faffb libsystem_platform.dylib (*)
<b215ae90-4ed2-3fcd-8ccc-6c0d93cc4f41>
/usr/lib/system/libsystem_platform.dylib
               0x0 - 0xffffffffffffffff ??? (*)
<00000000-0000-0000-0000-000000000000> ???
       0x181d9a000 -        0x181e24b63 dyld (*)
<487cfdeb-9b07-39bf-bfb9-970b61aea2d1> /usr/lib/dyld
       0x13e194000 -        0x13e19bfff rng-loc-798ea863-2dd98436.eln
(*) <99fc78aa-c562-3a97-b250-b4eafbfb9457>
/Users/USER/*/rng-loc-798ea863-2dd98436.eln
       0x14e640000 -        0x14e663fff ox-odt-c6038b82-f0fa0d16.eln
(*) <b70c4abe-ae3f-3f4d-9de8-eeb718dc2f8d>
/Users/USER/*/ox-odt-c6038b82-f0fa0d16.eln
       0x1088e8000 -        0x10891bfff subr-13adf6a6-818c6388.eln (*)
<7350297a-5236-3262-aa1f-9e88e72dfa8b>
/opt/homebrew/*/Emacs.app/Contents/native-lisp/29.0.60-c7b10636/preloaded/subr-13adf6a6-818c6388.eln
       0x10b3d8000 -        0x10b3dffff 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
       0x105414000 -        0x1054fbfff libglib-2.0.0.dylib (*)
<f593e720-37ac-3b64-8d96-f9c330062fec>
/opt/homebrew/*/libglib-2.0.0.dylib
       0x183053000 -        0x183a8bfff com.apple.Foundation (6.9)
<f1f5f857-8c3c-36d5-bc27-7702d6795468>
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
       0x182127000 -        0x1825fefff com.apple.CoreFoundation (6.9)
<fd16d6d9-10c0-323b-b43b-9781c4a4d268>
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
       0x1853ef000 -        0x1862f9fff 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: 628
    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: 216650
    thread_create: 0
    thread_set_state: 14824

VM Region Summary:
ReadOnly portion of Libraries: Total=1.1G resident=0K(0%)
swapped_out_or_unallocated=1.1G(100%)
Writable regions: Total=1.5G written=0K(0%) resident=0K(0%)
swapped_out=0K(0%) unallocated=1.5G(100%)

                                VIRTUAL   REGION
REGION TYPE                        SIZE    COUNT (non-coalesced)
===========                     =======  =======
Accelerate framework               128K        1
Activity Tracing                   256K        1
CG backing stores                 3072K        4
CG image                            48K        2
ColorSync                          528K       26
CoreAnimation                       96K        6
CoreGraphics                        32K        2
CoreUI image data                  832K        5
Foundation                          16K        1
Kernel Alloc Once                   32K        1
MALLOC                           371.3M       77
MALLOC guard page                  192K       10
MALLOC_MEDIUM (reserved)         720.0M        6         reserved VM
address space (unallocated)
MALLOC_NANO (reserved)           384.0M        1         reserved VM
address space (unallocated)
STACK GUARD                        112K        7
Stack                             13.3M        8
Stack Guard                       54.4M        1
VM_ALLOCATE                        208K       13
__AUTH                             646K      164
__AUTH_CONST                      11.3M      321
__CTF                               756        1
__DATA                            31.0M      842
__DATA_CONST                      21.1M      610
__DATA_DIRTY                       709K      110
__FONT_DATA                        2352        1
__LINKEDIT                       797.7M      447
__OBJC_CONST                      1334K      138
__OBJC_RO                         65.4M        1
__OBJC_RW                         1986K        1
__TEXT                           285.5M      782
dyld private memory               1024K        4
mapped file                      233.1M       42
shared memory                      864K       15
===========                     =======  =======
TOTAL                              2.9G     3651
TOTAL, minus reserved VM space     1.9G     3651

Aaron