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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Stefan Monnier <monnier@HIDDEN>; Keywords: confirmed; dated Wed, 27 Apr 2016 13:14:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) confirmed. Request was from npostavs@HIDDEN to control <at> debbugs.gnu.org. Full text available.
bug Marked as found in versions 25.0.95. Request was from npostavs@HIDDEN to control <at> debbugs.gnu.org. Full text available.
bug Marked as found in versions 24.5. Request was from npostavs@HIDDEN to control <at> debbugs.gnu.org. Full text available.
bug Marked as found in versions 24.1. Request was from npostavs@HIDDEN to control <at> debbugs.gnu.org. Full text available.

Message received at 23386 <at> debbugs.gnu.org:


Received: (at 23386) by debbugs.gnu.org; 9 Jul 2016 19:11:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 09 15:11:52 2016
Received: from localhost ([127.0.0.1]:44389 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bLxfM-00067i-BU
	for submit <at> debbugs.gnu.org; Sat, 09 Jul 2016 15:11:52 -0400
Received: from mail-io0-f169.google.com ([209.85.223.169]:32950)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <npostavs@HIDDEN>)
 id 1bLxfK-00067O-0k; Sat, 09 Jul 2016 15:11:50 -0400
Received: by mail-io0-f169.google.com with SMTP id t74so69722237ioi.0;
 Sat, 09 Jul 2016 12:11:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=sender:from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=7gg93yqNmQmy3nmHOdat3EFdzZR46PlVnJP+I5XjDyg=;
 b=wLNHnB1oGgRUkJOzI4gBPCsDRj9NJ2SGRPMiOCM5RNVqjrN8lXa6/jrXXe+0rHFoyj
 2g212HzOdswtzQjc85MtjTTBYMDZG05y6cvZE8c5iGfwjQi5jAysDsgAF/xFDJ/Eer57
 IRdxe0aQNewDHv/9bGsxkO5wle3d0G2DX02muGrq4tXG/r1pMZXMP1VQB5tLrrv0Vz7V
 O/CT1/68cJRpyw8QG8tGa9DjvYHFiTgweJfKvZteWDJvoH7Wk9IhE8H6JFVkk7puWM7k
 DoZdEV9TFEvkON8fk4OW0COgQ99t2KfEDPL2zATtjwp9Gn2iW332AxldyOoByIXdyb4M
 Dd5Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:sender:from:to:cc:subject:references:date
 :in-reply-to:message-id:user-agent:mime-version;
 bh=7gg93yqNmQmy3nmHOdat3EFdzZR46PlVnJP+I5XjDyg=;
 b=Pl6uVE96vtXNji3Dl0j/slE9Icssr8cP7sfXCJiKYK3dhm/QX27dfIpFP54d8QZ9V3
 7JwPEAKYKant0aeBu8jPYX3sGzFJf9h1aWL5DimjwZnmDn7CQR6GcnOIOm6OP23pONop
 37jw5qx14X0p7Y7F13tpPLzZL/CKEFmLNDHVjR6FeEojQPyiGd6RmBGV5vN+GdLxumTn
 izUcpk1ilWl+ODLkxIHGlbY2LweXt3xUwqSp3Er/0IOdr+L7/3hp0lNNYNLCtAE7ss6N
 jBAnGt4pkDpGqbjWli7jQtL7x8ZXF/kZ153vgkn6lFboSm810dgeN6k76cC8cfqL+31z
 AhQQ==
X-Gm-Message-State: ALyK8tL+HCezZtAu1hNJUCr9td61i6taf/d/y3EQEl0xfOf7dmeTkVxEsC7bbG8EWDuJbw==
X-Received: by 10.107.58.65 with SMTP id h62mr15188882ioa.172.1468091504461;
 Sat, 09 Jul 2016 12:11:44 -0700 (PDT)
Received: from zony (206-188-64-44.cpe.distributel.net. [206.188.64.44])
 by smtp.googlemail.com with ESMTPSA id p63sm3897543itg.9.2016.07.09.12.11.43
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 09 Jul 2016 12:11:43 -0700 (PDT)
From: npostavs@HIDDEN
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#23386: Segfault when messing with font-backend
References: <jwvlh3zfb45.fsf@HIDDEN> <83y47zxi81.fsf@HIDDEN>
 <jwva8kf9lv0.fsf-monnier+emacsbugs@HIDDEN>
