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

From: Eli Zaretskii <[email-masked]>
Date: Wed, 12 Jul 2017 19:20:32 +0300

> From: Robert Pluim <[email-masked]>
> Date: Wed, 12 Jul 2017 17:17:31 +0200
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> >> From: Robert Pluim <[email-masked]>
> >> Date: Wed, 12 Jul 2017 16:47:57 +0200
> >>  62  992: CHAR[m] pos=9608 blev=0,btyp=L w=16 a+d=25+6 face=28 MB
> >>  63 1008: CHAR[ ] pos=9609 blev=0,btyp=L w=16 a+d=25+6 face=28 MB
> >>  64 1024: CHAR[i] pos=9610 blev=0,btyp=L w=16 a+d=25+6 face=28 MB
> >>  65 1040: CHAR[s] pos=9611 blev=0,btyp=L w=16 a+d=25+6 face=28 MB
> >>  66 1056: CHAR[ ] pos=9612 blev=0,btyp=L w=16 a+d=25+6 face=28 MB
> >>  67 1072: CHAR[a] pos=9613 blev=0,btyp=L w=16 a+d=25+6 face=28 MB
> >>  68 1088: CHAR[ ] pos=0 blev=0,btyp=B w=16 a+d=25+6 face=28 MB
> >>  69 1104: CHAR[s] pos=6237 blev=0,btyp=L w=16 a+d=25+6 MB
> >>  70 1120: CHAR[ ] pos=0 blev=0,btyp=B w=16 a+d=25+6 MB
> >>  71 1136:  str=0xc8676d[9683324] w=-15971 a+d=147+0 MB PAD N/A [ slice=49485,147,0,0
> >>  72 -14835:  str=0xc8671b[9683580] w=-15715 a+d=147+0 MB PAD AVOID [ slice=49741,147,0,0
> >>  74 -46113: CHAR[c] pos=9551 blev=0,btyp=L w=16 a+d=25+6 face=28 MB
> >
> > Does the text of this line give you enough hint to tell me what was on
> > this line?  In particular, does it make sense that the line had 138
> > glyphs?  Because it looks like everything after glyph 68 is garbage,
> > although I don't yet have any idea how it ended up there.
> >
> 
> Yes, as I said it's line 237 of lisp/net/gnutls.el, it's definitely
> not 138 glyphs:

Well, I cannot know what kind of display features you have there; what
is just 63 characters in the file could have all kind of stuff
appended to it on display...

Anyway, what do these 2 show:

  (gdb) p it->glyph_row->enabled_p
  (gdb) p it->glyph_row->displays_text_p

Also, is the previous screen line OK?  This will show:

  (gdb) pgrowx (it->glyph_row-1)

Eventually, if nothing else gives a clue, please continue running
Emacs under GDB, and if the crashes are always in
compute_line_metrics, show the offending glyph_row each time it
crashes.  Perhaps the data will give some hint about what could be
wrong.  (Currently, the only idea I have is that somehow
glyph_row->used[1] is set to a value larger than it should, which
might mean some problem in maybe_produce_line_number, where it
increments the used count, but I'd like first to see if all the
problems manifest themselves with such a large used count.)

Thanks.