Subject: Re: 30.0.50; cmcheckmagic aborts when tty_write_glyphs writes "Garbage collecting..." in some cases

From: Eli Zaretskii <[email-masked]>
Date: Thu, 06 Jun 2024 17:53:12 +0300

> From: Daniel Clemente <[email-masked]>
> Date: Thu, 6 Jun 2024 12:34:34 +0000
> Cc: [email-masked]
> 
> The key to reproduce it to have 2 Emacs windows inside the frame:
> 1. Open emacs (no need for emacsclient) with -Q. No need to set
> garbage-collection-messages to t
> 2. Do C-x 2 to have 2 windows, one above one below
> 3. Resize the X window to make it very small, (1 line or so)
> 4. It should immediately crash.
> 
> (gdb) bt full
> #0  terminate_due_to_signal (sig=6, backtrace_limit=40) at emacs.c:443
> No locals.
> #1  0x00005555556bd41b in emacs_abort () at sysdep.c:2391
> No locals.
> #2  0x000055555558cb33 in check_matrix_pointers (window_matrix=0x5555588efa10,
>     frame_matrix=0x5555595855c0) at dispnew.c:3129
>         i = 0
>         j = 0
> #3  0x000055555558ca52 in check_window_matrix_pointers (w=0x5555591f66b8)
>     at dispnew.c:3098
>         f = 0x555558008768
> #4  0x000055555558c9df in check_window_matrix_pointers (w=0x555559452b90)
>     at dispnew.c:3094
> No locals.
> #5  0x000055555558c9df in check_window_matrix_pointers (w=0x55555960d2d8)
>     at dispnew.c:3094
> No locals.
> #6  0x000055555558d10e in update_frame (f=0x555558008768, force_p=true,
>     inhibit_hairy_id_p=false) at dispnew.c:3359
>         paused_p = false
>         root_window = 0x55555960d2d8

I see a different abort, for which I've now installed a fix.  To try
to fix the above one, I need some additional data:

  (gdb) frame 2
  (gdb) p window_matrix->rows->glyphs[0]
  (gdb) p frame_matrix->rows->glyphs[0]
  (gdb) p frame_matrix->rows->glyphs[2]
  (gdb) p window_matrix->nrows
  (gdb) p frame_matrix->nrows