[Fontconfig] Re: fontconfig often crashes when there is something wrong with the cache files

Mike FABIAN mfabian at suse.de
Thu Oct 27 00:10:51 EST 2005


Patrick Lam <plam at MIT.EDU> さんは書きました:

> Hmm, let's put an assert there too.  Try this patch (to see if the cache
> files themselves are corrupted in a simple way) and tell me if you can
> make it abort.  I don't think that'll happen; I think the corruption is
> elsewhere.

Yes, with that patch I can make it abort:

mfabian at magellan:~$ xfd -fa sans
calling abort()
アボートしました (core dumped)
mfabian at magellan:~$ /usr/lib/qt3/bin/qtconfig
calling abort()
アボートしました (core dumped)
mfabian at magellan:~$ 

> diff -u -r1.25.4.4 fccharset.c
> --- src/fccharset.c     22 Sep 2005 23:45:53 -0000      1.25.4.4
> +++ src/fccharset.c     25 Oct 2005 14:46:42 -0000
> @@ -1406,6 +1406,7 @@
>  FcCharSetUnserialize (FcCache metadata, void *block_ptr)
>  {
>      int bi = FcCacheBankToIndex(metadata.bank);
> +    int i;
>      if (!FcCharSetEnsureBank(bi))
>         return 0;
>
> @@ -1422,6 +1423,10 @@
>      block_ptr = (void *)((char *)block_ptr +
>                      (sizeof(int) * metadata.charset_leaf_idx_count));
>
> +    for (i = 0; i < metadata.charset_count; i++)
> +        if (charsets[bi][i].ref != FC_REF_CONSTANT)
> +            abort();
> +
>      return block_ptr;
>  }
>
> pat
>

-- 
Mike FABIAN   <mfabian at suse.de>   http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵だ。




More information about the Fontconfig mailing list