all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pip Cet <pipcet@gmail.com>
To: Zihao Zhu <all_but_last@163.com>
Cc: 41627@debbugs.gnu.org
Subject: bug#41627: 28.0.50; Emacs with cairo build segfault in HELLO file
Date: Sun, 31 May 2020 12:35:07 +0000	[thread overview]
Message-ID: <CAOqdjBf3bdbRpZmetaYZ+ERjkAB8=xxAkZaWnRxrpXLiLgBA8A@mail.gmail.com> (raw)
In-Reply-To: <e17e6330-c247-fe46-7907-d1087ca46f70@163.com>

[-- Attachment #1: Type: text/plain, Size: 649 bytes --]

On Sun, May 31, 2020 at 11:49 AM Zihao Zhu <all_but_last@163.com> wrote:
> I try the Emacs build in commit
> 780f674a82a90c4e3e32583059b498bfa57e4a06. When I eval
>
> (set-frame-font "Sarasa Mono Slab SC" t)

> GDB attached backtrace in attachment.

This line seems suspicious:

        font_face = 0x7ffff747e880 <_cairo_font_face_nil_file_not_found>

It looks like you can't rely on cairo_ft_font_face_create_for_pattern
to return a NULL pointer. I suspect the attached patch will work, but
if this is something Cairo does in other places it needs to be
checked.

(My suspicion is the font was not installed correctly, so Cairo
couldn't find it.)

[-- Attachment #2: 0001-Handle-the-case-that-Cairo-cannot-find-a-font-file-B.patch --]
[-- Type: text/x-patch, Size: 899 bytes --]

From 6b40e4b1c2c5376f9ad819aacdd32d142fb5e67b Mon Sep 17 00:00:00 2001
From: Pip Cet <pipcet@gmail.com>
Date: Sun, 31 May 2020 12:31:50 +0000
Subject: [PATCH] Handle the case that Cairo cannot find a font file
 (Bug#41627)

* src/ftcrfont.c (ftcrfont_open): Handle non-NULL error returns
from cairo_ft_font_face_create_for_pattern.
---
 src/ftcrfont.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/ftcrfont.c b/src/ftcrfont.c
index 7832d4f5ce..ec87ae3335 100644
--- a/src/ftcrfont.c
+++ b/src/ftcrfont.c
@@ -139,7 +139,8 @@ ftcrfont_open (struct frame *f, Lisp_Object entity, int pixel_size)
 
   FcPatternDestroy (pat);
   font_face = cairo_ft_font_face_create_for_pattern (match);
-  if (!font_face)
+  if (!font_face
+      || cairo_font_face_status (font_face) != CAIRO_STATUS_SUCCESS)
     {
       unblock_input ();
       FcPatternDestroy (match);
-- 
2.27.0.rc0


  reply	other threads:[~2020-05-31 12:35 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-31 11:32 bug#41627: 28.0.50; Emacs with cairo build segfault in HELLO file Zihao Zhu
2020-05-31 12:35 ` Pip Cet [this message]
2020-05-31 14:27   ` Zihao Zhu
2020-05-31 14:34     ` Pip Cet
2020-05-31 14:31   ` Zihao Zhu
2020-05-31 14:54 ` Eli Zaretskii
2020-05-31 15:38   ` Zihao Zhu
2020-05-31 17:24     ` Eli Zaretskii
2020-05-31 20:45       ` Pip Cet
2020-06-01 16:35         ` Eli Zaretskii
2020-06-01 18:02           ` Pip Cet
2020-09-27 14:29             ` Lars Ingebrigtsen
2020-10-21 15:58               ` Robert Pluim
2020-10-22 11:41                 ` Lars Ingebrigtsen
2020-10-22 12:03                   ` Zhu Zihao
2020-10-22 12:43                     ` Lars Ingebrigtsen
2020-06-22 16:47 ` Zhu Zihao
2020-06-22 18:06   ` Eli Zaretskii
2020-06-23  4:10     ` bug#41627: " Zhu Zihao

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='CAOqdjBf3bdbRpZmetaYZ+ERjkAB8=xxAkZaWnRxrpXLiLgBA8A@mail.gmail.com' \
    --to=pipcet@gmail.com \
    --cc=41627@debbugs.gnu.org \
    --cc=all_but_last@163.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.