Subject: bug#30874: 27.0.50; Emacs crashes

From: Eli Zaretskii <[email-masked]>
Date: Fri, 30 Mar 2018 16:46:29 +0300

> From: Robert Pluim <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Fri, 30 Mar 2018 15:00:43 +0200
> 
> > That part of cleanup_vector is under suspicion since it was born, see
> > "git -L" reports about that function.  Perhaps the easiest band-aid
> > (or maybe it's a real fix) would be to disable this part:
> >
> >   if (PSEUDOVECTOR_TYPEP (&vector->header, PVEC_FONT)
> >       && ((vector->header.size & PSEUDOVECTOR_SIZE_MASK)
> > 	  == FONT_OBJECT_MAX))
> >     {
> >       struct font_driver const *drv = ((struct font *) vector)->driver;
> >
> >       /* The font driver might sometimes be NULL, e.g. if Emacs was
> > 	 interrupted before it had time to set it up.  */
> >       if (drv)
> > 	{
> > 	  /* Attempt to catch subtle bugs like Bug#16140.  */
> > 	  eassert (valid_font_driver (drv));
> > 	  drv->close ((struct font *) vector);
> > 	}
> >     }
> >
> > when the font backend is one of those which use ftfont_close.  Or
> > maybe just make ftfont_close return without doing anything if it is
> > called from GC.
> 
> Iʼll look into that. I assume thereʼs an 'in_gc' variable we can check.

Yes, it's called gc_in_progress.

> > Symbola I have installed here does have a glyph for that character,
> > FWIW.
> 
> Now Iʼm thoroughly confused as to what's happening. Eg LibreOffice
> quite happily uses Symbola, so it has the glyph, but I see Emacs
> skipping past Symbola until it arrives at VL Gothic. Itʼs not a big
> deal though, I doubt itʼs a bug.

If VL Gothic has a glyph for that character, it is not a bug.

> > If Jan says it does fix the problem, I think we should install this on
> > master.  What do you think about having this conditioned on a variable
> > exposed to Lisp, as a "fire escape" in case there are some situations
> > where users might want these fonts anyway?
> 
> I thought Xft had no real support for displaying these fonts anyway?

I'm not sure it's about the font, it could be about some glyphs of the
font.  You are probably right, but IME leaving a variable to get back
previous behavior is good policy; at the very least, it makes it easy
to ask users who complain about related problems to see if this
particular change is the culprit without having to rebuild Emacs.

> > Also, we should probably condition this by HAVE_XFT, since AFAIU the
> > problem is only relevant to that build?
> 
> I think thatʼs right. At least the cairo build doesnʼt crash with the
> reproduction recipe.

Thanks.