Wednesday, November 09, 2022

emacs crash

I installed emacs on latest amd64 current and it crashes for me when I try to
edit .emacs file in home directory, particularly such commands crash it
reliably:

idea:~$ cd ~
idea:~$ emacs .emacs
Fatal error 11: Segmentation fault
Backtrace:
0x4a6aaba9317 <???> at emacs
0x4a6aab8bab8 <???> at emacs
0x4a6aabaab4e <???> at emacs
0x4a6aabaabd2 <???> at emacs
0x4a6aaba8ff9 <???> at emacs
Segmentation fault (core dumped)

if I use full path, like

emacs /home/misha/.emacs

then it works fine.

Also if I replace this string in the file:
(setq scroll-step 1)
with
;(setq scroll-step 1)

then I also can do "emacs .emacs" without problem, but I suspect the
crash has something with synatx coloring, and not with scroll-step,
because if I replace some other lines, like

;;(require 'smex)
with
(require 'smex)

there is also no crash.

emacs -Q .emacs and emacs -q .emacs also work.

I tried to compile latest emacs git and emacs-28.2 from sources and they work
fine.

I did some jungling, like moving .emacs to /tmp and trying the same
command "emacs .emacs" - it worked fine too. I can't reproduce crashes
when running as other user.

No crashes are observed when I run "emacs .emacs" outside of tmux. I
also have old laptop with latest current amd64 and I can't reproduce
crash there.

The .emacs file located here: http://freebsd.org/~misha/.emacs

Does anyone has an idea how to dig this further?

here is bt:

(gdb) bt
#0 thrkill () at /tmp/-:3
#1 0x00000edee8705ae5 in terminate_due_to_signal (sig=11, backtrace_limit=<optimized out>) at emacs.c:437
#2 0x00000edee8724b4e in handle_fatal_signal (sig=0) at sysdep.c:1762
#3 0x00000edee8724bd2 in deliver_thread_signal (sig=11, handler=<optimized out>) at sysdep.c:1754
#4 0x00000edee8722ff9 in deliver_fatal_thread_signal (sig=0) at sysdep.c:1774
#5 0x00000edee8724c1a in handle_sigsegv (sig=11, siginfo=<optimized out>, arg=<optimized out>) at sysdep.c:1867
#6 <signal handler called>
#7 tty_defined_color (f=<optimized out>, color_name=0xee11b417178 <error: Cannot access memory at address 0xee11b417178>, color_def=0x7f7ffffc0638, alloc=<optimized out>, _makeIndex=<optimized out>) at xfaces.c:1055
#8 0x00000edee86fdab8 in load_color2 (f=0xee12b2c9000, face=0xee16a7d0200, name=0xee1b224f784, target_index=<error reading variable: Cannot access memory at address 0x9>, color=<optimized out>) at xfaces.c:1200
#9 load_color (f=0xee12b2c9000, face=0xee16a7d0200, name=0xee1b224f784, target_index=<error reading variable: Cannot access memory at address 0x9>) at xfaces.c:1263
#10 map_tty_color (f=0xee12b2c9000, face=0xee16a7d0200, idx=<error reading variable: Cannot access memory at address 0x9>, defaulted=<optimized out>) at xfaces.c:6201
#11 realize_tty_face (cache=0xee13a049c00, attrs=0x7f7ffffc0730) at xfaces.c:6275
#12 realize_face (cache=0xee13a049c00, attrs=0x7f7ffffc0730, former_face_id=<optimized out>) at xfaces.c:5840
#13 0x00000edee870262c in realize_named_face (f=0xee12b2c9000, symbol=<optimized out>, id=10) at xfaces.c:5809
#14 0x00000edee86f9eb2 in realize_basic_faces (f=0xee12b2c9000) at xfaces.c:5624
#15 0x00000edee86fcc3b in update_face_from_frame_parameter (f=0xee12b2c9000, param=<optimized out>, new_value=0xee1b224f784) at xfaces.c:3673
#16 0x00000edee866865f in Fmodify_frame_parameters (frame=<optimized out>, alist=<optimized out>) at frame.c:3451
#17 0x00000edee879b941 in Ffuncall (nargs=<optimized out>, args=<optimized out>) at eval.c:3023
#18 0x00000edee87e5b46 in exec_byte_code (bytestr=<optimized out>, vector=0xee1dde8c2f5, maxdepth=<optimized out>, args_template=<optimized out>, nargs=<optimized out>, args=<optimized out>) at bytecode.c:632
#19 0x00000edee879b8c1 in Ffuncall (nargs=<optimized out>, args=<optimized out>) at eval.c:3038
#20 0x00000edee87e5b46 in exec_byte_code (bytestr=<optimized out>, vector=0xee0faaa6005, maxdepth=<optimized out>, args_template=<optimized out>, nargs=<optimized out>, args=<optimized out>) at bytecode.c:632
#21 0x00000edee879b8c1 in Ffuncall (nargs=<optimized out>, args=<optimized out>) at eval.c:3038
#22 0x00000edee87e67e4 in bcall0 (f=0xee1b7edfec5) at bytecode.c:340
#23 0x00000edee8796b0c in unbind_to (count=<optimized out>, value=0x0) at eval.c:3841
#24 0x00000edee87e6097 in exec_byte_code (bytestr=<optimized out>, vector=0xee1dde9469d, maxdepth=<optimized out>, args_template=<optimized out>, nargs=<optimized out>, args=<optimized out>) at bytecode.c:652
#25 0x00000edee879b1c5 in apply_lambda (fun=0xee1ddd44520, args=<optimized out>, count=<optimized out>) at eval.c:3172
#26 0x00000edee8796f94 in eval_sub (form=<optimized out>) at eval.c:2869
#27 0x00000edee879aeb8 in Feval (form=0xee1de279d93, lexical=<optimized out>) at eval.c:2327
#28 0x00000edee8799b79 in internal_condition_case (bfun=0x42a391c29780d636, handlers=<optimized out>, hfun=0xedee8707a60 <cmd_error>) at eval.c:1450
#29 0x00000edee87179ab in top_level_1 (ignore=<optimized out>) at keyboard.c:1150
#30 0x00000edee87992be in internal_catch (tag=<optimized out>, func=0xe4958413794725e4, arg=0x0) at eval.c:1181
#31 0x00000edee8705e02 in command_loop () at keyboard.c:1110
#32 0x00000edee8705caf in recursive_edit_1 () at keyboard.c:720
#33 0x00000edee870601c in Frecursive_edit () at keyboard.c:803
#34 0x00000edee8704ae3 in main (argc=<optimized out>, argv=0x7f7ffffc19a8) at emacs.c:2358

No comments:

Post a Comment