all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] ftfont.c seg fault problem
@ 2009-01-16 14:28 Lynbech Christian
  2009-01-19 12:13 ` Kenichi Handa
  0 siblings, 1 reply; 3+ messages in thread
From: Lynbech Christian @ 2009-01-16 14:28 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1009 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: diff:ftfont.c --]
[-- Type: text/x-csrc, Size: 645 bytes --]

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

[-- Attachment #3: Type: text/plain, Size: 371 bytes --]



------------------------+-----------------------------------------------------
Christian Lynbech       | christian #\@ defun #\. dk
------------------------+-----------------------------------------------------
Hit the philistines three times over the head with the Elisp reference manual.
                                        - petonic@hal.com (Michael A. Petonic)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-01-20  7:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-16 14:28 [PATCH] ftfont.c seg fault problem Lynbech Christian
2009-01-19 12:13 ` Kenichi Handa
2009-01-20  7:54   ` Lynbech Christian

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.