Subject: bug#66589: 30.0.50; core dump in redisplay

From: Eli Zaretskii <[email-masked]>
Date: Wed, 18 Oct 2023 14:40:34 +0300

> From: Evgeny Zajcev <[email-masked]>
> Date: Tue, 17 Oct 2023 22:37:08 +0300
> Cc: [email-masked]
> 
>  > (gdb) p it->current
>  > $6 = {
>  >   pos = {
>  >     charpos = 10098,
>  >     bytepos = 14401
>  >   },
>  >   overlay_string_index = -1,
>  >   string_pos = {
>  >     charpos = -1,
>  >     bytepos = -1
>  >   },
>  >   dpvec_index = -1
>  > }
>  > (gdb) p current_buffer->zv
>  > No symbol "current_buffer" in current context.
>  > (gdb) p current_thread->m_current_buffer
>  > $7 = (struct buffer *) 0x55ccf0885fb0
>  > (gdb) p current_thread->m_current_buffer->zv
>  > $8 = 10106
>  > (gdb) p current_thread->m_current_buffer->text->beg[10000]@106
>  > $9 = "     \n    | ⮪ Yura› Позорище 🤦‍♂ у ФСБ только на Газель Хва",
>  > <incomplete sequence \320>
>  > (gdb)
> 
>  Hmm... what about this:
> 
>    (gdb) frame 18
>    (gdb) p current_thread->m_current_buffer->text->gpt_byte
>    (gdb) p current_thread->m_current_buffer->zv_byte
>    (gdb) p current_thread->m_current_buffer->text->beg[14350]@100
> 
>  (gdb) frame 18
>  #18 produce_glyphless_glyph (it=0x7ffef46c5660, for_no_font=for_no_font@entry=false,
>  acronym=acronym@entry=XIL(0)) at xdisp.c:32165
>  32165             sprintf (buf, "%0*X", it->c < 0x10000 ? 4 : 6, it->c + 0u);
>  (gdb) p current_thread->m_current_buffer->text->gpt_byte
>  $10 = 5287
>  (gdb) p current_thread->m_current_buffer->zv_byte
>  $11 = 14409
>  (gdb) p current_thread->m_current_buffer->text->beg[14350]@100
>  $12 = ' ' <repeats 48 times>, "11:09\n(Д) Дени", ' ' <repeats 32 times>
>  (gdb) 
> 
> Take into account that char between (Д) and Дени из 0xa0, not a regular space. My gmail web
> interface might changed it

Very strange.  This means that both it->char_to_display and it->c are
bogus, and I have no idea how this could happen.  So it is very
important that you try to provide a reproduction recipe for this.  I
will nevertheless try to see if I can figure out how such a situation
could ever happen.