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

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

 



Patrick Lam <plam@xxxxxxx> ????????:

> 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@magellan:~$ xfd -fa sans
calling abort()
???????? (core dumped)
mfabian@magellan:~$ /usr/lib/qt3/bin/qtconfig
calling abort()
???????? (core dumped)
mfabian@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@xxxxxxx>   http://www.suse.de/~mfabian
?????????????



[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux