all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: npostavs@users.sourceforge.net
Cc: dmantipov@yandex.ru, monnier@IRO.UMontreal.CA, 23386@debbugs.gnu.org
Subject: bug#23386: Segfault when messing with font-backend
Date: Mon, 11 Jul 2016 17:33:29 +0300	[thread overview]
Message-ID: <831t30dz2e.fsf@gnu.org> (raw)
In-Reply-To: <87a8hpgseb.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net)

> From: npostavs@users.sourceforge.net
> Date: Sun, 10 Jul 2016 16:17:00 -0400
> Cc: Stefan Monnier <monnier@IRO.UMontreal.CA>, 23386@debbugs.gnu.org
> 
> Dmitry Antipov <dmantipov@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.





  reply	other threads:[~2016-07-11 14:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-27 13:13 bug#23386: Segfault when messing with font-backend Stefan Monnier
2016-04-27 14:02 ` Eli Zaretskii
2016-04-27 14:23   ` Stefan Monnier
2016-07-09 19:11     ` npostavs
2016-07-09 20:02       ` npostavs
2016-07-10 14:18         ` Eli Zaretskii
2016-07-10 20:15           ` npostavs
2016-07-10 17:29       ` Dmitry Antipov
2016-07-10 20:17         ` npostavs
2016-07-11 14:33           ` Eli Zaretskii [this message]
2016-07-12 15:20             ` Dmitry Antipov
2016-07-12 17:45               ` Eli Zaretskii
2016-07-12 17:58                 ` Dmitry Antipov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=831t30dz2e.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=23386@debbugs.gnu.org \
    --cc=dmantipov@yandex.ru \
    --cc=monnier@IRO.UMontreal.CA \
    --cc=npostavs@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.