From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lynbech Christian Newsgroups: gmane.emacs.devel Subject: [PATCH] ftfont.c seg fault problem Date: Fri, 16 Jan 2009 15:28:39 +0100 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1232119852 11186 80.91.229.12 (16 Jan 2009 15:30:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 Jan 2009 15:30:52 +0000 (UTC) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 16 16:32:04 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 1LNqfk-0001i1-Mi for ged-emacs-devel@m.gmane.org; Fri, 16 Jan 2009 16:31:48 +0100 Original-Received: from localhost ([127.0.0.1]:37151 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LNqeT-0004yI-Tj for ged-emacs-devel@m.gmane.org; Fri, 16 Jan 2009 10:30:29 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LNqBy-0005DT-Gv for emacs-devel@gnu.org; Fri, 16 Jan 2009 10:01:02 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LNqBx-0005CY-Oc for emacs-devel@gnu.org; Fri, 16 Jan 2009 10:01:02 -0500 Original-Received: from [199.232.76.173] (port=53720 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LNqBx-0005CJ-EM for emacs-devel@gnu.org; Fri, 16 Jan 2009 10:01:01 -0500 Original-Received: from mail1.tieto.com ([194.110.47.24]:1319 helo=tietoe03.tietoenator.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LNqBw-0002dZ-Uy for emacs-devel@gnu.org; Fri, 16 Jan 2009 10:01:01 -0500 X-AuditID: c26e2f18-000017ac00000510-f9-497099df3daf Original-Received: from stingray.eu.tieto.com ([192.176.143.13]) by tietoe03.tietoenator.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 16 Jan 2009 16:29:50 +0200 Original-Received: from uw000184.eu.tieto.com ([10.48.99.39]) by stingray.eu.tieto.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 16 Jan 2009 15:28:49 +0100 User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux) X-OriginalArrivalTime: 16 Jan 2009 14:28:49.0968 (UTC) FILETIME=[BFBB5B00:01C977E6] X-Brightmail-Tracker: AAAAAA== X-detected-operating-system: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ X-Greylist: delayed 1924 seconds by postgrey-1.27 at monty-python; Fri, 16 Jan 2009 10:00:58 EST X-Mailman-Approved-At: Fri, 16 Jan 2009 10:30:04 -0500 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:107902 Archived-At: --=-=-= 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. More information can be provided if you like. -- Christian --=-=-= Content-Type: text/x-csrc Content-Disposition: inline; filename*=us-ascii''diff%3aftfont.c Index: ftfont.c =================================================================== --- ftfont.c (revision 1405) +++ ftfont.c (working copy) @@ -311,8 +311,9 @@ 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->fonts && + (FcPatternGetCharSet (fontset->fonts[0], FC_CHARSET, 0, &charset) + == FcResultMatch)) cache_data->fc_charset = FcCharSetCopy (charset); else cache_data->fc_charset = FcCharSetCreate (); --=-=-= ------------------------+----------------------------------------------------- Christian Lynbech | christian #\@ defun #\. dk ------------------------+----------------------------------------------------- Hit the philistines three times over the head with the Elisp reference manual. - petonic@hal.com (Michael A. Petonic) --=-=-=--