Date: Sat, 09 Jul 2016 15:11:42 -0400
In-Reply-To: <jwva8kf9lv0.fsf-monnier+emacsbugs@HIDDEN> (Stefan Monnier's
 message of "Wed, 27 Apr 2016 10:23:00 -0400")
Message-ID: <87d1mmiq35.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 23386
Cc: Eli Zaretskii <eliz@HIDDEN>, 23386 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

--=-=-=
Content-Type: text/plain

found 23386 24.1
found 23386 24.5
found 23386 25.0.95
tags 23386 confirmed
quit

- Emacs versions 24.1, 24.2, 24.4, 24.5 all segfault this case.
- Emacs versions 23.4 and 24.3 don't segfault, but the first frame
  shows boxes for the characters in the modeline, and still seems to
  be using the Xft font in the initial frame (subsequently created
  frames use a font from the X backend).

In all cases this error is triggerred on startup:
"frame-notice-user-settings: Font `-PfEd-DejaVu Sans
Mono-normal-normal-normal-*-15-*-*-*-m-0-iso10646-1' is not defined",
although only in the latter case is Emacs able to display it, otherwise
it segfaults first.

AFAICT, this it's the same bug in all versions, some happen not to
segfault by accident.

The segfault happens when using font with

  (font->driver == &xftfont_driver) &&
  ((struct xftfont_info *)font)->xftfont == NULL

Passing NULL xftfont to Xft library triggers a segfault.

The way we end up with this kind of bad font object, is that
x_set_font_backend calls font_update_drivers which eventually calls
xftfont_close which sets the xftfont field of the frame's font to NULL,
but the frame still refers to this closed object.  The chosen font is
not updated, because it's set in the frame-parameters, so when
x_set_font_backend tries to honour this choice, it gets the error "Font
... is not defined" mentioned above (the font was defined only for the
xft backend, not the remaining x backend), and leaves the invalid font
object as the frame's default font.

Here is a patch that attempts to fix the issue by resetting the font
after the backend is changed.  It does let Emacs successfully open the
frame with the new font (no funny box characters in the modeline), but
I'm not sure if it's the best way of marking the font object invalid.


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline;
 filename=v1-0001-Don-t-segfault-on-font-backend-change-Bug-23386.patch
Content-Description: patch

From 190e70acf940ad7678812e069e74fce93668a8a8 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@HIDDEN>
Date: Sat, 9 Jul 2016 14:20:53 -0400
Subject: [PATCH v1] Don't segfault on font backend change (Bug #23386)

* src/font.c (font_finish_cache): Kill frame's font if it used the
driver we just turned off.
* src/frame.c (x_set_font_backend): Reset the frame's font if it's been
killed.
---
 src/font.c  |  7 +++++++
 src/frame.c | 16 ++++++++++++++--
 src/frame.h |  1 +
 src/xfns.c  |  2 +-
 4 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/src/font.c b/src/font.c
index 2519599..e48b566 100644
--- a/src/font.c
+++ b/src/font.c
@@ -2587,6 +2587,13 @@ font_finish_cache (struct frame *f, struct font_driver *driver)
       font_clear_cache (f, XCAR (val), driver);
       XSETCDR (cache, XCDR (val));
     }
+
+  if (FRAME_FONT (f)->driver == driver)
+    {
+      /* Don't leave the frame's font pointing to a closed driver. */
+      store_frame_param(f, Qfont, Qnil);
+      FRAME_FONT (f) = NULL;
+    }
 }
 
 
