Subject: bug#59147: 29.0.50; dispnew.c:1456: Emacs fatal error: assertion failed: row >= 0 && row < matrix->nrows

From: Gregor Zattler <[email-masked]>
Date: Wed, 09 Nov 2022 14:49:15 +0100

Hi Eli,
* Eli Zaretskii <[email-masked]> [2022-11-09; 15:21 +02]:
>> From: Gregor Zattler <[email-masked]>
>> Date: Wed, 09 Nov 2022 13:37:13 +0100
>>
>> Dear Emacs and notmuch developers, lately Emacs often
>> hangs/crashes/stops while I'm working.  I cannot reproduce
>> with emacs -Q, because I need at least org-mode and notmuch
>> for work.
>>
>> Anyway, here is a (x)backtrace from an unoptimized, rather
>> current build, please tell me, if this is helpful or if I
>> should not send such backtraces (I myself cannot read them,
>> I'm happy to answer questions, in this case the Emacs
>> process is still in gdb till max tomorrow 08:00 UTC, then I
>> have to shutdown the laptop):
>>
>> dispnew.c:1456: Emacs fatal error: assertion failed: row >= 0 && row < matrix->nrows
>>
>> Thread 1 "emacs" hit Breakpoint 1, terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at emacs.c:421
>> 421     {
>> (gdb) bt
>> #0  terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at emacs.c:421
>> #1  0x000055555581cae5 in die (msg=0x55555598b4e8 "row >= 0 && row < matrix->nrows", file=0x55555598b293 "dispnew.c", line=1456) at alloc.c:7692
>> #2  0x000055555559d310 in matrix_row (matrix=0x55555d44d470, row=8) at dispnew.c:1456
>
> What does the below produce:
>
>   (gdb) frame 2
>   (gdb) p matrix->nrows

(gdb) frame 2
#2  0x000055555559d310 in matrix_row (matrix=0x55555d44d470, row=8) at dispnew.c:1456
1456      eassert (row >= 0 && row < matrix->nrows);
(gdb) p matrix->nrows
$1 = 7
(gdb)

While working I got another (x)backtracei, in another emacs
daemon, which I guess is related:

Thread 1 "emacs" hit Breakpoint 1, terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at emacs.c:421
421	{
#0  terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at emacs.c:421
#1  0x000055555581cae5 in die (msg=0x55555598b4e8 "row >= 0 && row < matrix->nrows", file=0x55555598b293 "dispnew.c", line=1456) at alloc.c:7692
#2  0x000055555559d310 in matrix_row (matrix=0x5555564be180, row=8) at dispnew.c:1456
#3  0x0000555555640b9a in cursor_in_mouse_face_p (w=0x55555995a528) at xdisp.c:33569
#4  0x00005555555a2b72 in gui_update_window_end (w=0x55555995a528, cursor_on_p=true, mouse_face_overwritten_p=false) at dispnew.c:3902
#5  0x00005555555a28c2 in update_window (w=0x55555995a528, force_p=true) at dispnew.c:3826
#6  0x00005555555a1ad6 in update_window_tree (w=0x55555995a528, force_p=true) at dispnew.c:3456
#7  0x00005555555a143d in update_frame (f=0x55555667e008, force_p=true, inhibit_hairy_id_p=true) at dispnew.c:3291
#8  0x00005555557c675b in read_minibuf
    (map=XIL(0x55556acf1e83), initial=XIL(0), prompt=XIL(0x55556acf7154), expflag=false, histvar=XIL(0xb2e0), histpos=make_fixnum(0), defalt=XIL(0), allow_props=false, inherit_input_method=false) at minibuf.c:916
#9  0x00005555557c7e98 in Fread_from_minibuffer
    (prompt=XIL(0x55556acf7154), initial_contents=XIL(0), keymap=XIL(0x55556acf1e83), read=XIL(0), hist=XIL(0), default_value=XIL(0), inherit_input_method=XIL(0)) at minibuf.c:1373
#10 0x00007fffec9d4cce in F6e6f746d7563682d6a756d70_notmuch_jump_0 () at /home/grfz/.config/emacs/eln-cache/29.0.50-009ca607/notmuch-jump-1d936590-28d41077.eln
#11 0x000055555585c71e in funcall_subr (subr=0x55555b34e3a0, numargs=2, args=0x7fffffffbf28) at eval.c:3024
#12 0x000055555585c142 in funcall_general (fun=XIL(0x55555b34e3a5), numargs=2, args=0x7fffffffbf28) at eval.c:2929
#13 0x000055555585c490 in Ffuncall (nargs=3, args=0x7fffffffbf20) at eval.c:2983
#14 0x000055555585b69c in Fapply (nargs=2, args=0x7fffee7ff040) at eval.c:2654
#15 0x000055555585c936 in funcall_subr (subr=0x555556008ea0 <Sapply>, numargs=2, args=0x7fffee7ff040) at eval.c:3047
#16 0x00005555558c0db4 in exec_byte_code (fun=XIL(0x55556ace77b5), args_template=128, nargs=0, args=0x7fffffffc690) at bytecode.c:809
#17 0x000055555585cabe in fetch_and_exec_byte_code (fun=XIL(0x55556ace77b5), args_template=128, nargs=0, args=0x7fffffffc690) at eval.c:3069
#18 0x000055555585cf4d in funcall_lambda (fun=XIL(0x55556ace77b5), nargs=0, arg_vector=0x7fffffffc690) at eval.c:3141
#19 0x000055555585c18e in funcall_general (fun=XIL(0x55556ace77b5), numargs=0, args=0x7fffffffc690) at eval.c:2933
#20 0x000055555585c490 in Ffuncall (nargs=1, args=0x7fffffffc688) at eval.c:2983
#21 0x00007fffec9d4d07 in F6e6f746d7563682d6a756d70_notmuch_jump_0 () at /home/grfz/.config/emacs/eln-cache/29.0.50-009ca607/notmuch-jump-1d936590-28d41077.eln
#22 0x000055555585c71e in funcall_subr (subr=0x55555b34e3a0, numargs=2, args=0x7fffffffc978) at eval.c:3024
#23 0x000055555585c142 in funcall_general (fun=XIL(0x55555b34e3a5), numargs=2, args=0x7fffffffc978) at eval.c:2929
#24 0x000055555585c490 in Ffuncall (nargs=3, args=0x7fffffffc970) at eval.c:2983
#25 0x00007fffec9d472a in F6e6f746d7563682d6a756d702d736561726368_notmuch_jump_search_0 () at /home/grfz/.config/emacs/eln-cache/29.0.50-009ca607/notmuch-jump-1d936590-28d41077.eln
#26 0x000055555585c6e1 in funcall_subr (subr=0x55555b34e1f8, numargs=0, args=0x7fffffffced0) at eval.c:3020
#27 0x000055555585c142 in funcall_general (fun=XIL(0x55555b34e1fd), numargs=0, args=0x7fffffffced0) at eval.c:2929
#28 0x000055555585c490 in Ffuncall (nargs=1, args=0x7fffffffcec8) at eval.c:2983
#29 0x000055555584ec90 in Ffuncall_interactively (nargs=1, args=0x7fffffffcec8) at callint.c:248
#30 0x000055555585c936 in funcall_subr (subr=0x555556008180 <Sfuncall_interactively>, numargs=1, args=0x7fffffffcec8) at eval.c:3047
#31 0x000055555585c142 in funcall_general (fun=XIL(0x555556008185), numargs=1, args=0x7fffffffcec8) at eval.c:2929
#32 0x000055555585c490 in Ffuncall (nargs=2, args=0x7fffffffcec0) at eval.c:2983
#33 0x000055555585b257 in Fapply (nargs=3, args=0x7fffffffcec0) at eval.c:2607
#34 0x000055555584f126 in Fcall_interactively (function=XIL(0x4e46260), record_flag=XIL(0), keys=XIL(0x55556b38209d)) at callint.c:340
#35 0x00007fffefa06865 in F636f6d6d616e642d65786563757465_command_execute_0 ()
    at /home/grfz/src/emacs-master--68e2a9cd--2022-11-08T12-08+01-00/src/../native-lisp/29.0.50-009ca607/preloaded/simple-fab5b0cf-f2a15bf6.eln
#36 0x000055555585c787 in funcall_subr (subr=0x7fffefbdcfb0, numargs=1, args=0x7fffffffd178) at eval.c:3028
#37 0x000055555585c142 in funcall_general (fun=XIL(0x7fffefbdcfb5), numargs=1, args=0x7fffffffd178) at eval.c:2929
#38 0x000055555585c490 in Ffuncall (nargs=2, args=0x7fffffffd170) at eval.c:2983
#39 0x0000555555767ea0 in call1 (fn=XIL(0x4b90), arg1=XIL(0x4e46260)) at lisp.h:3242
#40 0x000055555576b79e in command_loop_1 () at keyboard.c:1495
#41 0x00005555558579c9 in internal_condition_case (bfun=0x55555576af02 <command_loop_1>, handlers=XIL(0x90), hfun=0x55555576a33c <cmd_error>) at eval.c:1474
#42 0x000055555576aaeb in command_loop_2 (handlers=XIL(0x90)) at keyboard.c:1125
#43 0x0000555555856b79 in internal_catch (tag=XIL(0xfd20), func=0x55555576aac4 <command_loop_2>, arg=XIL(0x90)) at eval.c:1197
#44 0x000055555576aa80 in command_loop () at keyboard.c:1103
#45 0x0000555555769dff in recursive_edit_1 () at keyboard.c:712
#46 0x000055555576a01c in Frecursive_edit () at keyboard.c:795
#47 0x00005555557655b9 in main (argc=2, argv=0x7fffffffd688) at emacs.c:2517

Lisp Backtrace:
"notmuch-jump" (0xffffbf28)
"apply" (0xee7ff040)
0x6ace77b0 PVEC_COMPILED
"notmuch-jump" (0xffffc978)
"notmuch-jump-search" (0xffffced0)
"funcall-interactively" (0xffffcec8)
"command-execute" (0xffffd178)
Undefined command: "xbt".  Try "help".
"notmuch-jump" (0xffffbf28)
"apply" (0xee7ff040)
0x6ace77b0 PVEC_COMPILED
"notmuch-jump" (0xffffc978)
"notmuch-jump-search" (0xffffced0)
"funcall-interactively" (0xffffcec8)
"command-execute" (0xffffd178)

Tahnks for looking into this.

Gregor