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

Mike FABIAN mfabian at suse.de
Tue Oct 25 23:09:55 EST 2005


For details see:

http://bugzilla.novell.com/show_bug.cgi?id=128080

This bugreport also has a backtrace attached (comment #10).

Until now I don't know a easy way to reproduce the problem, it occurs
"sometimes" and goes away by calling "fc-cache -f" as root.
I.e. I guess there is something wrong with the cache files.

I have started debugging this but until now I only found that
it crashes in fccharset.c in

    FcCharSet *
    FcCharSetCopy (FcCharSet *src)
    {
        if (src->ref != FC_REF_CONSTANT)
            src->ref++;
        return src;
    }


when src->ref happens to be 0 (which is != FC_REF_CONSTANT)
and then tries to execute

    src->ref++;

which won't work because "src" is v.u.c where v is of type FcValue and
FcCharSet is "const" in that union (fontconfig.h), therefore it cannot
be incremented:

    typedef struct _FcValue {
        FcType	type;
        union {
            const FcChar8  *s;
            int             s_off;
            int		i;
            FcBool		b;
            double		d;
            const FcMatrix  *m;
            const FcCharSet *c;
            int		c_off;
            void		*f;
            const FcPattern	*p;
            const FcLangSet *l;
            int		l_off; // this is a difference of char *s
        } u;
    } FcValue;


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




More information about the Fontconfig mailing list