From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] ftfont.c seg fault problem Date: Mon, 19 Jan 2009 21:13:29 +0900 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1232367234 29598 80.91.229.12 (19 Jan 2009 12:13:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 19 Jan 2009 12:13:54 +0000 (UTC) Cc: emacs-devel@gnu.org To: Lynbech Christian Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 19 13:15:07 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LOt21-0005lJ-GP for ged-emacs-devel@m.gmane.org; Mon, 19 Jan 2009 13:15:06 +0100 Original-Received: from localhost ([127.0.0.1]:38737 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LOt0k-0004Im-78 for ged-emacs-devel@m.gmane.org; Mon, 19 Jan 2009 07:13:46 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LOt0f-0004Gw-Ba for emacs-devel@gnu.org; Mon, 19 Jan 2009 07:13:41 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LOt0b-00046m-2f for emacs-devel@gnu.org; Mon, 19 Jan 2009 07:13:40 -0500 Original-Received: from [199.232.76.173] (port=55710 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LOt0a-00046Y-UQ for emacs-devel@gnu.org; Mon, 19 Jan 2009 07:13:36 -0500 Original-Received: from mx1.aist.go.jp ([150.29.246.133]:45965) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LOt0a-0001eB-7g for emacs-devel@gnu.org; Mon, 19 Jan 2009 07:13:36 -0500 Original-Received: from rqsmtp1.aist.go.jp (rqsmtp1.aist.go.jp [150.29.254.115]) by mx1.aist.go.jp with ESMTP id n0JCDW8Z023038; Mon, 19 Jan 2009 21:13:32 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp3.aist.go.jp by rqsmtp1.aist.go.jp with ESMTP id n0JCDWe6026394; Mon, 19 Jan 2009 21:13:32 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp3.aist.go.jp with ESMTP id n0JCDTQG013502; Mon, 19 Jan 2009 21:13:29 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken.m17n.org with local (Exim 4.69) (envelope-from ) id 1LOt0T-0006y8-H2; Mon, 19 Jan 2009 21:13:29 +0900 In-reply-to: (message from Lynbech Christian on Fri, 16 Jan 2009 15:28:39 +0100) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-detected-operating-system: by monty-python.gnu.org: Solaris 9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:107991 Archived-At: In article , Lynbech Christian writes: > I have had a number of problems with recent updates of emacs 23 > segmentation faulting on me when trying to use the font backend and > antialiased fonts. > I am unsure exactly what is causing the problem. It works fine when I > compile it on a rather freshly updated debian system but the problem > hits when trying to build and run on my primary workstation which is a > SuSE SLED 10 SP1 system with some additional software installed. In > particular this system doesn't really have gtk+ 2.0 and fontconfig > claims to be version 2.3.94 and I am enabling the font backend and is > trying to use fancy anti-aliased fonts. > The problem hits in src/ftfont.c (ftfont_lookup_cache). The attached > patch seems to alleviate the problem, at least to the point where emacs > stops segmentation faulting. Even if the problem ultimately is a > unfortunate combination of old libraries, I believe the patch is > innocent enough to warrant inclusion. Thank you for the report. It seems to be a bug of fontconfig, but, as checking the return value of FcFontList has no problem, I installed a slightly modified patch as attached (i.e. there's no merit of having xassert here). By the way, you wrote "a number of problems". What else do you observe? --- Kenichi Handa handa@m17n.org +++ ftfont.c 19 Jan 2009 12:07:32 -0000 1.43 @@ -310,9 +310,10 @@ FC_INDEX, FcTypeInteger, index, NULL); objset = FcObjectSetBuild (FC_CHARSET, NULL); fontset = FcFontList (NULL, pat, objset); - xassert (fontset && fontset->nfont > 0); - if (FcPatternGetCharSet (fontset->fonts[0], FC_CHARSET, 0, &charset) - == FcResultMatch) + if (fontset && fontset->nfont > 0 + && (FcPatternGetCharSet (fontset->fonts[0], FC_CHARSET, 0, + &charset) + == FcResultMatch)) cache_data->fc_charset = FcCharSetCopy (charset); else cache_data->fc_charset = FcCharSetCreate ();