all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Robert Pluim <rpluim@gmail.com>
Cc: 30874@debbugs.gnu.org, jsynacek@redhat.com
Subject: bug#30874: 27.0.50; Emacs crashes
Date: Sat, 31 Mar 2018 17:59:21 +0300	[thread overview]
Message-ID: <834lkw8f5i.fsf@gnu.org> (raw)
In-Reply-To: <87in9cxsce.fsf@gmail.com> (message from Robert Pluim on Sat, 31 Mar 2018 15:55:13 +0200)

> From: Robert Pluim <rpluim@gmail.com>
> Cc: 30874@debbugs.gnu.org,  jsynacek@redhat.com
> Date: Sat, 31 Mar 2018 15:55:13 +0200
> 
> Iʼm testing the following, which fixes the 20890 crash for me when
> using Cairo.
> 
> diff --git i/src/ftfont.c w/src/ftfont.c
> index c2e093e633..89c07e1f21 100644
> --- i/src/ftfont.c
> +++ w/src/ftfont.c
> @@ -1242,6 +1242,11 @@ ftfont_close (struct font *font)
>    struct ftfont_info *ftfont_info = (struct ftfont_info *) font;
>    Lisp_Object val, cache;
>  
> +#ifdef USE_CAIRO
> +  /* Bug#20890 workaround.  */
> +  if (gc_in_progress)
> +    return;
> +#endif
>    val = Fcons (font->props[FONT_FILE_INDEX], make_number (ftfont_info->index));
>    cache = ftfont_lookup_cache (val, FTFONT_CACHE_FOR_FACE);
>    eassert (CONSP (cache));

This LGTM, thanks.

> >> > Also, we should probably condition this by HAVE_XFT, since AFAIU the
> >> > problem is only relevant to that build?
> 
> This is what Iʼm using at the moment. I can put the variable in
> syms_of_xftfont if you prefer.
> 
> diff --git i/src/ftfont.c w/src/ftfont.c
> index c2e093e633..2190186940 100644
> --- i/src/ftfont.c
> +++ w/src/ftfont.c
> @@ -764,6 +764,13 @@ ftfont_spec_pattern (Lisp_Object spec, char *otlayout, struct OpenTypeSpec **ots
>    if (scalable >= 0
>        && ! FcPatternAddBool (pattern, FC_SCALABLE, scalable ? FcTrue : FcFalse))
>      goto err;
> +#ifdef HAVE_XFT
> +  /* We really don't like color fonts, they cause Xft crashes.  See
> +     bug#30874.  */
> +  if (Vxft_ignore_color_fonts
> +      && ! FcPatternAddBool(pattern, FC_COLOR, FcFalse))
> +    goto err;
> +#endif
>  
>    goto finish;
>  
> @@ -2735,6 +2742,14 @@ syms_of_ftfont (void)
>    DEFSYM (Qsans, "sans");
>    DEFSYM (Qsans__serif, "sans serif");
>  
> +#ifdef HAVE_XFT
> +  DEFVAR_BOOL ("xft-ignore-color-fonts",
> +	       Vxft_ignore_color_fonts,
> +     doc: /* Non-nil means don't query fontconfig for color fonts,
> +since they often cause Xft crashes. bug#30874.  */);
> +  Vxft_ignore_color_fonts = 1;
> +#endif
> +
>    staticpro (&freetype_font_cache);
>    freetype_font_cache = list1 (Qt);

It can stay in ftfont.c, but please make the second hunk
unconditional, so that the variable is known and available in all the
builds, just say in the doc string that this variable has effect only
on the xftfont backend.  I have bad experience with variables that are
only defined in some configurations: it means both trouble for users
who use more than one configuration and more maintenance headaches.
Come to think of it, maybe it's best to move DEFVAR_BOOL to font.c,
for that very reason.

Thanks.





  reply	other threads:[~2018-03-31 14:59 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-20 10:24 bug#30874: 27.0.50; Emacs crashes Jan Synacek
2018-03-20 12:04 ` Eli Zaretskii
2018-03-20 12:12   ` Jan Synacek
2018-03-20 12:44     ` Eli Zaretskii
2018-03-22 12:28       ` Jan Synacek
2018-03-22 13:01         ` Eli Zaretskii
2018-03-22 13:05           ` Jan Synacek
2018-03-22 14:55             ` Eli Zaretskii
2018-03-26  9:12               ` Jan Synacek
2018-03-26 10:33                 ` Robert Pluim
2018-03-26 15:25                   ` Eli Zaretskii
2018-03-26 16:52                     ` Robert Pluim
2018-03-26 17:33                       ` Eli Zaretskii
2018-03-26 20:17                         ` Robert Pluim
2018-03-26 22:16                           ` Robert Pluim
2018-03-27  3:02                             ` Eli Zaretskii
2018-03-27  8:57                               ` Robert Pluim
2018-03-29 10:25                                 ` Eli Zaretskii
2018-03-29 16:14                                   ` Robert Pluim
2018-03-29 17:07                                     ` Eli Zaretskii
2018-03-30  5:10                                       ` Glenn Morris
2018-03-30  8:00                                         ` Eli Zaretskii
2018-03-30 10:36                                       ` Robert Pluim
2018-03-30 11:46                                         ` Eli Zaretskii
2018-03-30 13:00                                           ` Robert Pluim
2018-03-30 13:46                                             ` Eli Zaretskii
2018-03-31 13:55                                               ` Robert Pluim
2018-03-31 14:59                                                 ` Eli Zaretskii [this message]
2018-04-03  9:24                                                   ` Robert Pluim
2018-04-03  8:00                                           ` Jan Synacek
2018-04-03  9:22                                             ` Robert Pluim
2018-04-03  9:42                                               ` Eli Zaretskii
2018-04-03 12:52                                                 ` Robert Pluim
2018-03-29 10:35                               ` Jan Synacek

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=834lkw8f5i.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=30874@debbugs.gnu.org \
    --cc=jsynacek@redhat.com \
    --cc=rpluim@gmail.com \
    /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.