diff --git a/src/frame.c b/src/frame.c
index 00f25f7..d7454d9 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -3677,6 +3677,8 @@ x_set_font (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
 void
 x_set_font_backend (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
 {
+  Lisp_Object frame;
+
   if (! NILP (new_value)
       && !CONSP (new_value))
     {
@@ -3718,11 +3720,21 @@ x_set_font_backend (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu
     }
   store_frame_param (f, Qfont_backend, new_value);
 
+  XSETFRAME (frame, f);
+
+  /* If closing the font driver killed the frame's font, we need to
+     get a new one.  */
+  if (!FRAME_FONT (f))
+    x_default_font_parameter (f, Fframe_parameters (frame));
+  if (!FRAME_FONT (f))
+    {
+      delete_frame (frame, Qnoelisp);
+      error ("Invalid frame font");
+    }
+
   if (FRAME_FONT (f))
     {
-      Lisp_Object frame;
 
-      XSETFRAME (frame, f);
       x_set_font (f, Fframe_parameter (frame, Qfont), Qnil);
       face_change = true;
       windows_or_buffers_changed = 18;
diff --git a/src/frame.h b/src/frame.h
index f0cdcd4..5b5349e 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -1356,6 +1356,7 @@ extern void x_set_scroll_bar_default_height (struct frame *);
 extern void x_set_offset (struct frame *, int, int, int);
 extern void x_wm_set_size_hint (struct frame *f, long flags, bool user_position);
 extern Lisp_Object x_new_font (struct frame *, Lisp_Object, int);
+extern void x_default_font_parameter (struct frame *f, Lisp_Object parms);
 extern void x_set_frame_parameters (struct frame *, Lisp_Object);
 extern void x_set_fullscreen (struct frame *, Lisp_Object, Lisp_Object);
 extern void x_set_line_spacing (struct frame *, Lisp_Object, Lisp_Object);
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);
-- 
2.8.0


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23386; Package emacs. Full text available.

Message received at 23386 <at> debbugs.gnu.org:


Received: (at 23386) by debbugs.gnu.org; 27 Apr 2016 14:22:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 27 10:22:37 2016
Received: from localhost ([127.0.0.1]:50163 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1avQMO-0003YZ-T0
	for submit <at> debbugs.gnu.org; Wed, 27 Apr 2016 10:22:37 -0400
Received: from chene.dit.umontreal.ca ([132.204.246.20]:58736)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1avQMN-0003YQ-66
 for 23386 <at> debbugs.gnu.org; Wed, 27 Apr 2016 10:22:35 -0400
Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242])
 by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id u3REMX59007553;
 Wed, 27 Apr 2016 10:22:33 -0400
Received: by ceviche.home (Postfix, from userid 20848)
 id B7379661ED; Wed, 27 Apr 2016 10:23:00 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#23386: Segfault when messing with font-backend
Message-ID: <jwva8kf9lv0.fsf-monnier+emacsbugs@HIDDEN>
References: <jwvlh3zfb45.fsf@HIDDEN> <83y47zxi81.fsf@HIDDEN>
Date: Wed, 27 Apr 2016 10:23:00 -0400
In-Reply-To: <83y47zxi81.fsf@HIDDEN> (Eli Zaretskii's message of "Wed, 27 Apr
 2016 17:02:38 +0300")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-NAI-Spam-Flag: NO
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 1 Rules triggered
	RV5655=0
X-NAI-Spam-Version: 2.3.0.9418 : core <5655> : inlines <4726> : streams
 <1626167> : uri <2197836>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 23386
Cc: 23386 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

>> % emacs -Q --eval "(push '(font-backend x) default-frame-alist)"
>> I get a segfault.  This is with the latest emacs-25.
> Not reproducible here, but then I cannot run an X version.  (I did try
> an equivalent for Windows; it didn't crash.)

Not surprised: it seems specific to the X11 code.

>> Program received signal SIGSEGV, Segmentation fault.
>> 0xf70b3b36 in XftCharIndex () from /usr/lib/i386-linux-gnu/libXft.so.2
>> (gdb) xbacktrace
>> (gdb) bt
>> #0  0xf70b3b36 in XftCharIndex () from /usr/lib/i386-linux-gnu/libXft.so.2
>> #1  0x082d4d69 in xftfont_encode_char (font=0x8779b00, c=92) at xftfont.c:537
> Can you tell which arguments to XftCharIndex were invalid in this
> case?

I guess it's the second arg (xftfont_info->xftfont), which is NULL.

    Program received signal SIGSEGV, Segmentation fault.
    0xf70b3b36 in XftCharIndex () from /usr/lib/i386-linux-gnu/libXft.so.2
    (gdb) up
    #1  0x082d4d69 in xftfont_encode_char (font=0x8779af0, c=92) at xftfont.c:537
    (gdb) p xftfont_info->display
    $1 = (Display *) 0x86f2368
    (gdb) p xftfont_info->xftfont
    $2 = (XftFont *) 0x0
    (gdb) p c
    $3 = 92
    (gdb)

> Also, is 'x' a valid font-backend symbol?

AFAIK yes.

> It's strange that Emacs uses xftfont when it should have been using
> xfont instead (AFAIU).

Indeed, that seems to be a big part of the problem.


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23386; Package emacs. Full text available.

Message received at 23386 <at> debbugs.gnu.org:


Received: (at 23386) by debbugs.gnu.org; 27 Apr 2016 14:03:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 27 10:03:09 2016
Received: from localhost ([127.0.0.1]:50149 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1avQ3V-00030G-Vx
	for submit <at> debbugs.gnu.org; Wed, 27 Apr 2016 10:03:09 -0400
Received: from eggs.gnu.org ([208.118.235.92]:37522)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1avQ3U-0002zl-SD
 for 23386 <at> debbugs.gnu.org; Wed, 27 Apr 2016 10:03:05 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1avQ3K-0005HP-1i
 for 23386 <at> debbugs.gnu.org; Wed, 27 Apr 2016 10:02:59 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49686)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1avQ3J-0005HL-VK; Wed, 27 Apr 2016 10:02:53 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2985
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1avQ3J-0005qs-4t; Wed, 27 Apr 2016 10:02:53 -0400
Date: Wed, 27 Apr 2016 17:02:38 +0300
Message-Id: <83y47zxi81.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-reply-to: <jwvlh3zfb45.fsf@HIDDEN> (message from Stefan Monnier
 on Wed, 27 Apr 2016 09:13:30 -0400)
Subject: Re: bug#23386: Segfault when messing with font-backend
References: <jwvlh3zfb45.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -6.0 (------)
X-Debbugs-Envelope-To: 23386
Cc: 23386 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

> From: Stefan Monnier <monnier@HIDDEN>
> Date: Wed, 27 Apr 2016 09:13:30 -0400
> 
> If I do
> 
>     % emacs -Q --eval "(push '(font-backend x) default-frame-alist)"
> 
> I get a segfault.  This is with the latest emacs-25.

Not reproducible here, but then I cannot run an X version.  (I did try
an equivalent for Windows; it didn't crash.)

> See the backtrace below.
> 
> 
>         Stefan
> 
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0xf70b3b36 in XftCharIndex () from /usr/lib/i386-linux-gnu/libXft.so.2
> (gdb) xbacktrace
> (gdb) bt
> #0  0xf70b3b36 in XftCharIndex () from /usr/lib/i386-linux-gnu/libXft.so.2
> #1  0x082d4d69 in xftfont_encode_char (font=0x8779b00, c=92) at xftfont.c:537

Can you tell which arguments to XftCharIndex were invalid in this
case?

Also, is 'x' a valid font-backend symbol?  It's strange that Emacs
uses xftfont when it should have been using xfont instead (AFAIU).
But I'm far from being an expert in this area.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23386; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 27 Apr 2016 13:13:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Apr 27 09:13:27 2016
Received: from localhost ([127.0.0.1]:49617 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1avPHT-0001ge-2U
	for submit <at> debbugs.gnu.org; Wed, 27 Apr 2016 09:13:27 -0400
Received: from eggs.gnu.org ([208.118.235.92]:52538)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1avPHR-0001gS-MG
 for submit <at> debbugs.gnu.org; Wed, 27 Apr 2016 09:13:26 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <monnier@HIDDEN>) id 1avPHH-0007rv-I6
 for submit <at> debbugs.gnu.org; Wed, 27 Apr 2016 09:13:20 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:56637)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <monnier@HIDDEN>) id 1avPHH-0007rp-Fy
 for submit <at> debbugs.gnu.org; Wed, 27 Apr 2016 09:13:15 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43487)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <monnier@HIDDEN>) id 1avPHB-0004qn-Q4
 for bug-gnu-emacs@HIDDEN; Wed, 27 Apr 2016 09:13:15 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <monnier@HIDDEN>) id 1avPH6-0007mN-QJ
 for bug-gnu-emacs@HIDDEN; Wed, 27 Apr 2016 09:13:09 -0400
Received: from pruche.dit.umontreal.ca ([132.204.246.22]:52429)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <monnier@HIDDEN>) id 1avPH6-0007kg-Jd
 for bug-gnu-emacs@HIDDEN; Wed, 27 Apr 2016 09:13:04 -0400
Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242])
 by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id u3RDD2WL012472
 for <bug-gnu-emacs@HIDDEN>; Wed, 27 Apr 2016 09:13:03 -0400
