Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emacsMacport crashes on start with new Darwin stdenv #61596

Closed
dhess opened this issue May 16, 2019 · 9 comments · Fixed by #62642
Closed

emacsMacport crashes on start with new Darwin stdenv #61596

dhess opened this issue May 16, 2019 · 9 comments · Fixed by #62642
Assignees
Labels
0.kind: regression Something that worked before working no longer 6.topic: darwin Running or building packages on Darwin
Milestone

Comments

@dhess
Copy link
Contributor

dhess commented May 16, 2019

Issue description

emacsMacport crashes instantly and won't start with the new Darwin stdenv.

My emacsMacport is bundled with quite a few Emacs packages, so this may be a bit hard to isolate, but hopefully it's reproducible anyway.

Steps to reproduce

  • Build emacsMacport with recent nixpkgs.

open ~/Applications/Emacs.app

Technical details

This is with nixpkgs d9df60fb71a61ee62786a6205ef5efbae5b726f0.

Partial Problem Report included below. I've elided most of it for privacy reasons; let me know if you need more info:

Process:               Emacs [74464]
Path:                  /nix/*/Emacs.app/Contents/MacOS/Emacs
Identifier:            org.gnu.Emacs
Version:               26.2 (1.1)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Emacs [74464]
User ID:               501

Date/Time:             2019-05-16 16:45:50.929 +0100
OS Version:            Mac OS X 10.14.5 (18F132)
Report Version:        12
Bridge OS Version:     3.5 (16P5125)
Anonymous UUID:        [redacted]


Time Awake Since Boot: 180000 seconds

System Integrity Protection: enabled

Crashed Thread:        3  org.gnu.Emacs.lisp-main

Exception Type:        EXC_CRASH (SIGSEGV)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Thread 0:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	0x00007fff5fbc87de __sigsuspend + 10
1   org.gnu.Emacs                 	0x00000001000ed8e8 deliver_thread_signal + 120
2   org.gnu.Emacs                 	0x00000001000ec429 deliver_fatal_thread_signal + 9
3   org.gnu.Emacs                 	0x00000001000ed9ab handle_sigsegv + 171
4   libsystem_platform.dylib      	0x00007fff5fc60b5d _sigtramp + 29
5   ???                           	000000000000000000 0 + 0
6   libobjc.A.dylib               	0x00007fff5e29c47c (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 710
7   org.gnu.Emacs                 	0x000000010023a2ba mac_gui_loop + 106
8   org.gnu.Emacs                 	0x000000010023a1d3 main + 1171
9   libdyld.dylib                 	0x00007fff5fa753d5 start + 1

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

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

Thread 3 Crashed:: org.gnu.Emacs.lisp-main
0   libsystem_kernel.dylib        	0x00007fff5fbb02c6 __pthread_kill + 10
1   libsystem_pthread.dylib       	0x00007fff5fc6bbf1 pthread_kill + 284
2   libsystem_c.dylib             	0x00007fff5facdd8a raise + 26
3   org.gnu.Emacs                 	0x00000001000cb749 terminate_due_to_signal + 153
4   org.gnu.Emacs                 	0x00000001000ec413 deliver_fatal_signal + 163
5   libsystem_platform.dylib      	0x00007fff5fc60b5d _sigtramp + 29
6   ???                           	000000000000000000 0 + 0
7   libdispatch.dylib             	0x00007fff5fa293a0 _dispatch_semaphore_wait_slow + 98
8   org.gnu.Emacs                 	0x0000000100238f73 mac_within_gui_and_here + 99
9   org.gnu.Emacs                 	0x0000000100215b0f mac_set_frame_window_title + 111
10  org.gnu.Emacs                 	0x00000001001e90cf x_set_name + 271
11  org.gnu.Emacs                 	0x00000001001e9fc7 Fx_create_frame + 3063
12  org.gnu.Emacs                 	0x000000010015c7f3 __funcall_subr_block_invoke + 291
13  org.gnu.Emacs                 	0x0000000100209bbf mac_autorelease_loop + 47
14  org.gnu.Emacs                 	0x000000010015b567 Ffuncall + 1191
15  org.gnu.Emacs                 	0x00000001001a86cf exec_byte_code + 1823
16  org.gnu.Emacs                 	0x000000010015b47d Ffuncall + 957
17  org.gnu.Emacs                 	0x00000001001a86cf exec_byte_code + 1823
18  org.gnu.Emacs                 	0x000000010015b47d Ffuncall + 957
19  org.gnu.Emacs                 	0x000000010015c79f __funcall_subr_block_invoke + 207
20  org.gnu.Emacs                 	0x0000000100209bbf mac_autorelease_loop + 47
21  org.gnu.Emacs                 	0x000000010015b567 Ffuncall + 1191
22  org.gnu.Emacs                 	0x00000001001a86cf exec_byte_code + 1823
23  org.gnu.Emacs                 	0x000000010015b47d Ffuncall + 957
24  org.gnu.Emacs                 	0x00000001001a86cf exec_byte_code + 1823
25  org.gnu.Emacs                 	0x000000010015b47d Ffuncall + 957
26  org.gnu.Emacs                 	0x00000001001a86cf exec_byte_code + 1823
27  org.gnu.Emacs                 	0x000000010015b47d Ffuncall + 957
28  org.gnu.Emacs                 	0x00000001001a86cf exec_byte_code + 1823
29  org.gnu.Emacs                 	0x000000010015b47d Ffuncall + 957
30  org.gnu.Emacs                 	0x00000001001a86cf exec_byte_code + 1823
31  org.gnu.Emacs                 	0x000000010015ab24 apply_lambda + 356
32  org.gnu.Emacs                 	0x0000000100156853 eval_sub + 1155
33  org.gnu.Emacs                 	0x000000010015a859 Feval + 121
34  org.gnu.Emacs                 	0x00000001001598fc internal_condition_case + 268
35  org.gnu.Emacs                 	0x00000001000df7cd top_level_1 + 45
36  org.gnu.Emacs                 	0x0000000100158ea0 internal_catch + 272
37  org.gnu.Emacs                 	0x00000001000ceb6f command_loop + 143
38  org.gnu.Emacs                 	0x00000001000cea8f recursive_edit_1 + 111
39  org.gnu.Emacs                 	0x00000001000ced76 Frecursive_edit + 406
40  org.gnu.Emacs                 	0x00000001000cd68b emacs_main + 7371
41  org.gnu.Emacs                 	0x000000010023a244 mac_start_lisp_main + 52
42  libsystem_pthread.dylib       	0x00007fff5fc692eb _pthread_body + 126
43  libsystem_pthread.dylib       	0x00007fff5fc6c249 _pthread_start + 66
44  libsystem_pthread.dylib       	0x00007fff5fc6840d thread_start + 13

<remainder elided>
@veprbl veprbl added 6.topic: darwin Running or building packages on Darwin 0.kind: regression Something that worked before working no longer labels May 16, 2019
@veprbl
Copy link
Member

veprbl commented May 16, 2019

Can reproduce on current "master". "open result/Applications/Emacs.app" won't start anything, but I don't get a crash report, nothing appears in ~/Library/Logs/DiagnosticReports/.

edit: got my crash report a bit later, it's the same stacktrace as reported

@veprbl
Copy link
Member

veprbl commented May 16, 2019

The regular emacs works.

@matthewbauer matthewbauer self-assigned this May 16, 2019
@matthewbauer
Copy link
Member

Looks like libdispatch is too old. Working on it now

matthewbauer added a commit to matthewbauer/nixpkgs that referenced this issue May 17, 2019
@matthewbauer
Copy link
Member

matthewbauer commented May 17, 2019

I've opened up a draft that I think might fix it: #61613

I'm building it now, but if you have a beefy machine it might help to try to build it as well

@dhess
Copy link
Contributor Author

dhess commented May 25, 2019

I'm afraid that #61613 doesn't fix the issue. Here's a gist with the new crash, which looks more or less identical to the one I posted above:

https://gist.github.com/dhess/ddb05ea10421743ce757a35336f4929f

I built this with my nixpkgs fork here:

https://github.com/dhess/nixpkgs/commit/416ac345a0c3afdad510ae4a6fa87cdc685bbfd1

I'm trying to confirm that this emacsMacport has been built with the updated libdispatch. I'm having trouble tracking it down. Can you tell me how to figure it out?

@matthewbauer matthewbauer added this to the 19.09 milestone May 27, 2019
@dhess
Copy link
Contributor Author

dhess commented May 30, 2019

Here's a simpler repro case. This happens when I try to build emacsWithPackages using emacsMacport and the melpa lsp-haskell Emacs pacakge:

https://gist.github.com/dhess/6437ae2a7976e877b7d2ab28ed70ffb8

matthewbauer added a commit to matthewbauer/nixpkgs that referenced this issue Jun 3, 2019
for unclear reasons, using llvm7 crashes emacs macport. llvm6 seems to
work fine.

Fixes NixOS#61596
@matthewbauer
Copy link
Member

So the short term fix is just to use llvm6. At some point, I'll try to dig into what is actually happening, but I suspect something has changed in how llvm handles threads.

@dhess
Copy link
Contributor Author

dhess commented Jun 4, 2019

Thank you! I’m happy to use a work-around and didn’t expect you to address this complex issue so quickly! I was resigned to using the vanilla emacs for the foreseeable future, so this is a very welcome development.

@dhess
Copy link
Contributor Author

dhess commented Jun 4, 2019

I can confirm that this appears to be fixed in my Hydra builds, as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: regression Something that worked before working no longer 6.topic: darwin Running or building packages on Darwin
Projects
None yet
3 participants