From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Peter Jolly Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#3682: 23.1.50; segfault when font style begins with a number Date: Fri, 26 Jun 2009 01:00:09 +0100 (added by postmaster@woodbine.london.02.net) Message-ID: <13658.6081040607$1245991841@news.gmane.org> Reply-To: Peter Jolly , 3682@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1245991841 6183 80.91.229.12 (26 Jun 2009 04:50:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Jun 2009 04:50:41 +0000 (UTC) To: emacs-pretest-bug@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 26 06:50:33 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MK3OS-00035F-SW for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Jun 2009 06:50:33 +0200 Original-Received: from localhost ([127.0.0.1]:47065 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MK3OS-0008Bv-0U for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Jun 2009 00:50:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MJz8F-0004yZ-6J for bug-gnu-emacs@gnu.org; Thu, 25 Jun 2009 20:17:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MJz8A-0004vI-5G for bug-gnu-emacs@gnu.org; Thu, 25 Jun 2009 20:17:30 -0400 Original-Received: from [199.232.76.173] (port=58133 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MJz89-0004vA-Np for bug-gnu-emacs@gnu.org; Thu, 25 Jun 2009 20:17:25 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:54540) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MJz89-0002V3-Am for bug-gnu-emacs@gnu.org; Thu, 25 Jun 2009 20:17:25 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n5Q0HM6E010035; Thu, 25 Jun 2009 17:17:23 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n5Q0A6EV008594; Thu, 25 Jun 2009 17:10:06 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Peter Jolly Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 26 Jun 2009 00:10:05 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 3682 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.12459745216905 (code B ref -1); Fri, 26 Jun 2009 00:10:05 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 26 Jun 2009 00:02:01 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n5Q01twH006900 for ; Thu, 25 Jun 2009 17:01:57 -0700 Original-Received: from mx10.gnu.org ([199.232.76.166]:59232) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1MJyt8-0008Pz-V5 for emacs-pretest-bug@gnu.org; Thu, 25 Jun 2009 20:01:55 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1MJyt8-00066H-Kc for emacs-pretest-bug@gnu.org; Thu, 25 Jun 2009 20:01:54 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:27048) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MJyt7-0005ig-Qp for emacs-pretest-bug@gnu.org; Thu, 25 Jun 2009 20:01:53 -0400 Original-Received: from woodbine.london.02.net ([87.194.255.145]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MJysE-0001xD-72 for emacs-pretest-bug@gnu.org; Thu, 25 Jun 2009 20:00:58 -0400 Original-Received: from localhost (87.194.117.80) by woodbine.london.02.net (8.5.016.1) id 4A20329601B7D2EF for emacs-pretest-bug@gnu.org; Fri, 26 Jun 2009 01:00:09 +0100 X-Detected-Operating-System: by mx20.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Thu, 25 Jun 2009 20:17:30 -0400 X-Mailman-Approved-At: Fri, 26 Jun 2009 00:50:27 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:28981 gmane.emacs.pretest.bugs:24698 Archived-At: get_adstyle_property() in ftfont.c appears to extract the first whitespace-delimited word from a font's style string and pass it to font_intern_prop(). When this function is called from ftfont_list() -- at line 1028 in the current HEAD -- the return value is assumed to be either nil or a symbol. I have a font on my computer that has the style "55 Roman". For this font, get_adstyle_property() winds up returning an integer instead. ftfont_list() sticks this into SYMBOL_NAME() and promptly segfaults. The trivial patch below prevents the crash, but I don't understand the code well enough to tell whether it's the right solution. Maybe ftfont_list() should be handling the integer case instead. diff --git a/src/ftfont.c b/src/ftfont.c index 70c1797..789e6a7 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -177,7 +177,7 @@ get_adstyle_property (FcPattern *p) || xstrcasecmp (str, "Oblique") == 0 || xstrcasecmp (str, "Italic") == 0) return Qnil; - adstyle = font_intern_prop (str, end - str, 0); + adstyle = font_intern_prop (str, end - str, 1); if (font_style_to_value (FONT_WIDTH_INDEX, adstyle, 0) >= 0) return Qnil; return adstyle;