Subject: bug#60580: 29.0.60; crash in xdisp.c with modus theme and display-fill-column-indicator

From: Eli Zaretskii <[email-masked]>
Date: Thu, 05 Jan 2023 21:57:39 +0200

> From: chad <[email-masked]>
> Date: Thu, 5 Jan 2023 14:19:48 -0500
> 
> From emacs -q, evaluate:
> 
>   (custom-set-variables '(custom-enabled-themes '(modus-vivendi)))
>   (global-display-fill-column-indicator-mode 1)
> 
> Emacs will fail the eassert in append_stretch_glyph at
> xdisp.c:30993.

Doesn't happen here.  What is your default face's font with that theme?

> Looking at it in gdb, append_stretch_glyph is passed an
> it with both ascent=descent=1 and height=11.

I don't understand: if ascent=descent=1 and height=11, then how come
the condition

  eassert (ascent >= 0 && ascent <= height);

fails to be true?

The backtrace tells a different story:

> #1  0x0000555555823630 in die
>     (msg=0x555555991b70 "ascent >= 0 && ascent <= height", file=0x55555598b48f "xdisp.c", line=30993) at alloc.c:7706
> #2  0x00005555556388a2 in append_stretch_glyph
>     (it=0x7fffffff8430, object=XIL(0), width=639, height=2, ascent=11)
>     at xdisp.c:30993

It says here that height = 2 and ascent = 11.  Which is very strange.
Can you tell what happens here (line 23325):

	  const int stretch_ascent = (((it->ascent + it->descent)
	                               * FONT_BASE (font)) / FONT_HEIGHT (font));

What are the values of the following at that line:

   FONT_BASE (font)
   FONT_HEIGHT (font)
   it->ascent
   it->descent
   stretch_ascent