Here's the story: I'm using macOS 10.15.1 and Emacs ver. 26.3 for macOSX from the eponymous site.
Some time ago, maybe after 10.15.2 update, I started to experience frequent Emacs crashes, occurring mainly in the start of the session, whenever I try to launch shell, use grep/ag from projectile, start sly/slime session, or fetch git repo information via magit. Crashes never occur when I just edit files, open and close them, save my changes and so on.
However, it doesn't always crash, and if it doesn't at the very first attempt, it won't crash at all and I can do as I please and just continue with my work.
Now the information about crash: as I see in the Console.app, crashes are quite consistent and reproduce nicely. For the process launch case:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff71dd149a __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff71e8e6cb pthread_kill + 384
2 libsystem_c.dylib 0x00007fff71ce93a2 raise + 26
3 Emacs-x86_64-10_14 0x00000001000bb789 terminate_due_to_signal + 153
4 Emacs-x86_64-10_14 0x00000001000d8e03 emacs_abort + 19
5 Emacs-x86_64-10_14 0x00000001001c102a ns_term_shutdown + 122
6 Emacs-x86_64-10_14 0x00000001000bb976 shut_down_emacs + 262
7 Emacs-x86_64-10_14 0x00000001000bb756 terminate_due_to_signal + 102
8 Emacs-x86_64-10_14 0x00000001000dba0e handle_fatal_signal + 14
9 Emacs-x86_64-10_14 0x00000001000dba91 deliver_thread_signal + 129
10 Emacs-x86_64-10_14 0x00000001000da629 deliver_fatal_thread_signal + 9
11 Emacs-x86_64-10_14 0x00000001000dbb4b handle_sigsegv + 171
12 libsystem_platform.dylib 0x00007fff71e83b1d _sigtramp + 29
13 ??? 000000000000000000 0 + 0
14 Emacs-x86_64-10_14 0x0000000100187ba3 setup_process_coding_systems + 163
15 Emacs-x86_64-10_14 0x0000000100189e0b create_process + 555
16 Emacs-x86_64-10_14 0x00000001001891c8 Fmake_process + 2424
17 Emacs-x86_64-10_14 0x0000000100140b18 Ffuncall + 728
18 Emacs-x86_64-10_14 0x000000010014066f Fapply + 607
19 Emacs-x86_64-10_14 0x0000000100140b18 Ffuncall + 728
20 Emacs-x86_64-10_14 0x0000000100184d3e exec_byte_code + 1838
21 Emacs-x86_64-10_14 0x0000000100140ab9 Ffuncall + 633
22 Emacs-x86_64-10_14 0x0000000100184d3e exec_byte_code + 1838
23 Emacs-x86_64-10_14 0x0000000100141ae1 funcall_lambda + 897
24 Emacs-x86_64-10_14 0x0000000100140ab9 Ffuncall + 633
25 Emacs-x86_64-10_14 0x0000000100184d3e exec_byte_code + 1838
26 Emacs-x86_64-10_14 0x0000000100141ae1 funcall_lambda + 897
27 Emacs-x86_64-10_14 0x0000000100140ab9 Ffuncall + 633
28 Emacs-x86_64-10_14 0x000000010014121a call0 + 26
29 Emacs-x86_64-10_14 0x000000010013f540 internal_condition_case_n + 288
30 Emacs-x86_64-10_14 0x00000001000c2747 safe_run_hook_funcall + 55
31 Emacs-x86_64-10_14 0x0000000100140e3d run_hook_with_args + 317
32 Emacs-x86_64-10_14 0x00000001000c097c safe_run_hooks + 108
33 Emacs-x86_64-10_14 0x00000001000f8420 Fdo_auto_save + 224
34 Emacs-x86_64-10_14 0x00000001000c41e3 read_char + 5059
35 Emacs-x86_64-10_14 0x00000001000c106a read_key_sequence + 1722
36 Emacs-x86_64-10_14 0x00000001000bf872 command_loop_1 + 1234
37 Emacs-x86_64-10_14 0x000000010013f16c internal_condition_case + 268
38 Emacs-x86_64-10_14 0x00000001000cef60 command_loop_2 + 48
39 Emacs-x86_64-10_14 0x000000010013e760 internal_catch + 272
40 Emacs-x86_64-10_14 0x00000001000be81e command_loop + 158
41 Emacs-x86_64-10_14 0x00000001000be72f recursive_edit_1 + 111
42 Emacs-x86_64-10_14 0x00000001000bea16 Frecursive_edit + 406
43 Emacs-x86_64-10_14 0x00000001000bd32d main + 6477
44 libdyld.dylib 0x00007fff71c822e5 start + 1
When I try to fetch remotes from Magit:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff71dd149a __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff71e8e6cb pthread_kill + 384
2 libsystem_c.dylib 0x00007fff71ce93a2 raise + 26
3 Emacs-x86_64-10_14 0x00000001000bb789 terminate_due_to_signal + 153
4 Emacs-x86_64-10_14 0x00000001000d8e03 emacs_abort + 19
5 Emacs-x86_64-10_14 0x00000001001c102a ns_term_shutdown + 122
6 Emacs-x86_64-10_14 0x00000001000bb976 shut_down_emacs + 262
7 Emacs-x86_64-10_14 0x00000001000bb756 terminate_due_to_signal + 102
8 Emacs-x86_64-10_14 0x00000001000dba0e handle_fatal_signal + 14
9 Emacs-x86_64-10_14 0x00000001000dba91 deliver_thread_signal + 129
10 Emacs-x86_64-10_14 0x00000001000da629 deliver_fatal_thread_signal + 9
11 Emacs-x86_64-10_14 0x00000001000dbb4b handle_sigsegv + 171
12 libsystem_platform.dylib 0x00007fff71e83b1d _sigtramp + 29
13 ??? 000000000000000000 0 + 0
14 Emacs-x86_64-10_14 0x000000010018ca0a connect_network_socket + 3130
15 Emacs-x86_64-10_14 0x000000010018b955 Fmake_network_process + 1973
16 Emacs-x86_64-10_14 0x0000000100140b18 Ffuncall + 728
17 Emacs-x86_64-10_14 0x0000000100184d3e exec_byte_code + 1838
18 Emacs-x86_64-10_14 0x0000000100140ab9 Ffuncall + 633
19 Emacs-x86_64-10_14 0x0000000100184d3e exec_byte_code + 1838
20 Emacs-x86_64-10_14 0x0000000100140ab9 Ffuncall + 633
21 Emacs-x86_64-10_14 0x0000000100184d3e exec_byte_code + 1838
22 Emacs-x86_64-10_14 0x0000000100140ab9 Ffuncall + 633
23 Emacs-x86_64-10_14 0x0000000100184d3e exec_byte_code + 1838
24 Emacs-x86_64-10_14 0x0000000100140ab9 Ffuncall + 633
25 Emacs-x86_64-10_14 0x0000000100139c26 Ffuncall_interactively + 70
26 Emacs-x86_64-10_14 0x0000000100140b18 Ffuncall + 728
27 Emacs-x86_64-10_14 0x0000000100139e92 Fcall_interactively + 594
28 Emacs-x86_64-10_14 0x000000010014166b funcall_subr + 299
29 Emacs-x86_64-10_14 0x0000000100140b18 Ffuncall + 728
30 Emacs-x86_64-10_14 0x0000000100184d3e exec_byte_code + 1838
31 Emacs-x86_64-10_14 0x0000000100140ab9 Ffuncall + 633
32 Emacs-x86_64-10_14 0x000000010014124c call1 + 44
33 Emacs-x86_64-10_14 0x00000001000bfb0c command_loop_1 + 1900
34 Emacs-x86_64-10_14 0x000000010013f16c internal_condition_case + 268
35 Emacs-x86_64-10_14 0x00000001000cef60 command_loop_2 + 48
36 Emacs-x86_64-10_14 0x000000010013e760 internal_catch + 272
37 Emacs-x86_64-10_14 0x00000001000be81e command_loop + 158
38 Emacs-x86_64-10_14 0x00000001000be72f recursive_edit_1 + 111
39 Emacs-x86_64-10_14 0x00000001000bea16 Frecursive_edit + 406
40 Emacs-x86_64-10_14 0x00000001000bd32d main + 6477
41 libdyld.dylib 0x00007fff71c822e5 start + 1
System log also contains suspicious lines, but I don't know if they have any connection to the crash:
09:15:39 com.apple.xpc.launchd[1] (org.gnu.Emacs.1528[75856]): Service exited due to SIGABRT
09:20:49 Emacs-x86_64-10_14[82907]: assertion failed: 19B88: libxpc.dylib + 86572 [99CC9436-D653-3762-ADBB-9054EBD1BA2B]: 0x89
09:28:52 com.apple.xpc.launchd[1] (org.gnu.Emacs.1528[82907]): Service exited due to SIGABRT
09:29:13 Emacs-x86_64-10_14[83715]: assertion failed: 19B88: libxpc.dylib + 86572 [99CC9436-D653-3762-ADBB-9054EBD1BA2B]: 0x89
09:30:59 com.apple.xpc.launchd[1] (org.gnu.Emacs.1528.5A034B74-38F9-4465-B8F3-EE4A7D6C3D04[83715]): Service exited due to SIGABRT
09:47:18 Emacs-x86_64-10_14[83519]: assertion failed: 19B88: libxpc.dylib + 86572 [99CC9436-D653-3762-ADBB-9054EBD1BA2B]: 0x89
10:00:33 Emacs-x86_64-10_14[85644]: assertion failed: 19B88: libxpc.dylib + 86572 [99CC9436-D653-3762-ADBB-9054EBD1BA2B]: 0x89
10:02:01 com.apple.xpc.launchd[1] (org.gnu.Emacs.1528.98532F72-A7CA-48C1-AB20-CA9BA40214C0[85644]): Service exited due to SIGABRT
10:02:15 Emacs-x86_64-10_14[86431]: assertion failed: 19B88: libxpc.dylib + 86572 [99CC9436-D653-3762-ADBB-9054EBD1BA2B]: 0x89
10:04:42 com.apple.xpc.launchd[1] (org.gnu.Emacs.1528.12F80E4E-3872-435C-82CD-91B51957B182[86431]): Service exited due to SIGABRT
10:04:51 Emacs-x86_64-10_14[87066]: assertion failed: 19B88: libxpc.dylib + 86572 [99CC9436-D653-3762-ADBB-9054EBD1BA2B]: 0x89
10:06:12 Emacs-x86_64-10_14[87586]: assertion failed: 19B88: libxpc.dylib + 86572 [99CC9436-D653-3762-ADBB-9054EBD1BA2B]: 0x89
10:06:38 com.apple.xpc.launchd[1] (org.gnu.Emacs.1528.C07B4B1E-4019-40AA-B049-C7BA6350DC7C[87586]): Service exited due to SIGABRT
12:47:25 Emacs[45383]: assertion failed: 19B88: libxpc.dylib + 86572 [99CC9436-D653-3762-ADBB-9054EBD1BA2B]: 0x89
12:48:24 com.apple.xpc.launchd[1] (org.gnu.Emacs.9828.64AFFA95-874F-4701-9DBF-64AE044CA82F[45383]): Service exited due to SIGABRT
12:53:46 Emacs[46033]: assertion failed: 19B88: libxpc.dylib + 86572 [99CC9436-D653-3762-ADBB-9054EBD1BA2B]: 0x89
12:55:14 com.apple.xpc.launchd[1] (org.gnu.Emacs.9828.2CD9EA36-8700-4AF8-A1AC-1EAA9FFE9100[46033]): Service exited due to SIGABRT
I also have an impression that if I don't touch "dangerous" functions (i.e. don't launch processes/access network) for a while, the probability of crash lowers. I haven't verified it though.
Also Emacs doesn't crash when run with -q
, so I suppose it has to do with packages I use, but I have no idea what can cause this, since Emacs also crashes on built-in actions like M-x shell
right after I start it.
I've been haunted by this issue for almost a month, actively trying to device a fix for a week and have run out of ideas, so any help or advice would be much appreciated!
M-x report-emacs-bug
or send email to[email protected]
. Might also be worth trying the soon-to-be-released emacs-27