John Ellson wrote:> What about this code in the .spec file of dejavu-fonts-1.15-2 ? > I can''t positively blame this package, but my font problems seemed to > start about the time I installed it.Hmm, this looks relatively harmless to me. But I''ll try installing a couple of fonts packages and seeing if this triggers the problem. Note that in Mathias Clasen''s tarball of broken caches, only the Japanese fonts had broken caches. This may or may not be relevant. pat
On Mon, 2005-10-31 at 10:13 -0500, Patrick Lam wrote:> I can''t reproduce the broken-cache problem on my computer, although I > can verify that the broken caches that other people send me are indeed > broken. I don''t know when this corruption is occuring; note that it > also throws out all the strings and langsets in the cache file. This > patch adds an assertion that will abort fc-cache when it''s trying to > write a corrupted cache file. If some of the people experiencing > corrupted caches could try this patch and tell me under what > circumstances corruption is happening, that would help a lot, because > I''m somewhat at a loss. >I have updated the rpm in Rawhide to todays cvs plus this patch. Matthias
Patrick Lam wrote:> I can''t reproduce the broken-cache problem on my computer, although I > can verify that the broken caches that other people send me are indeed > broken. I don''t know when this corruption is occuring; note that it > also throws out all the strings and langsets in the cache file. This > patch adds an assertion that will abort fc-cache when it''s trying to > write a corrupted cache file. If some of the people experiencing > corrupted caches could try this patch and tell me under what > circumstances corruption is happening, that would help a lot, because > I''m somewhat at a loss. > > Is there any chance that some other application (not fc-cache) is > modifying the fonts.cache-2 file? That would be weird and inexplicable. > Mail me if you have any ideas. > > pat >What about this code in the .spec file of dejavu-fonts-1.15-2 ? I can''t positively blame this package, but my font problems seemed to start about the time I installed it. ======from dejavu-fonts.spec===========================================%install /bin/rm -rf %{buildroot} #fonts install -d -m 0755 %{buildroot}%{fontdir} install -m 0644 *.ttf %{buildroot}%{fontdir} # "touch" all files we''ve got flagged as %ghost but which are not # present in the RPM_BUILD_ROOT when RPM looks for files /bin/touch %{buildroot}%{fontdir}/fonts.cache-1 /bin/touch %{buildroot}%{fontdir}/fonts.cache-2 %clean /bin/rm -rf %{buildroot} %post if [ -x %{_bindir}/fc-cache ]; then %{_bindir}/fc-cache %{_datadir}/fonts fi %postun if [ "$1" = "0" ]; then if [ -x %{_bindir}/fc-cache ]; then %{_bindir}/fc-cache %{_datadir}/fonts fi fi ==================================================== John
I can''t reproduce the broken-cache problem on my computer, although I can verify that the broken caches that other people send me are indeed broken. I don''t know when this corruption is occuring; note that it also throws out all the strings and langsets in the cache file. This patch adds an assertion that will abort fc-cache when it''s trying to write a corrupted cache file. If some of the people experiencing corrupted caches could try this patch and tell me under what circumstances corruption is happening, that would help a lot, because I''m somewhat at a loss. Is there any chance that some other application (not fc-cache) is modifying the fonts.cache-2 file? That would be weird and inexplicable. Mail me if you have any ideas. pat Index: src/fccache.c ==================================================================RCS file: /cvs/fontconfig/fontconfig/src/fccache.c,v retrieving revision 1.23.4.28 diff -u -r1.23.4.28 fccache.c --- src/fccache.c 21 Oct 2005 20:24:30 -0000 1.23.4.28 +++ src/fccache.c 31 Oct 2005 15:08:37 -0000 @@ -808,6 +808,8 @@ if (!FcFontSetSerialize (bank, set)) goto bail; + FcCharSetCrossCheck(bank); + return current_dir_block; bail: Index: src/fccharset.c ==================================================================RCS file: /cvs/fontconfig/fontconfig/src/fccharset.c,v retrieving revision 1.25.4.4 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 31 Oct 2005 15:08:37 -0000 @@ -1425,6 +1425,20 @@ return block_ptr; } +void +FcCharSetCrossCheck (int bank) +{ + int bi = FcCacheBankToIndex(bank); + int i; + + for (i = 0; i < charset_ptr; i++) + if (charsets[bi][i].ref != FC_REF_CONSTANT) + { + printf ("ERROR! BAD CHARSET! PLEASE INFORM plam@mit.edu!\n"); + abort(); + } +} + FcCharLeaf * FcCharSetGetLeaf(const FcCharSet *c, int i) { Index: src/fcint.h ==================================================================RCS file: /cvs/fontconfig/fontconfig/src/fcint.h,v retrieving revision 1.47.4.15 diff -u -r1.47.4.15 fcint.h --- src/fcint.h 22 Oct 2005 14:21:14 -0000 1.47.4.15 +++ src/fcint.h 31 Oct 2005 15:08:37 -0000 @@ -549,6 +549,9 @@ FcChar16 * FcCharSetGetNumbers(const FcCharSet *c); +void +FcCharSetCrossCheck (int bank); + /* fcdbg.c */ void FcValueListPrint (const FcValueListPtr l);