Subject: bug#27668: 26.0.50; Crash with display-line-numbers t

From: Eli Zaretskii <[email-masked]>
Date: Fri, 14 Jul 2017 11:03:48 +0300

> From: Robert Pluim <[email-masked]>
> Date: Thu, 13 Jul 2017 21:35:45 +0200
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> >> From: Robert Pluim <[email-masked]>
> >> Date: Thu, 13 Jul 2017 20:17:51 +0200
> >> 
> >> (gdb) p  it->glyph_row->used[TEXT_AREA]
> >> $1 = 66
> >> 
> >> (gdb) bt
> >> #0  terminate_due_to_signal (sig=sig@entry=6, backtrace_limit=backtrace_limit@entry=2147483647) at emacs.c:363
> >> #1  0x00000000005a5084 in die (msg=msg@entry=0x6987d8 "pdl->kind == SPECPDL_BACKTRACE", file=file@entry=0x698448 "eval.c", line=line@entry=150) at alloc.c:7348
> >> #2  0x0000000000419f3b in backtrace_function (pdl=<optimized out>) at eval.c:150
> >> #3  <function called from gdb>
> >> #4  maybe_produce_line_number (it=it@entry=0x7fffffff8130) at xdisp.c:21010
> >> #5  0x0000000000465365 in display_line (it=it@entry=0x7fffffff8130, cursor_vpos=cursor_vpos@entry=16) at xdisp.c:21225
> >> #6  0x00000000004672bd in try_window (window=..., window@entry=XIL(0x146d7d5), pos=..., flags=flags@entry=1) at xdisp.c:17544
> >> #7  0x000000000047f9ab in redisplay_window (window=XIL(0x146d7d5), just_this_one_p=just_this_one_p@entry=false) at xdisp.c:16991
> >> #8  0x00000000004831fb in redisplay_window_0 (window=..., window@entry=XIL(0x146d7d5)) at xdisp.c:14751
> >
> > Curiouser and curiouser...
> >
> > OK, in frame #5, the one in display_line, what do these produce:
> >
> >   (gdb) p it->current
> >   (gdb) pgrowx it->glyph_row
> 
> (gdb) p it->current
> $2 = {
>   pos = {
>     charpos = 37180, 
>     bytepos = 37180
>   }, 
>   overlay_string_index = -1, 
>   string_pos = {
>     charpos = -1, 
>     bytepos = -1
>   }, 
>   dpvec_index = -1
> }
> (gdb) pgrowx it->glyph_row
> TEXT: 66 glyphs
>   0    0: CHAR[ ] pos=-1 blev=2,btyp=EN w=16 a+d=25+6 face=51 MB AVOID
>   1   16: CHAR[1] pos=-1 blev=2,btyp=EN w=16 a+d=25+6 face=51 MB AVOID
>   2   32: CHAR[2] pos=-1 blev=2,btyp=EN w=16 a+d=25+6 face=51 MB AVOID
>   3   48: CHAR[6] pos=-1 blev=2,btyp=EN w=16 a+d=25+6 face=51 MB AVOID
>   4   64: CHAR[1] pos=-1 blev=2,btyp=EN w=16 a+d=25+6 face=51 MB AVOID
>   5   80: CHAR[ ] pos=-1 blev=2,btyp=EN w=16 a+d=25+6 face=51 MB AVOID
>   6   96: CHAR[ ] pos=37180 blev=0,btyp=L w=16 a+d=25+6 MB

Hmm...  I'm not sure how this happened, but I have a theory.  I've now
made a change in master based on that theory, and also added an
assertion where you previously had to set a breakpoint.  Please see if
the current master fixes the problem and doesn't hit the assertion in
maybe_produce_line_number.

Thanks.