all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
To: Lynbech Christian <christian.lynbech@tieto.com>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] ftfont.c seg fault problem
Date: Mon, 19 Jan 2009 21:13:29 +0900	[thread overview]
Message-ID: <E1LOt0T-0006y8-H2@etlken.m17n.org> (raw)
In-Reply-To: <ytqptz7z8gvc.fsf@uw000184.eu.tieto.com> (message from Lynbech Christian on Fri, 16 Jan 2009 15:28:39 +0100)

In article <ytqptz7z8gvc.fsf@uw000184.eu.tieto.com>, Lynbech Christian <christian.lynbech@tieto.com> 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 ();





  reply	other threads:[~2009-01-19 12:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-16 14:28 [PATCH] ftfont.c seg fault problem Lynbech Christian
2009-01-19 12:13 ` Kenichi Handa [this message]
2009-01-20  7:54   ` Lynbech Christian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1LOt0T-0006y8-H2@etlken.m17n.org \
    --to=handa@m17n.org \
    --cc=christian.lynbech@tieto.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.