[Fontconfig] Crash when non-existing directories are referenced in ~/.fonts.cache

Mike FABIAN mfabian at suse.de
Thu Jan 26 07:27:32 PST 2006


How to reproduce:

Delete global caches and ~/.fonts.cache-2:

    mfabian at magellan:~$ sudo rm -f /var/cache/fontconfig/*
    mfabian at magellan:~$ rm -f .fonts.cache*
    mfabian at magellan:~$

Create ~/.fonts.cache-2 again:

    mfabian at magellan:~$ time fc-match sans 
    hgjgbbmp.ttc: "HGPGothicB" "Regular"

    real	3m55.605s
    user	0m59.556s
    sys	0m2.912s
    mfabian at magellan:~$

Move one directory which has been added to ~/.fonts.cache-2 out
of the way:

    mfabian at magellan:~$ sudo mv /usr/share/fonts /tmp
    mfabian at magellan:~$

~/.fonts.cache-2 now contains references to a
non-existing directory:

    mfabian at magellan:~$ fc-cat .fonts.cache-2 | grep usr/share/fonts
    fc-cat: printing global cache contents for dir /usr/share/fonts/wine
    fc-cat: printing global cache contents for dir /usr/share/fonts/bdf
    fc-cat: printing global cache contents for dir /usr/share/fonts
    mfabian at magellan:~$ 

Try to use a fontconfig application, e.g. "fc-match":

    mfabian at magellan:~$ time fc-match sans
    セグメンテーション違反です (core dumped)

    real	0m16.670s
    user	0m0.024s
    sys	0m0.152s
    mfabian at magellan:~$ 

Crashes.

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



More information about the Fontconfig mailing list