remacs icon indicating copy to clipboard operation
remacs copied to clipboard

crashes in print_object on macOS

Open razzmatazz opened this issue 5 years ago • 4 comments

I cannot find how to replicate this easily, but remacs crashes for me every day or two with the following stacktrace on macOS 10.14 (mojave)

Process:               Remacs [33593]
Path:                  /Users/USER/*/Remacs.app/Contents/MacOS/Remacs
Identifier:            org.gnu.Remacs
Version:               Version 27.0.50 (9.0)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Remacs [33593]
User ID:               501

Date/Time:             2019-03-24 12:22:24.461 +0200
OS Version:            Mac OS X 10.14.3 (18D109)
Report Version:        12
Anonymous UUID:        F8D20147-A164-0284-0365-0163BC7EDA98

Sleep/Wake UUID:       4A101425-29C7-4455-8775-6C31FE7C3F9F

Time Awake Since Boot: 120000 seconds
Time Since Wake:       9700 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 0x000000023c44e238
Exception Note:        EXC_CORPSE_NOTIFY

VM Regions Near 0x23c44e238:
    CoreAnimation          0000000140000000-0000000143a9b000 [ 58.6M] rw-/rwx SM=PRV  
--> 
    MALLOC_NANO            0000600000000000-0000600008000000 [128.0M] rw-/rwx SM=PRV  

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	0x00007fff5c3d723e __pthread_kill + 10
1   libsystem_pthread.dylib       	0x00007fff5c48dc1c pthread_kill + 285
2   libsystem_c.dylib             	0x00007fff5c2f3096 raise + 26
3   org.gnu.Remacs                	0x00000001000b3a89 terminate_due_to_signal + 153 (emacs.c:391)
4   org.gnu.Remacs                	0x00000001000ceb73 emacs_abort + 19
5   org.gnu.Remacs                	0x000000010019680a ns_term_shutdown + 122
6   org.gnu.Remacs                	0x00000001000b3c76 shut_down_emacs + 262 (emacs.c:2060)
7   org.gnu.Remacs                	0x00000001000b3a56 terminate_due_to_signal + 102 (emacs.c:374)
8   org.gnu.Remacs                	0x00000001000d166e handle_fatal_signal + 14
9   org.gnu.Remacs                	0x00000001000d16f1 deliver_thread_signal + 129
10  org.gnu.Remacs                	0x00000001000d02f9 deliver_fatal_thread_signal + 9
11  org.gnu.Remacs                	0x00000001000d17a8 handle_sigsegv + 168
12  libsystem_platform.dylib      	0x00007fff5c482b3d _sigtramp + 29
13  ???                           	000000000000000000 0 + 0
14  org.gnu.Remacs                	0x000000010013b74a print_object + 1994
15  org.gnu.Remacs                	0x000000010013803b Fprin1 + 443 (print.c:648)
16  org.gnu.Remacs                	0x0000000100139d3e print_error_message + 654
17  org.gnu.Remacs                	0x00000001002361af Fcommand_error_default_function + 367
18  org.gnu.Remacs                	0x00000001001239fb funcall_subr + 299 (eval.c:1851)
19  org.gnu.Remacs                	0x0000000100206462 remacs::eval::funcall::hdf2967d2f7516929 + 754
20  org.gnu.Remacs                	0x00000001001236a4 call3 + 52
21  org.gnu.Remacs                	0x00000001000c6910 cmd_error + 432 (keyboard.c:955)
22  org.gnu.Remacs                	0x0000000100121ee7 internal_condition_case + 263
23  org.gnu.Remacs                	0x00000001000c66f0 command_loop_2 + 48 (lisp.h:1119)
24  org.gnu.Remacs                	0x00000001001218f0 internal_catch + 272 (eval.c:578)
25  org.gnu.Remacs                	0x00000001000b693e command_loop + 158 (keyboard.c:999)
26  org.gnu.Remacs                	0x00000001000b6850 recursive_edit_1 + 112 (keyboard.c:690)
27  org.gnu.Remacs                	0x0000000100235fa4 Frecursive_edit + 308
28  org.gnu.Remacs                	0x00000001000b5501 main + 6241 (emacs.c:1652)
29  libdyld.dylib                 	0x00007fff5c297ed9 start + 1

What would be the ideal way to track this? Shoud I build remacs with "-g -O2" and then to always run it within lldb/gdb session?

Not using -O2 is not an option because it makes my productivity drop down a lot as I have not learned how to replicate this crash explicitly.

razzmatazz avatar Mar 24 '19 10:03 razzmatazz

Did anybody else see this ? It would be very helpful if somebody could confirm this.

brotzeit avatar Mar 29 '19 12:03 brotzeit

Closing for a moment, couldn't built remacs on macos for a couple weeks already, maybe due to #1472 ?

make[1]: Circular bootstrap-emacs <- temacs dependency dropped.
/Library/Developer/CommandLineTools/usr/bin/make -C ../admin/unidata all EMACS="../../src/bootstrap-emacs"
  ELC      uvs.elc
/bin/sh: line 1:  8675 Segmentation fault: 11  "../../src/bootstrap-emacs" -batch --no-site-file --no-site-lisp -f batch-byte-compile uvs.el
make[2]: *** [uvs.elc] Error 139
make[1]: *** [macuvs.h] Error 2

razzmatazz avatar May 06 '19 07:05 razzmatazz

Sorry about that @razzmatazz, several of us MacOS users have had our attentions on other things lately.

shaleh avatar May 06 '19 07:05 shaleh

@brotzeit @shaleh Thanks for taking a look at the issue, but I cannot build remacs from master for a month already due to this segfault during make install:

...
Writing LC_LOAD_DYLIB     command
Writing LC_FUNCTION_STARTS command
Writing LC_DATA_IN_CODE   command
2096 unused bytes follow Mach-O header
94615 pure bytes used
mv -f remacs bootstrap-emacs
/Library/Developer/CommandLineTools/usr/bin/make -C ../lisp compile-first EMACS="../src/bootstrap-emacs"
  ELC      emacs-lisp/macroexp.elc
/bin/sh: line 1: 44276 Segmentation fault: 11  EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' -f batch-byte-compile emacs-lisp/macroexp.el
make[2]: *** [emacs-lisp/macroexp.elc] Error 139
make[1]: *** [bootstrap-emacs] Error 2
make: *** [src] Error 2

So I cannot test if @brotzeit 's PR has actually helped. Is there an existing issue for tracking this build failure? Maybe I can try to figure this out myself with CFLAGS=-g and RUST_DEBUG?

razzmatazz avatar May 24 '19 13:05 razzmatazz