From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: owner@emacsbugs.donarmstrong.com (Emacs bug Tracking System) Newsgroups: gmane.emacs.bugs Subject: bug#3682: marked as done (23.1.50; segfault when font style begins with a number) Date: Fri, 26 Jun 2009 06:25:09 +0000 Message-ID: References: <4A20329601B7D2EF@> (added by postmaster@woodbine.london.02.net) NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----------=_1245997509-7026-0" X-Trace: ger.gmane.org 1245998269 19609 80.91.229.12 (26 Jun 2009 06:37:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Jun 2009 06:37:49 +0000 (UTC) To: Kenichi Handa Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 26 08:37:42 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 1MK548-0006UV-KX for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Jun 2009 08:37:42 +0200 Original-Received: from localhost ([127.0.0.1]:60205 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MK547-0000ej-Vw for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Jun 2009 02:37:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MK542-0000cd-8D for bug-gnu-emacs@gnu.org; Fri, 26 Jun 2009 02:37:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MK53x-0000WB-KV for bug-gnu-emacs@gnu.org; Fri, 26 Jun 2009 02:37:33 -0400 Original-Received: from [199.232.76.173] (port=55935 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MK53x-0000W1-Fy for bug-gnu-emacs@gnu.org; Fri, 26 Jun 2009 02:37:29 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:38653) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MK53w-0006kv-B8 for bug-gnu-emacs@gnu.org; Fri, 26 Jun 2009 02:37:28 -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 n5Q6bMdE009059; Thu, 25 Jun 2009 23:37:25 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n5Q6PAxw007083; Thu, 25 Jun 2009 23:25:10 -0700 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: closed 3682 X-Emacs-PR-Package: emacs X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:28983 Archived-At: This is a multi-part message in MIME format... ------------=_1245997509-7026-0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Your message dated Fri, 26 Jun 2009 15:17:48 +0900 with message-id and subject line Re: bug#3682: 23.1.50; segfault when font style begins wit= h a number has caused the Emacs bug report #3682, regarding 23.1.50; segfault when font style begins with a number to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com immediately.) --=20 3682: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3D3682 Emacs Bug Tracking System Contact owner@emacsbugs.donarmstrong.com with problems ------------=_1245997509-7026-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 26 Jun 2009 00:02:01 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: * X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=1.1 required=4.0 tests=FOURLA,IMPRONONCABLE_2, MURPHY_DRUGS_REL8 autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 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 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 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 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 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 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 Date: Fri, 26 Jun 2009 01:00:09 +0100 (added by postmaster@woodbine.london.02.net) Message-ID: <4A20329601B7D2EF@> (added by postmaster@woodbine.london.02.net) From: Peter Jolly To: emacs-pretest-bug@gnu.org Subject: 23.1.50; segfault when font style begins with a number 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) 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; ------------=_1245997509-7026-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 3682-done) by emacsbugs.donarmstrong.com; 26 Jun 2009 06:17:56 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.9 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER, IMPRONONCABLE_2,MURPHY_DRUGS_REL8,SPF_HELO_PASS autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mx1.aist.go.jp (mx1.aist.go.jp [150.29.246.133]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n5Q6Hp6p006083 for <3682-done@emacsbugs.donarmstrong.com>; Thu, 25 Jun 2009 23:17:52 -0700 Received: from rqsmtp1.aist.go.jp (rqsmtp1.aist.go.jp [150.29.254.115]) by mx1.aist.go.jp with ESMTP id n5Q6Hnkg023984; Fri, 26 Jun 2009 15:17:49 +0900 (JST) env-from (handa@m17n.org) Received: from smtp1.aist.go.jp by rqsmtp1.aist.go.jp with ESMTP id n5Q6HmGq016243; Fri, 26 Jun 2009 15:17:48 +0900 (JST) env-from (handa@m17n.org) Received: by smtp1.aist.go.jp with ESMTP id n5Q6HmlS017354; Fri, 26 Jun 2009 15:17:48 +0900 (JST) env-from (handa@m17n.org) Received: from handa by etlken with local (Exim 4.69) (envelope-from ) id 1MK4ku-0007Ey-8h; Fri, 26 Jun 2009 15:17:48 +0900 From: Kenichi Handa To: Peter Jolly , 3682-done@emacsbugs.donarmstrong.com In-reply-to: <4A20329601B7D2EF@> (added by postmaster@woodbine.london.02.net) (message from Peter Jolly on Fri, 26 Jun 2009 01:00:09 +0100 (added by postmaster@woodbine.london.02.net)) Subject: Re: bug#3682: 23.1.50; segfault when font style begins with a number References: <4A20329601B7D2EF@> (added by postmaster@woodbine.london.02.net) Message-Id: Date: Fri, 26 Jun 2009 15:17:48 +0900 In article <4A20329601B7D2EF@> (added by postmaster@woodbine.london.02.net), Peter Jolly writes: > 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. Thank you for the report. Your patch is correct. I've just installed it to EMACS_23_1_RC and trunk. --- Kenichi Handa handa@m17n.org > 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; ------------=_1245997509-7026-0--