GNU bug report logs - #23386
Segfault when messing with font-backend

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> IRO.UMontreal.CA>

Date: Wed, 27 Apr 2016 13:14:01 UTC

Severity: normal

Tags: confirmed

Merged with 35803, 36835, 39865

Found in versions 25.0.95, 28.0.50, 25.0.50, 24.1, 24.5, 26.2, 27.0.50

Fixed in version 27.1

Done: Robert Pluim <rpluim <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: npostavs <at> users.sourceforge.net
Cc: dmantipov <at> yandex.ru, monnier <at> IRO.UMontreal.CA, 23386 <at> debbugs.gnu.org
Subject: bug#23386: Segfault when messing with font-backend
Date: Mon, 11 Jul 2016 17:33:29 +0300
> From: npostavs <at> users.sourceforge.net
> Date: Sun, 10 Jul 2016 16:17:00 -0400
> Cc: Stefan Monnier <monnier <at> IRO.UMontreal.CA>, 23386 <at> debbugs.gnu.org
> 
> Dmitry Antipov <dmantipov <at> yandex.ru> writes:
> 
> > IMHO the original trick (request to drop font backend when there is a font
> > opened by using this backend) is practically meaningless, so why just not
> > prohibit it explicitly? For example, with:
> 
> Maybe that is a better idea; it does prevent the segfault, and it's
> certainly simpler.

But it doesn't do what the user asked for.

I don't see why it would be meaningless to evict a backend and start
using another one, if all it takes is re-open a bunch of fonts.

So I'm in favor of Noam's proposal, assuming that it works.

Noam, I encourage you to dig some more into this "forest", until you
convince yourself that the patch is sound.  While at that, please
consider adding comments where you learn useful things that are not
trivial to understand from the code alone, as this area of Emacs
sources is notoriously under-documented.

One issue that bothers me is this: what if additional fonts were
already opened for non-default faces?  Should they also get some
treatment?  (This is relevant to Dmitry's suggestion as well.)

I have one comment about your patch:

> diff --git a/src/xfns.c b/src/xfns.c
> index 7c1bb1c..1b9dd48 100644
> --- a/src/xfns.c
> +++ b/src/xfns.c
> @@ -3071,7 +3071,7 @@ do_unwind_create_frame (Lisp_Object frame)
>    unwind_create_frame (frame);
>  }
>  
> -static void
> +void
>  x_default_font_parameter (struct frame *f, Lisp_Object parms)
>  {
>    struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);

This cannot be done only in xfns.c, as it will then break the other
platforms, because x_set_font_backend is not specific to X.

Thanks.




This bug report was last modified 5 years and 65 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.