Received: by ceviche.home (Postfix, from userid 20848)
 id 68A5B661ED; Wed, 27 Apr 2016 09:13:30 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: Segfault when messing with font-backend
Date: Wed, 27 Apr 2016 09:13:30 -0400
Message-ID: <jwvlh3zfb45.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-NAI-Spam-Flag: NO
X-NAI-Spam-Level: 
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0.4
X-NAI-Spam-Rules: 3 Rules triggered BEC_TRC1=0.2, GEN_SPAM_FEATRE=0.2, RV5655=0
X-NAI-Spam-Version: 2.3.0.9418 : core <5655> : inlines <4724> : streams
 <1626142> : uri <2197794>
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

Package: Emacs
Version: 25.0.50


If I do

    % emacs -Q --eval "(push '(font-backend x) default-frame-alist)"

I get a segfault.  This is with the latest emacs-25.
See the backtrace below.


        Stefan


Program received signal SIGSEGV, Segmentation fault.
0xf70b3b36 in XftCharIndex () from /usr/lib/i386-linux-gnu/libXft.so.2
(gdb) xbacktrace
(gdb) bt
#0  0xf70b3b36 in XftCharIndex () from /usr/lib/i386-linux-gnu/libXft.so.2
#1  0x082d4d69 in xftfont_encode_char (font=0x8779b00, c=92) at xftfont.c:537
#2  0x08074145 in get_char_glyph_code (c=<optimized out>, 
    font=font@entry=0x8779b00, char2b=char2b@entry=0xffffbbbe)
    at xdisp.c:24681
