[Fontconfig] Re: weird crash with fontconfig 2.3.92
Mike FABIAN
mfabian at suse.de
Thu Jan 5 03:06:32 PST 2006
Mike FABIAN <mfabian at suse.de> さんは書きました:
> Mike FABIAN <mfabian at suse.de> さんは書きました:
>
>> mfabian at magellan:~$ fc-match "foo:\\_\\_DUMMY\\_\\_=1"
>> Segmentation fault (core dumped)
>> mfabian at magellan:~$
>>
>> occurs with fontconfig 2.4 CVS branch checked out on December 6th 2005.
Still happens with fontconfig 2.3.93.20060103 (2.4 CVS branch checked
out yesterday).
Dirk Müller and me both made a patch to fix the problem. Dirk already
posted his patch to the fontconfig mailing list a while ago, but this
mail never arrived. Therefore I attach both my and Dirk's patch here
again.
I am not sure which patch is better, both fix the crash but the
behaviour is different.
With Dirk's patch:
mfabian at magellan:~$ fc-match "Luxi Mono:\\_\\_DUMMY\\_\\_=1"
hgjgbbmp.ttc: "HGPGothicB" "Regular"
mfabian at magellan:~$ fc-match "Luxi Mono"
luximr.ttf: "Luxi Mono" "Regular"
mfabian at magellan:~$ fc-match sans
hgjgbbmp.ttc: "HGPGothicB" "Regular"
mfabian at magellan:~$
I.e. with Dirk's patch the complete pattern is ignored when it
contains __DUMMY__ and a new empty pattern is created which gives the
same result as when trying to match "sans".
With my patch:
mfabian at magellan:~$ fc-match "Luxi Mono:\\_\\_DUMMY\\_\\_=1"
luximr.ttf: "Luxi Mono" "Regular"
mfabian at magellan:~$ fc-match "Luxi Mono"
luximr.ttf: "Luxi Mono" "Regular"
mfabian at magellan:~$ fc-match sans
hgjgbbmp.ttc: "HGPGothicB" "Regular"
mfabian at magellan:~$
only __DUMMY__ is ignored, the rest of the pattern is used.
I.e. with my patch it behaves the same way as if I add
other junk into the pattern like:
mfabian at magellan:~$ fc-match "Luxi Mono:nonsense=1"
luximr.ttf: "Luxi Mono" "Regular"
mfabian at magellan:~$
Here "nonsense=1" is ignored as well.
I still don't know for what purpose this __DUMMY__ in fcname.c line 33
has been introduced.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dummy-crash.patch
Type: text/x-patch
Size: 518 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20060105/821c6d8c/dummy-crash.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dummy-crash-dirk-mueller.patch
Type: text/x-patch
Size: 482 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20060105/821c6d8c/dummy-crash-dirk-mueller.bin
-------------- next part --------------
--
Mike FABIAN <mfabian at suse.de> http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵だ。
More information about the Fontconfig
mailing list