GNU bug report logs - #41627
28.0.50; Emacs with cairo build segfault in HELLO file

Previous Next

Package: emacs;

Reported by: Zihao Zhu <all_but_last <at> 163.com>

Date: Sun, 31 May 2020 11:49:02 UTC

Severity: normal

Tags: fixed

Found in version 28.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

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: Zihao Zhu <all_but_last <at> 163.com>
Cc: 41627 <at> debbugs.gnu.org, pipcet <at> gmail.com
Subject: bug#41627: 28.0.50; Emacs with cairo build segfault in HELLO file
Date: Sun, 31 May 2020 20:24:41 +0300
> Cc: 41627 <at> debbugs.gnu.org, Pip Cet <pipcet <at> gmail.com>
> From: Zihao Zhu <all_but_last <at> 163.com>
> Date: Sun, 31 May 2020 23:38:28 +0800
> 
> A gdb attached backtrace generated by Emacs build with CFLAGS=-O0 -g3 in 
> attachment

Thanks, I think the situation is clear.

> 0x00000000006c5a34 in ftcrfont_open (f=0xc192d0, entity=0x1300675, pixel_size=18) at ftcrfont.c:237
> 237	ftcrfont.c: 没有那个文件或目录.
> #0  0x00000000006c5a34 in ftcrfont_open (f=0xc192d0, entity=0x1300675, pixel_size=18) at ftcrfont.c:237

This crashes here:

  ft_face = cairo_ft_scaled_font_lock_face (scaled_font);
  if (XFIXNUM (AREF (entity, FONT_SIZE_INDEX)) == 0)
    {
      int upEM = ft_face->units_per_EM;  <<<<<<<<<<<<<<<<<<<<<

because cairo_ft_scaled_font_lock_face returned NULL:

>         ft_face = 0x0

That function is documented to be able to return NULL:

  Returns

  The FT_Face object for font, scaled appropriately, or NULL if
  scaled_font is in an error state (see cairo_scaled_font_status()) or
  there is insufficient memory.

So it sounds like we should see if scaled_font is "in an error state",
and in any case bail out if ft_face is NULL.

Can someone please propose a patch along these lines?  I cannot easily
test a Cairo build, so I won't try showing a patch.

Thanks.




This bug report was last modified 4 years and 212 days ago.

Previous Next


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