emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ftfont.c seg fault problem


From: Kenichi Handa
Subject: Re: [PATCH] ftfont.c seg fault problem
Date: Mon, 19 Jan 2009 21:13:29 +0900
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)

In article <address@hidden>, Lynbech Christian <address@hidden> 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
address@hidden

+++ 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 ();





reply via email to

[Prev in Thread] Current Thread [Next in Thread]