#3  0x080bdbfd in x_produce_glyphs (it=0xffffbc08) at xdisp.c:27011
#4  0x0807d80c in produce_special_glyphs (it=it@entry=0xffffc718, 
    what=what@entry=IT_CONTINUATION) at xdisp.c:26643
#5  0x0809bcd6 in init_iterator (it=<optimized out>, w=<optimized out>, 
    charpos=<optimized out>, bytepos=<optimized out>, row=<optimized out>, 
    base_face_id=<optimized out>) at xdisp.c:2856
#6  0x080b0bb4 in resize_mini_window (w=0x8852930, exact_p=true)
    at xdisp.c:10970
#7  0x080b0fa9 in resize_mini_window_1 (a1=142944560, exactly=...)
    at xdisp.c:10912
#8  0x080828d4 in with_echo_area_buffer (w=0x8852930, which=which@entry=0, 
    fn=fn@entry=0x80b0f91 <resize_mini_window_1>, a1=142944560, a2=...)
    at xdisp.c:10642
#9  0x080b7082 in resize_echo_area_exactly () at xdisp.c:10890
#10 0x081ad0d6 in command_loop_1 () at keyboard.c:1274
#11 0x0823977d in internal_condition_case (bfun=0x81ad053 <command_loop_1>, 
    handlers=..., hfun=0x819da9e <cmd_error>) at eval.c:1309
#12 0x081963cd in command_loop_2 (ignore=...) at keyboard.c:1099
#13 0x082396f4 in internal_catch (tag=..., func=0x81963ac <command_loop_2>, 
    arg=...) at eval.c:1074
#14 0x0819635c in command_loop () at keyboard.c:1078
#15 0x0819d535 in recursive_edit_1 () at keyboard.c:684
#16 0x0819d9b9 in Frecursive_edit () at keyboard.c:755
#17 0x08195adc in main (argc=<optimized out>, argv=0xffffd514) at emacs.c:1605
(gdb) 




Acknowledgement sent to Stefan Monnier <monnier@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#23386; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 9 Jul 2016 19:15:01 UTC

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