Around 14 o'clock on Sep 25, "David F. Newman" wrote:

> I was building fontconfig for Solaris because KDE now looks for it.
> However, I ran it again and it core dumped with a bus error.

Can you try this patch please?
Index: fcpat.c
===================================================================
RCS file: /home/x-cvs/xc/lib/fontconfig/src/fcpat.c,v
retrieving revision 1.16
diff -u -r1.16 fcpat.c
--- fcpat.c     31 Aug 2002 22:17:32 -0000      1.16
+++ fcpat.c     25 Sep 2002 19:00:46 -0000
@@ -1,5 +1,5 @@
 /*
- * $XFree86: xc/lib/fontconfig/src/fcpat.c,v 1.15 2002/08/22 07:36:45 keithp Exp $
+ * $XFree86: xc/lib/fontconfig/src/fcpat.c,v 1.16 2002/08/31 22:17:32 keithp Exp $
  *
  * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
  *
@@ -280,6 +280,11 @@
     FcValueList            *list;
 };
 
+typedef union _FcValueListAlign {
+    FcValueListEnt  ent;
+    FcValueList            list;
+} FcValueListAlign;
+
 static int         FcValueListFrozenCount[FcTypeLangSet + 1];
 static int         FcValueListFrozenBytes[FcTypeLangSet + 1];
 static char        *FcValueListFrozenName[] = {
@@ -312,6 +317,7 @@
 static FcValueListEnt *
 FcValueListEntCreate (FcValueList *h)
 {
+    FcValueListAlign   *ea;
     FcValueListEnt  *e;
     FcValueList            *l, *new;
     int                    n;
@@ -326,14 +332,15 @@
            string_size += strlen ((char *) l->value.u.s) + 1;
        n++;
     }
-    size = sizeof (FcValueListEnt) + n * sizeof (FcValueList) + string_size;
+    size = sizeof (FcValueListAlign) + n * sizeof (FcValueList) + string_size;
     FcValueListFrozenCount[h->value.type]++;
     FcValueListFrozenBytes[h->value.type] += size;
-    e = malloc (size);
-    if (!e)
+    ea = malloc (size);
+    if (!ea)
        return 0;
     FcMemAlloc (FC_MEM_VALLIST, size);
-    e->list = (FcValueList *) (e + 1);
+    e = &ea->ent;
+    e->list = (FcValueList *) (ea + 1);
     strs = (FcChar8 *) (e->list + n);
     new = e->list;
     for (l = h; l; l = l->next)

Reply via email to