Subject: Re: bug#56862: 29.0.50; crashes while compiling native code

From: Gregor Zattler <[email-masked]>
Date: Mon, 01 Aug 2022 10:55:11 +0200

Hi Eli,
* Eli Zaretskii <[email-masked]> [2022-07-31; 22:09]:
> From the only readable backtrace, the one you produced from GDB, I can
> only deduce that some timer was run by Emacs, and that timer's code
> caused the crash in some way.  It's hard to say more, especially since
> your GDB seems to be misconfigured and causes Python exceptions
> instead of showing useful information.
>
> If you can reproduce this at will, please try producing a GDB
> backtrace after you fix your GDB installation.  And please try a newer
> checkout of the master branch.

Sorry, I had the very same problem in February, you told me to
fix my gdb installation, which was plain Debian bullseye,
I compiled from debian source, then it worked.  Since then
I reinstalled Debian bullseye, hence the same problem, I did
the same and build Emacs without optimazion and with max
debug symbols from a even newer moment of the repo:

$ git log -n 1
commit eef591072ab1cbcf2168d7b30b3e1ca1f50717ad (HEAD -> master, origin/master, origin/HEAD)
Author: Lars Ingebrigtsen <[email-masked]>
Date:   Sun Jul 31 20:00:25 2022 +0200

    Regenerate ldefs-boot.el

These are the results:

lisp.h:3549: Emacs fatal error: assertion failed: pdl->kind == SPECPDL_BACKTRACE
  ;; removing the contents of org-persist-directory before opening Emacs?
Thread 1 "emacs" hit Breakpoint 1, terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at emacs.c:420

(gdb) bt
#0  terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at emacs.c:420
#1  0x0000555555823505 in die (msg=0x555555a24530 "pdl->kind == SPECPDL_BACKTRACE", file=0x555555a243c8 "lisp.h", line=3549) at alloc.c:7670
#2  0x00005555558c73d4 in backtrace_debug_on_exit (pdl=0x55555613f670) at lisp.h:3549
#3  0x00005555558c8edd in exec_byte_code (fun=XIL(0x7ffff07b75f5), args_template=771, nargs=3, args=0x7fffef8ad228) at bytecode.c:887
#4  0x0000555555862f17 in fetch_and_exec_byte_code (fun=XIL(0x7ffff0590535), args_template=0, nargs=0, args=0x7fffef8ad058) at eval.c:3045
#5  0x00005555558633a6 in funcall_lambda (fun=XIL(0x7ffff0590535), nargs=0, arg_vector=0x7fffef8ad058) at eval.c:3117
#6  0x0000555555862688 in funcall_general (fun=XIL(0x7ffff0590535), numargs=0, args=0x7fffef8ad058) at eval.c:2908
#7  0x0000555555862913 in Ffuncall (nargs=1, args=0x7fffef8ad050) at eval.c:2958
#8  0x0000555555861751 in Fapply (nargs=2, args=0x7fffef8ad050) at eval.c:2582
#9  0x0000555555862d8f in funcall_subr (subr=0x555555eadb00 <Sapply>, numargs=2, args=0x7fffef8ad050) at eval.c:3023
#10 0x00005555558c89d4 in exec_byte_code (fun=XIL(0x7ffff026714d), args_template=257, nargs=1, args=0x7fffef8ad198) at bytecode.c:809
#11 0x0000555555862f17 in fetch_and_exec_byte_code (fun=XIL(0x7ffff0939ac5), args_template=257, nargs=1, args=0x7fffffffc6e8) at eval.c:3045
#12 0x00005555558633a6 in funcall_lambda (fun=XIL(0x7ffff0939ac5), nargs=1, arg_vector=0x7fffffffc6e8) at eval.c:3117
#13 0x0000555555862688 in funcall_general (fun=XIL(0x7ffff0939ac5), numargs=1, args=0x7fffffffc6e8) at eval.c:2908
#14 0x0000555555862913 in Ffuncall (nargs=2, args=0x7fffffffc6e0) at eval.c:2958
#15 0x000055555576e0eb in call1 (fn=XIL(0xf4b0), arg1=XIL(0x55555608bb65)) at lisp.h:3239
#16 0x000055555577bb14 in timer_check_2 (timers=XIL(0), idle_timers=XIL(0x5555563c8083)) at keyboard.c:4636------------------------------------------------------------------------------------
#17 0x000055555577bc84 in timer_check () at keyboard.c:4702
#18 0x00005555557789c9 in readable_events (flags=1) at keyboard.c:3484
#19 0x0000555555783030 in get_input_pending (flags=1) at keyboard.c:7277
#20 0x000055555578cd51 in detect_input_pending_run_timers (do_display=true) at keyboard.c:10807
#21 0x00005555558ee1e7 in wait_reading_process_output (time_limit=30, nsecs=0, read_kbd=-1, do_display=true, wait_for_cell=XIL(0), wait_proc=0x0, just_wait_proc=0) at process.c:5732
#22 0x00005555555ac046 in sit_for (timeout=make_fixnum(30), reading=true, display_option=1) at dispnew.c:6238
#23 0x000055555577611d in read_char (commandflag=1, map=XIL(0x5555563c87b3), prev_event=XIL(0), used_mouse_menu=0x7fffffffd05d, end_time=0x0) at keyboard.c:2832
#24 0x000055555578abee in read_key_sequence (keybuf=0x7fffffffd250, prompt=XIL(0), dont_downcase_last=false, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=false)
    at keyboard.c:9984
#25 0x0000555555771456 in command_loop_1 () at keyboard.c:1382
#26 0x000055555585e278 in internal_condition_case (bfun=0x555555771026 <command_loop_1>, handlers=XIL(0x90), hfun=0x555555770460 <cmd_error>) at eval.c:1485
#27 0x0000555555770c0f in command_loop_2 (handlers=XIL(0x90)) at keyboard.c:1132
#28 0x000055555585d428 in internal_catch (tag=XIL(0xf7b0), func=0x555555770be8 <command_loop_2>, arg=XIL(0x90)) at eval.c:1208
#29 0x0000555555770ba4 in command_loop () at keyboard.c:1110
#30 0x000055555576ff23 in recursive_edit_1 () at keyboard.c:719
#31 0x0000555555770140 in Frecursive_edit () at keyboard.c:802
#32 0x000055555576b804 in main (argc=4, argv=0x7fffffffd6e8) at emacs.c:2517

Lisp Backtrace:
"show-paren--default" (0xef8ad0a8)
"show-paren-function" (0xef8ad058)
"apply" (0xef8ad050)
"timer-event-handler" (0xffffc6e8)
(gdb)

(gdb) xbacktrace
"show-paren--default" (0xef8ad0a8)
"show-paren-function" (0xef8ad058)
"apply" (0xef8ad050)
"timer-event-handler" (0xffffc6e8)
(gdb)

Ciao; Gregor
--
 -... --- .-. . -.. ..--.. ...-.-