Frederic Crozat
2006-Jan-30 02:48 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Hi, I''d like to put a little status about the various cache bugs I''ve (and other on the list) been encountering. This is against CVS snapshot from today 2006-01-30 : * fc-cache . bug => FIXED * fc-cache /foo/bar vs fc-cache /foo/bar/ => FIXED * fc-cat crashes on ~/.fonts.cache-2 file or on global cache files => FIXED * ~/.fonts.cache-2 file being re-created when ~/.fonts exist each time a fontconfig based application is still there. * fc-cat ~/.fonts-cache-2 now returns empty information. Once the ~/.fonts.cache-2 recreation bug is fixed, it would be probably a good idea to push a 2.3.94 release so it is more tested by people not living with CVS snapshots ;) -- Frederic Crozat <fcrozat@mandriva.com> Mandriva
Patrick Lam
2006-Jan-30 08:37 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Frederic Crozat wrote:> Hi, > > I''d like to put a little status about the various cache bugs I''ve (and > other on the list) been encountering. > > This is against CVS snapshot from today 2006-01-30 : > > * fc-cache . bug => FIXED > * fc-cache /foo/bar vs fc-cache /foo/bar/ => FIXED > * fc-cat crashes on ~/.fonts.cache-2 file or on global cache files => > FIXED > * ~/.fonts.cache-2 file being re-created when ~/.fonts exist each time a > fontconfig based application is still there. > * fc-cat ~/.fonts-cache-2 now returns empty information. > > Once the ~/.fonts.cache-2 recreation bug is fixed, it would be probably > a good idea to push a 2.3.94 release so it is more tested by people not > living with CVS snapshots ;)Thanks. Let''s see if current CVS is kind of stable and then I''ll push 2.3.94. Also there''s that make distcheck problem on my laptop (it works fine on my desktop) which I don''t know how to fix. pat
Matthias Clasen
2006-Jan-30 08:47 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
On Mon, 2006-01-30 at 11:40 -0500, Patrick Lam wrote:> Frederic Crozat wrote: > > Hi, > > > > I''d like to put a little status about the various cache bugs I''ve (and > > other on the list) been encountering. > > > > This is against CVS snapshot from today 2006-01-30 : > > > > * fc-cache . bug => FIXED > > * fc-cache /foo/bar vs fc-cache /foo/bar/ => FIXED > > * fc-cat crashes on ~/.fonts.cache-2 file or on global cache files => > > FIXED > > * ~/.fonts.cache-2 file being re-created when ~/.fonts exist each time a > > fontconfig based application is still there. > > * fc-cat ~/.fonts-cache-2 now returns empty information. > > > > Once the ~/.fonts.cache-2 recreation bug is fixed, it would be probably > > a good idea to push a 2.3.94 release so it is more tested by people not > > living with CVS snapshots ;) > > Thanks. Let''s see if current CVS is kind of stable and then I''ll push > 2.3.94. Also there''s that make distcheck problem on my laptop (it works > fine on my desktop) which I don''t know how to fix.Current cvs fails make check: make[2]: Entering directory `/work/gtk210/cvs/fontconfig/test'' *** Test failed: Subdir with a cache file *** output is in ''out'', expected output in ''out.expected'' FAIL: run-test.sh ==================1 of 1 tests failed ===================
Frederic Crozat
2006-Jan-30 09:03 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Le lundi 30 janvier 2006 ? 11:40 -0500, Patrick Lam a ?crit :> Frederic Crozat wrote: > > Hi, > > > > I''d like to put a little status about the various cache bugs I''ve (and > > other on the list) been encountering. > > > > This is against CVS snapshot from today 2006-01-30 : > > > > * fc-cache . bug => FIXED > > * fc-cache /foo/bar vs fc-cache /foo/bar/ => FIXED > > * fc-cat crashes on ~/.fonts.cache-2 file or on global cache files => > > FIXED > > * ~/.fonts.cache-2 file being re-created when ~/.fonts exist each time a > > fontconfig based application is still there. > > * fc-cat ~/.fonts-cache-2 now returns empty information. > > > > Once the ~/.fonts.cache-2 recreation bug is fixed, it would be probably > > a good idea to push a 2.3.94 release so it is more tested by people not > > living with CVS snapshots ;) > > Thanks. Let''s see if current CVS is kind of stable and then I''ll push > 2.3.94. Also there''s that make distcheck problem on my laptop (it works > fine on my desktop) which I don''t know how to fix.Status update with refreshed CVS snapshot (15min ago) : ~/.fonts.cache-2 created each time an application is started when ~/.fonts exist => FIXED fc-cat ~/.fonts.cache-2 returns empty informations => FIXED And I haven''t see any regression about the other bug I mentioned in my previous post. As Matthias noted, "make check" now fails. -- Frederic Crozat <fcrozat@mandriva.com> Mandriva
Frederic Crozat
2006-Jan-31 01:43 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Le lundi 30 janvier 2006 ? 18:06 +0100, Frederic Crozat a ?crit :> Le lundi 30 janvier 2006 ? 11:40 -0500, Patrick Lam a ?crit : > > Frederic Crozat wrote: > > > Hi, > > > > > > I''d like to put a little status about the various cache bugs I''ve (and > > > other on the list) been encountering. > > > > > > This is against CVS snapshot from today 2006-01-30 : > > > > > > * fc-cache . bug => FIXED > > > * fc-cache /foo/bar vs fc-cache /foo/bar/ => FIXED > > > * fc-cat crashes on ~/.fonts.cache-2 file or on global cache files => > > > FIXED > > > * ~/.fonts.cache-2 file being re-created when ~/.fonts exist each time a > > > fontconfig based application is still there. > > > * fc-cat ~/.fonts-cache-2 now returns empty information. > > > > > > Once the ~/.fonts.cache-2 recreation bug is fixed, it would be probably > > > a good idea to push a 2.3.94 release so it is more tested by people not > > > living with CVS snapshots ;) > > > > Thanks. Let''s see if current CVS is kind of stable and then I''ll push > > 2.3.94. Also there''s that make distcheck problem on my laptop (it works > > fine on my desktop) which I don''t know how to fix. > > Status update with refreshed CVS snapshot (15min ago) : > > ~/.fonts.cache-2 created each time an application is started when > ~/.fonts exist => FIXED > fc-cat ~/.fonts.cache-2 returns empty informations => FIXED > > And I haven''t see any regression about the other bug I mentioned in my > previous post. > > As Matthias noted, "make check" now fails.Status update with CVS snapshot 20050131 (10:44 CET) * make check fails => FIXED No regression found on my side. I''ve just pushed it in Mandriva cooker to see if many people start screaming ;) -- Frederic Crozat <fcrozat@mandriva.com> Mandriva
Matthias Clasen
2006-Jan-31 05:40 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
On Tue, 2006-01-31 at 10:45 +0100, Frederic Crozat wrote:> > As Matthias noted, "make check" now fails. > > Status update with CVS snapshot 20050131 (10:44 CET) > * make check fails => FIXED > > No regression found on my side. > > I''ve just pushed it in Mandriva cooker to see if many people start > screaming ;)Ok, make check is indeed fixed. But I still see the oszillating global cache, and the charset field still contains garbage in fc-cat output. I''m going to push this version into rawhide, and see how it fares. Matthias
Patrick Lam
2006-Jan-31 07:54 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Matthias Clasen wrote:> On Tue, 2006-01-31 at 10:45 +0100, Frederic Crozat wrote: > >>>As Matthias noted, "make check" now fails. >> >>Status update with CVS snapshot 20050131 (10:44 CET) >>* make check fails => FIXED >> >>No regression found on my side. >> >>I''ve just pushed it in Mandriva cooker to see if many people start >>screaming ;) > > > Ok, make check is indeed fixed. But I still see the oszillating global > cache, and the charset field still contains garbage in fc-cat output. > > I''m going to push this version into rawhide, and see how it fares.Can you send me a broken cache? Also, I thought that blowing away the global cache should stop the oscillation... I also thought that the patch I committed should blow away broken caches in general. pat
Matthias Clasen
2006-Jan-31 10:50 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
On Tue, 2006-01-31 at 10:57 -0500, Patrick Lam wrote:> Matthias Clasen wrote: > > On Tue, 2006-01-31 at 10:45 +0100, Frederic Crozat wrote: > > > >>>As Matthias noted, "make check" now fails. > >> > >>Status update with CVS snapshot 20050131 (10:44 CET) > >>* make check fails => FIXED > >> > >>No regression found on my side. > >> > >>I''ve just pushed it in Mandriva cooker to see if many people start > >>screaming ;) > > > > > > Ok, make check is indeed fixed. But I still see the oszillating global > > cache, and the charset field still contains garbage in fc-cat output. > > > > I''m going to push this version into rawhide, and see how it fares. > > Can you send me a broken cache? Also, I thought that blowing away the > global cache should stop the oscillation... I also thought that the > patch I committed should blow away broken caches in general.Will do. I noticed that running fc-cache as user does not update or recreate directory cache files in $HOME/.fonts, although I do have ~/.fonts in fonts.conf. Explicitly running fc-cache $HOME/.fonts does, though. Once the caches in $HOME/.fonts were updated, fc-list : stopped creating the global cache. Matthias
Patrick Lam
2006-Jan-31 11:13 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Matthias Clasen wrote:> I noticed that running fc-cache as user does not update or recreate > directory cache files in $HOME/.fonts, although I do have ~/.fonts in > fonts.conf. Explicitly running fc-cache $HOME/.fonts does, though.So I noticed this behaviour: 1. sudo fc-cache 2. get /var/cache/fontconfig cache for $HOME/.fonts which is owned by root; fc-cache as user then cannot remove /var/cache/fontconfig cache (eek) 3. fc-cache as user fails to remove /var/cache/fontconfig cache for .fonts, but updates the .fonts directory, so that the /var/cache/fontconfig cache is now stale. 4. fc-cache as user then succeeds. If there is no /var/cache/fontconfig cache for $HOME/.fonts then everything should be fine.> Once the caches in $HOME/.fonts were updated, fc-list : stopped creating > the global cache.Right, there should be no need to do so. pat
Patrick Lam
2006-Jan-31 11:34 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Matthias Clasen wrote:> Ok, make check is indeed fixed. But I still see the oszillating global > cache, and the charset field still contains garbage in fc-cat output.While it may look like garbage, it''s not new; go look at the fonts.cache-1 output from previous versions of fontconfig. Apparently that''s what charsets look like. There is a difference between my fonts.cache-1 and what we get now in the languages; fontconfig now produces fi and vot in the lang field (for me). In another mail, you mentioned that the global cache is always recreated when you touch $HOME/.fonts subdirectories. If you''re not running fc-cache again after touching $HOME/.fonts, then the global cache must be recreated, since it''s now older than the fonts directories and therefore is no longer an accurate cache of those fonts directories. pat
Frederic Crozat
2006-Feb-02 01:50 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Le mardi 31 janvier 2006 ? 10:45 +0100, Frederic Crozat a ?crit :> Le lundi 30 janvier 2006 ? 18:06 +0100, Frederic Crozat a ?crit : > > Le lundi 30 janvier 2006 ? 11:40 -0500, Patrick Lam a ?crit : > > > Frederic Crozat wrote: > > > > Hi, > > > > > > > > I''d like to put a little status about the various cache bugs I''ve (and > > > > other on the list) been encountering. > > > > > > > > This is against CVS snapshot from today 2006-01-30 : > > > > > > > > * fc-cache . bug => FIXED > > > > * fc-cache /foo/bar vs fc-cache /foo/bar/ => FIXED > > > > * fc-cat crashes on ~/.fonts.cache-2 file or on global cache files => > > > > FIXED > > > > * ~/.fonts.cache-2 file being re-created when ~/.fonts exist each time a > > > > fontconfig based application is still there. > > > > * fc-cat ~/.fonts-cache-2 now returns empty information. > > > > > > > > Once the ~/.fonts.cache-2 recreation bug is fixed, it would be probably > > > > a good idea to push a 2.3.94 release so it is more tested by people not > > > > living with CVS snapshots ;) > > > > > > Thanks. Let''s see if current CVS is kind of stable and then I''ll push > > > 2.3.94. Also there''s that make distcheck problem on my laptop (it works > > > fine on my desktop) which I don''t know how to fix. > > > > Status update with refreshed CVS snapshot (15min ago) : > > > > ~/.fonts.cache-2 created each time an application is started when > > ~/.fonts exist => FIXED > > fc-cat ~/.fonts.cache-2 returns empty informations => FIXED > > > > And I haven''t see any regression about the other bug I mentioned in my > > previous post. > > > > As Matthias noted, "make check" now fails. > > Status update with CVS snapshot 20050131 (10:44 CET) > * make check fails => FIXED > > No regression found on my side. > > I''ve just pushed it in Mandriva cooker to see if many people start > screaming ;)Well, just to let you know : cooker folks are screaming a lot :( Many seems to have an old ~/.fonts.cache-2 file which get in the way to force a entire cache regeneration for each application start. I haven''t been able to spot the problem precisely yet. -- Frederic Crozat <fcrozat@mandriva.com> Mandriva
Frederic Crozat
2006-Feb-07 03:01 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Le lundi 06 f?vrier 2006 ? 21:39 -0500, Patrick Lam a ?crit :> Frederic Crozat wrote: > > Well, just to let you know : cooker folks are screaming a lot :( > > > > Many seems to have an old ~/.fonts.cache-2 file which get in the way to > > force a entire cache regeneration for each application start. > > > > I haven''t been able to spot the problem precisely yet. > > Any news? fontconfig should now erase bad global cache files, so it > should only happen once...I can confirm fontconfig erases bad global cache files. But I found a way to cause fontconfig to never update cache correctly with the following test case : -clean your cache completely : rm -f /var/cache/fontconfig/* -run fc-cache -v to get a consistent cache -put the attached old fonts.cache-2 (before cache was moved to /var/cache/fontconfig) in /usr/share/fonts/ttf/big5 -run fc-cache -v => cache is updated for this directory -run fc-cache -v again => cache is updated AGAIN for this directory and is growing (check in /var/cache/fontconfig..) -remove fonts.cache-2 from the directory -run fc-cache -v several time : each time, cache is updated and grow. I''ve attached the file to put in big5 directory as well as the broken cache which is generated in /var/cache/fontconfig and the good one. This problem is not visible when using non-root applications because missing cache will be stored in ~/.fonts.cache-2 and won''t get updated. -- Frederic Crozat <fcrozat@mandriva.com> Mandriva -------------- next part -------------- A non-text attachment was scrubbed... Name: 93fda0347a9e5f7f83a65e7b634cda03.cache-2.ko Type: application/octet-stream Size: 40960 bytes Desc: not available Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20060207/f748a5b8/93fda0347a9e5f7f83a65e7b634cda03.cache-2-0002.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: 93fda0347a9e5f7f83a65e7b634cda03.cache-2.ok Type: application/octet-stream Size: 12288 bytes Desc: not available Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20060207/f748a5b8/93fda0347a9e5f7f83a65e7b634cda03.cache-2-0003.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: fonts.cache-2.big5 Type: application/octet-stream Size: 28672 bytes Desc: not available Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20060207/f748a5b8/fonts.cache-2-0001.obj
Frederic Crozat
2006-Feb-08 00:49 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Le mardi 07 f?vrier 2006 ? 16:12 -0500, Patrick Lam a ?crit :> Frederic Crozat wrote: > > I can confirm fontconfig erases bad global cache files. > > > > But I found a way to cause fontconfig to never update cache correctly > > with the following test case : > > -clean your cache completely : rm -f /var/cache/fontconfig/* > > -run fc-cache -v to get a consistent cache > > -put the attached old fonts.cache-2 (before cache was moved > > to /var/cache/fontconfig) in /usr/share/fonts/ttf/big5 > > -run fc-cache -v => cache is updated for this directory > > -run fc-cache -v again => cache is updated AGAIN for this directory and > > is growing (check in /var/cache/fontconfig..) > > -remove fonts.cache-2 from the directory > > -run fc-cache -v several time : each time, cache is updated and grow. > > > > I''ve attached the file to put in big5 directory as well as the broken > > cache which is generated in /var/cache/fontconfig and the good one. > > > > This problem is not visible when using non-root applications because > > missing cache will be stored in ~/.fonts.cache-2 and won''t get updated. > > Debian doesn''t seem to package any ttf big5 fonts. Can you send me the > contents of the big5 directory or put them up somewhere?This font is available on ftp://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/official/2006.0/i586/media/main/fonts-ttf-big5-1.3.0-1mdk.noarch.rpm If you want other huge fonts files, I suggest you try too : ftp://ftp.free.fr/pub/Distributions_Linux/MandrivaLinux/official/2006.0/i586/media/main/fonts-ttf-chinese-1.3.0-1mdk.noarch.rpm since it takes several seconds for fc-cache to cache it. -- Frederic Crozat <fcrozat@mandriva.com> Mandriva
Patrick Lam
2006-Feb-09 08:19 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Frederic Crozat wrote:> Le mardi 07 f?vrier 2006 ? 16:12 -0500, Patrick Lam a ?crit : > >>Frederic Crozat wrote: >> >>>I can confirm fontconfig erases bad global cache files. >>> >>>But I found a way to cause fontconfig to never update cache correctly >>>with the following test case : >>>-clean your cache completely : rm -f /var/cache/fontconfig/* >>>-run fc-cache -v to get a consistent cache >>>-put the attached old fonts.cache-2 (before cache was moved >>>to /var/cache/fontconfig) in /usr/share/fonts/ttf/big5 >>>-run fc-cache -v => cache is updated for this directory >>>-run fc-cache -v again => cache is updated AGAIN for this directory and >>>is growing (check in /var/cache/fontconfig..) >>>-remove fonts.cache-2 from the directory >>>-run fc-cache -v several time : each time, cache is updated and grow. >>> >>>I''ve attached the file to put in big5 directory as well as the broken >>>cache which is generated in /var/cache/fontconfig and the good one. >>> >>>This problem is not visible when using non-root applications because >>>missing cache will be stored in ~/.fonts.cache-2 and won''t get updated.I''ve reproduced, and I think I''ve fixed, this problem in CVS. Please confirm. pat
Frederic Crozat
2006-Feb-09 09:06 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Le jeudi 09 f?vrier 2006 ? 11:23 -0500, Patrick Lam a ?crit :> Frederic Crozat wrote: > > Le mardi 07 f?vrier 2006 ? 16:12 -0500, Patrick Lam a ?crit : > > > >>Frederic Crozat wrote: > >> > >>>I can confirm fontconfig erases bad global cache files. > >>> > >>>But I found a way to cause fontconfig to never update cache correctly > >>>with the following test case : > >>>-clean your cache completely : rm -f /var/cache/fontconfig/* > >>>-run fc-cache -v to get a consistent cache > >>>-put the attached old fonts.cache-2 (before cache was moved > >>>to /var/cache/fontconfig) in /usr/share/fonts/ttf/big5 > >>>-run fc-cache -v => cache is updated for this directory > >>>-run fc-cache -v again => cache is updated AGAIN for this directory and > >>>is growing (check in /var/cache/fontconfig..) > >>>-remove fonts.cache-2 from the directory > >>>-run fc-cache -v several time : each time, cache is updated and grow. > >>> > >>>I''ve attached the file to put in big5 directory as well as the broken > >>>cache which is generated in /var/cache/fontconfig and the good one. > >>> > >>>This problem is not visible when using non-root applications because > >>>missing cache will be stored in ~/.fonts.cache-2 and won''t get updated. > > I''ve reproduced, and I think I''ve fixed, this problem in CVS. Please > confirm.Cache always growing problem is fixed. But old fonts.cache-2 file in the file system (not in /var/cache/fontconfig) is not removed when running fc-cache and running fc-cache several times still update cache in /var/cache/fontconfig. -- Frederic Crozat <fcrozat@mandriva.com> Mandriva
Patrick Lam
2006-Feb-09 10:35 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Frederic Crozat wrote:> But old fonts.cache-2 file in the file system (not > in /var/cache/fontconfig) is not removed when running fc-cache and > running fc-cache several times still update cache > in /var/cache/fontconfig.I''m not quite sure what the correct solution is in this case. Any ideas? pat
Frederic Crozat
2006-Feb-15 02:25 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Le jeudi 09 f?vrier 2006 ? 13:39 -0500, Patrick Lam a ?crit :> Frederic Crozat wrote: > > But old fonts.cache-2 file in the file system (not > > in /var/cache/fontconfig) is not removed when running fc-cache and > > running fc-cache several times still update cache > > in /var/cache/fontconfig. > > I''m not quite sure what the correct solution is in this case. Any ideas?Hmm, I thought the problem would be fixed by patch from Takashi preferring /var/cache/fontconfig files instead of the one in directory but it still isn''t. Running fc-cache several times still generate recreate cache in /var/cache/fontconfig. I guess there is still some side effect somewhere.. -- Frederic Crozat <fcrozat@mandriva.com> Mandriva
Matthias Clasen
2006-Feb-15 05:58 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
On Wed, 2006-02-15 at 11:28 +0100, Frederic Crozat wrote:> Le jeudi 09 f?vrier 2006 ? 13:39 -0500, Patrick Lam a ?crit : > > Frederic Crozat wrote: > > > But old fonts.cache-2 file in the file system (not > > > in /var/cache/fontconfig) is not removed when running fc-cache and > > > running fc-cache several times still update cache > > > in /var/cache/fontconfig. > > > > I''m not quite sure what the correct solution is in this case. Any ideas? > > Hmm, I thought the problem would be fixed by patch from Takashi > preferring /var/cache/fontconfig files instead of the one in directory > but it still isn''t. > > Running fc-cache several times still generate recreate cache > in /var/cache/fontconfig. > > I guess there is still some side effect somewhere..Could the problem be that the fonts.cache-2 file in the font dir is mistaken for a font ? Matthias
Frederic Crozat
2006-Feb-15 09:12 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Le mercredi 15 f?vrier 2006 ? 09:01 -0500, Matthias Clasen a ?crit :> On Wed, 2006-02-15 at 11:28 +0100, Frederic Crozat wrote: > > Le jeudi 09 f?vrier 2006 ? 13:39 -0500, Patrick Lam a ?crit : > > > Frederic Crozat wrote: > > > > But old fonts.cache-2 file in the file system (not > > > > in /var/cache/fontconfig) is not removed when running fc-cache and > > > > running fc-cache several times still update cache > > > > in /var/cache/fontconfig. > > > > > > I''m not quite sure what the correct solution is in this case. Any ideas? > > > > Hmm, I thought the problem would be fixed by patch from Takashi > > preferring /var/cache/fontconfig files instead of the one in directory > > but it still isn''t. > > > > Running fc-cache several times still generate recreate cache > > in /var/cache/fontconfig. > > > > I guess there is still some side effect somewhere.. > > Could the problem be that the fonts.cache-2 file in the font dir > is mistaken for a font ?No, I''ve added some debug code and fonts.cache-2 is not detected as a font file. Moreover, if it was, cache would be generated only one time and it wouldn''t be detected as dirty each time fc-cache is started.. -- Frederic Crozat <fcrozat@mandriva.com> Mandriva
Patrick Lam
2006-Feb-15 23:14 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Patrick Lam wrote:> Here''s a bug that probably already exists in 2.3.2 but is only important > now: if you mount /usr as read-only, then fc-cache skips generating > caches in /var since it thinks it doesn''t have access to /usr and won''t > be able to generate caches.I''ve now fixed this bug. I also think I fixed the other bug about fc-cache repeatedly updating cache files. Could someone please test the behaviour of fc-cache on multi-arch systems? pat
Frederic Crozat
2006-Feb-16 05:01 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Le jeudi 16 f?vrier 2006 ? 01:27 -0500, Patrick Lam a ?crit :> Frederic Crozat wrote: > > Le jeudi 09 f?vrier 2006 ? 13:39 -0500, Patrick Lam a ?crit : > > > >>Frederic Crozat wrote: > >> > >>>But old fonts.cache-2 file in the file system (not > >>>in /var/cache/fontconfig) is not removed when running fc-cache and > >>>running fc-cache several times still update cache > >>>in /var/cache/fontconfig. > > > > Hmm, I thought the problem would be fixed by patch from Takashi > > preferring /var/cache/fontconfig files instead of the one in directory > > but it still isn''t. > > The code removes the fonts.cache-2 file in the directory and then the > hashed cache file, and I''ve confirmed this behaviour. I''ve committed an > additional patch which makes it not bail if it sees a fonts.cache-2 and > fails to remove it; this is sort of inconvenient, but fontconfig can > live with it.Well, I''ve just tested here with today CVS snapshot and /usr/share/fonts/ttf/big5/fonts.cache-2 is never removed, when running fc-cache or fc-cache -f :( (and /usr is not read-only). I''ve checked fc-cache.c code a little more : FcDirCacheUnlink is only called when FcDirCacheValid is false. Unfortunately, in my case, cache in /var/cache/fontconfig is always valid, so FcDirCacheValid returns always TRUE and therefore FcDirCacheUnlink is not called and doesn''t remove the old cache in /usr/share/fonts/ttf/big5/. And this "bug" seems even documented in FcDirCacheValid : * Also, this can be fooled if the original location has a stale * cache, and the hashed location has an up-to-date cache. Oh well, * sucks to be you in that case! */ I think we should try to really nail that bug, otherwise people will end with unstable cache behaviour. Maybe adding a "--remove-obsolete-cache" option to fc-cache to remove fonts.cache-2 outside /var/cache/fontconfig would be a solution (and it could remove fonts.cache-1 too if we want ;)> Here''s a bug that probably already exists in 2.3.2 but is only important > now: if you mount /usr as read-only, then fc-cache skips generating > caches in /var since it thinks it doesn''t have access to /usr and won''t > be able to generate caches. > > > Running fc-cache several times still generate recreate cache > > in /var/cache/fontconfig. > > > > I guess there is still some side effect somewhere.. > > I can''t trigger this part of the bug. For me it erases the > fonts.cache-2 file, or triggers the bug I mentioned above.I hope my hints helped you understanding my problem (and your fix for the /usr read-only bug didn''t fix my bug..). PS : be careful when replying, your initial reply wasn''t sent to the list. -- Frederic Crozat <fcrozat@mandriva.com> Mandriva
Patrick Lam
2006-Feb-16 07:17 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Frederic Crozat wrote:> Well, I''ve just tested here with today CVS snapshot > and /usr/share/fonts/ttf/big5/fonts.cache-2 is never removed, when > running fc-cache or fc-cache -f :( (and /usr is not read-only).But if there''s a valid cache, then fontconfig shouldn''t be generating a new cache? I''m confused about how this bug arises. This situation results in cache removal: 1. rm /var/cache/fontconfig/* 2. fc-cache 3. touch /usr/share/fonts/truetype/ttf-bitstream-vera/fonts.cache-2 4. fc-cache If in step 3 instead you copy the appropriate file from /var/cache to /usr/share/fonts/truetype/ttf-bitstream-vera/fonts.cache-2, then it also deletes the cache in /usr/share/fonts/truetype/ttf-bitstream-vera/fonts.cache-2.> I think we should try to really nail that bug, otherwise people will end > with unstable cache behaviour. Maybe adding a "--remove-obsolete-cache" > option to fc-cache to remove fonts.cache-2 outside /var/cache/fontconfig > would be a solution (and it could remove fonts.cache-1 too if we want ;)I''ll add --really-force which will remove all existing cache-2 files. I don''t see a reason to remove fonts.cache-1 files, though. pat
Patrick Lam
2006-Feb-16 07:40 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Frederic Crozat wrote:> I think we should try to really nail that bug, otherwise people will end > with unstable cache behaviour. Maybe adding a "--remove-obsolete-cache" > option to fc-cache to remove fonts.cache-2 outside /var/cache/fontconfig > would be a solution (and it could remove fonts.cache-1 too if we want ;)fc-cache -r|--really-force will now blow away all old caches unconditionally. FcDirCacheUnlink will actually remove both the cache in /var/cache and in the original directory; always has. pat
Frederic Crozat
2006-Feb-16 07:41 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Le jeudi 16 f?vrier 2006 ? 10:18 -0500, Patrick Lam a ?crit :> Frederic Crozat wrote: > > Well, I''ve just tested here with today CVS snapshot > > and /usr/share/fonts/ttf/big5/fonts.cache-2 is never removed, when > > running fc-cache or fc-cache -f :( (and /usr is not read-only). > > But if there''s a valid cache, then fontconfig shouldn''t be generating a > new cache? I''m confused about how this bug arises. This situation > results in cache removal: > > 1. rm /var/cache/fontconfig/* > 2. fc-cache > 3. touch /usr/share/fonts/truetype/ttf-bitstream-vera/fonts.cache-2 > 4. fc-cache > > If in step 3 instead you copy the appropriate file from /var/cache to > /usr/share/fonts/truetype/ttf-bitstream-vera/fonts.cache-2, then it also > deletes the cache in > /usr/share/fonts/truetype/ttf-bitstream-vera/fonts.cache-2.On my test case, cache was created with fontconfig 2.3.92 (ie before the switch to /var/cache/fontconfig). Since fonts didn''t change, cache "might" look valid but I doubt it does since cache format has changed since 2.3.92 ..> > I think we should try to really nail that bug, otherwise people will end > > with unstable cache behaviour. Maybe adding a "--remove-obsolete-cache" > > option to fc-cache to remove fonts.cache-2 outside /var/cache/fontconfig > > would be a solution (and it could remove fonts.cache-1 too if we want ;) > > I''ll add --really-force which will remove all existing cache-2 files. I > don''t see a reason to remove fonts.cache-1 files, though.Thanks. I was thinking removing fonts.cache-1 might be a good idea for people who will migrate to 2.4.0 (when it is released) so old cache don''t stay on harddrive. But it might be a problem if directories are used with programs using fontconfig 2.2.x and 2.4.x at the same time. -- Frederic Crozat <fcrozat@mandriva.com> Mandriva
Patrick Lam
2006-Feb-16 09:51 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Frederic Crozat wrote:> On my test case, cache was created with fontconfig 2.3.92 (ie before the > switch to /var/cache/fontconfig). Since fonts didn''t change, cache > "might" look valid but I doubt it does since cache format has changed > since 2.3.92 ..I haven''t tried such a cache. But I did change something in FcDirCacheHasCurrentArch so that it''ll properly detect changes in MAGIC now. It might also fix your problem. Let me know if it helps.> Thanks. I was thinking removing fonts.cache-1 might be a good idea for > people who will migrate to 2.4.0 (when it is released) so old cache > don''t stay on harddrive. But it might be a problem if directories are > used with programs using fontconfig 2.2.x and 2.4.x at the same time.It''s totally valid to have fontconfig 2.2 at the same time on some machines that mount the same filesystem, so I guess that we should not remove fonts.cache-1 files. pat
Frederic Crozat
2006-Feb-17 06:03 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Le jeudi 16 f?vrier 2006 ? 12:54 -0500, Patrick Lam a ?crit :> Frederic Crozat wrote: > > On my test case, cache was created with fontconfig 2.3.92 (ie before the > > switch to /var/cache/fontconfig). Since fonts didn''t change, cache > > "might" look valid but I doubt it does since cache format has changed > > since 2.3.92 .. > > I haven''t tried such a cache. But I did change something in > FcDirCacheHasCurrentArch so that it''ll properly detect changes in MAGIC > now. It might also fix your problem. Let me know if it helps.Not really, now it crashes when starting fc-cache -v : Program received signal SIGSEGV, Segmentation fault. 0xb7f86c8a in FcCharSetSerialize (bank=1278151997, c=0xb7fc8bfc) at fccharset.c:1427 1427 memcpy (&leaves[bi][charset_leaf_ptr++], (gdb) bt #0 0xb7f86c8a in FcCharSetSerialize (bank=1278151997, c=0xb7fc8bfc) at fccharset.c:1427 #1 0xb7f95a77 in FcValueListSerialize (bank=1278151997, pi=0xb7fc5e9c) at fcpat.c:1808 #2 0xb7f9ab02 in FcPatternSerialize (bank=1278151997, old=0xb7fc4004) at fcpat.c:1621 #3 0xb7f8d812 in FcFontSetSerialize (bank=1278151997, s=0x80573d8) at fcfs.c:144 #4 0xb7f7fdc2 in FcDirCacheProduce (set=0x80573d8, metadata=0xbfde311c) at fccache.c:1209 #5 0xb7f80478 in FcDirCacheWrite (set=0x80573d8, dirs=0x804b190, dir=Variable "dir" is not available. ) at fccache.c:1271 #6 0xb7f89d1b in FcDirSave (set=0x0, dirs=0x0, dir=0x0) at fcdir.c:223 #7 0x08048ffc in scanDirs (list=0x804e038, config=0x804b008, program=0xbfde39a3 "/usr/bin/fc-cache", force=0, really_force=0, verbose=1) at fc-cache.c:241 #8 0x0804905f in scanDirs (list=0x804e048, config=0x804b008, program=0xbfde39a3 "/usr/bin/fc-cache", force=0, really_force=0, verbose=1) at fc-cache.c:259 #9 0x0804905f in scanDirs (list=0x804dff8, config=0x804b008, program=0xbfde39a3 "/usr/bin/fc-cache", force=0, really_force=0, verbose=1) at fc-cache.c:259 #10 0x08049602 in main (argc=2, argv=0xbfde3424) at fc-cache.c:351 #11 0xb7c7be40 in __libc_start_main () from /lib/tls/libc.so.6 #12 0x08048cf1 in _start () at ../sysdeps/i386/elf/start.S:119> > Thanks. I was thinking removing fonts.cache-1 might be a good idea for > > people who will migrate to 2.4.0 (when it is released) so old cache > > don''t stay on harddrive. But it might be a problem if directories are > > used with programs using fontconfig 2.2.x and 2.4.x at the same time. > > It''s totally valid to have fontconfig 2.2 at the same time on some > machines that mount the same filesystem, so I guess that we should not > remove fonts.cache-1 files.Ok, it was just an idea to clean people harddrive when needed ;) -- Frederic Crozat <fcrozat@mandriva.com> Mandriva
Patrick Lam
2006-Feb-17 06:51 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Frederic Crozat wrote:> Not really, now it crashes when starting fc-cache -v :That''s probably due to the change in cache file format without a change in MAGIC. I''ve now bumped up MAGIC to 0xFC02FC03. Your fontconfig shouldn''t crash anymore. pat
Frederic Crozat
2006-Feb-17 07:14 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Le vendredi 17 f?vrier 2006 ? 09:48 -0500, Patrick Lam a ?crit :> Frederic Crozat wrote: > > Not really, now it crashes when starting fc-cache -v : > > That''s probably due to the change in cache file format without a change > in MAGIC. I''ve now bumped up MAGIC to 0xFC02FC03. Your fontconfig > shouldn''t crash anymore.Well, it still does with updated code (same stack). -- Frederic Crozat <fcrozat@mandriva.com> Mandriva
Patrick Lam
2006-Feb-17 07:19 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Frederic Crozat wrote:> Le vendredi 17 f?vrier 2006 ? 09:48 -0500, Patrick Lam a ?crit : > >>Frederic Crozat wrote: >> >>>Not really, now it crashes when starting fc-cache -v : >> >>That''s probably due to the change in cache file format without a change >>in MAGIC. I''ve now bumped up MAGIC to 0xFC02FC03. Your fontconfig >>shouldn''t crash anymore. > > Well, it still does with updated code (same stack).What if you blow away the cache files? pat
Frederic Crozat
2006-Feb-17 07:38 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Le vendredi 17 f?vrier 2006 ? 10:22 -0500, Patrick Lam a ?crit :> Frederic Crozat wrote: > > Le vendredi 17 f?vrier 2006 ? 09:48 -0500, Patrick Lam a ?crit : > > > >>Frederic Crozat wrote: > >> > >>>Not really, now it crashes when starting fc-cache -v : > >> > >>That''s probably due to the change in cache file format without a change > >>in MAGIC. I''ve now bumped up MAGIC to 0xFC02FC03. Your fontconfig > >>shouldn''t crash anymore. > > > > Well, it still does with updated code (same stack). > > What if you blow away the cache files?If I remove the affected cache, fc-cache is able to update cache for this directory and crashes on one of the next directory :) I''ve attached the offending file (be careful, it is renamed). -- Frederic Crozat <fcrozat@mandriva.com> Mandriva -------------- next part -------------- A non-text attachment was scrubbed... Name: c974e4c60d201a21112df444ab73ef55.cache-2.crash Type: application/octet-stream Size: 40960 bytes Desc: not available Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20060217/05ad557b/c974e4c60d201a21112df444ab73ef55.cache-2-0001.obj
Patrick Lam
2006-Feb-17 08:28 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Frederic Crozat wrote:> If I remove the affected cache, fc-cache is able to update cache for > this directory and crashes on one of the next directory :) > > I''ve attached the offending file (be careful, it is renamed).This cache has the new magic. How odd. 000000c0 65 31 2f 61 64 6f 62 65 73 74 64 33 35 00 00 *03* 000000d0 *fc* *02* *fc* 1e 8e 00 00 9e 9e b1 53 23 00 00 00 ee (That''s 03 fc 02 fc, which is what 0xfc02fc03 looks like when you write it.) Are you sure that''s an old cache? It looks like a new cache to me, so that perhaps you have mixed versions of fontconfig. My fontconfig crashes when you give it this file, but it should: it has the new MAGIC and an old format. There doesn''t seem to be any other explanation aside from mixed versions. fontconfig definitely bails on caches with wrong MAGIC now. pat
Mike FABIAN
2006-Feb-17 09:02 UTC
[Fontconfig] Re: Status about fontconfig CVS regarding cache handling
Frederic Crozat <fcrozat@mandriva.com> ????????:> Le vendredi 17 f?vrier 2006 ? 10:22 -0500, Patrick Lam a ?crit : >> Frederic Crozat wrote: >> > Le vendredi 17 f?vrier 2006 ? 09:48 -0500, Patrick Lam a ?crit : >> > >> >>Frederic Crozat wrote: >> >> >> >>>Not really, now it crashes when starting fc-cache -v : >> >> >> >>That''s probably due to the change in cache file format without a change >> >>in MAGIC. I''ve now bumped up MAGIC to 0xFC02FC03. Your fontconfig >> >>shouldn''t crash anymore. >> > >> > Well, it still does with updated code (same stack). >> >> What if you blow away the cache files? > > If I remove the affected cache, fc-cache is able to update cache for > this directory and crashes on one of the next directory :) > > I''ve attached the offending file (be careful, it is renamed).I see the same crashes Frederic sees with the same backtrace. I can easily reproduce it like this (as root): root@magellan:~# rm -f /var/cache/fontconfig/* ~/.fonts.cache-2 root@magellan:~# fc-cache -v fc-cache: "/usr/share/fonts": caching, 0 fonts, 3 dirs fc-cache: "/usr/share/fonts/bdf": caching, 0 fonts, 0 dirs fc-cache: "/usr/share/fonts": skipping, looped directory detected fc-cache: "/usr/share/fonts/wine": caching, 1 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts": caching, 0 fonts, 24 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/japanese": caching, 30 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/Speedo": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/URW": caching, 59 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/Type1": caching, 59 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/truetype": caching, 939 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/misc": caching, 190 fonts, 1 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/misc/sgi": caching, 35 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/75dpi": caching, 398 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID": caching, 0 fonts, 5 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID/Adobe-Japan1": caching, 0 fonts, 4 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID/Adobe-Japan1/AFM": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID/Adobe-Japan1/CFM": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID/Adobe-Japan1/CIDFont": caching, 4 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID/Adobe-Japan1/CMap": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID/Adobe-Japan2": caching, 0 fonts, 4 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID/Adobe-Japan2/AFM": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID/Adobe-Japan2/CFM": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID/Adobe-Japan2/CIDFont": caching, 2 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID/Adobe-Japan2/CMap": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID/Adobe-Korea1": caching, 0 fonts, 4 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID/Adobe-Korea1/AFM": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID/Adobe-Korea1/CFM": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID/Adobe-Korea1/CIDFont": caching, 9 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID/Adobe-Korea1/CMap": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID/Adobe-CNS1": caching, 0 fonts, 4 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID/Adobe-CNS1/AFM": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID/Adobe-CNS1/CFM": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID/Adobe-CNS1/CIDFont": caching, 2 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID/Adobe-CNS1/CMap": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID/Adobe-GB1": caching, 0 fonts, 4 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID/Adobe-GB1/AFM": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID/Adobe-GB1/CFM": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID/Adobe-GB1/CIDFont": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/CID/Adobe-GB1/CMap": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/encodings": caching, 0 fonts, 1 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/encodings/large": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/local": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/util": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/uni": caching, 2 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/baekmuk": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/ucs": caching, 0 fonts, 1 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/ucs/misc": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/hellas": caching, 0 fonts, 4 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/hellas/100dpi": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/hellas/75dpi": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/hellas/Type1": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/hellas/misc": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/latin7": caching, 0 fonts, 1 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/latin7/75dpi": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/100dpi": caching, 398 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/cyrillic": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/latin2": caching, 0 fonts, 2 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/latin2/Type1": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/latin2/misc": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/test": caching, 220 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/xtest": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/Adobe": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/officebib": caching, 11 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/latin5": caching, 0 fonts, 3 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/latin5/100dpi": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/latin5/75dpi": caching, 0 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/latin5/misc": caching, 0 fonts, 0 dirs fc-cache: "/opt/kde3/share/fonts": caching, 1 fonts, 1 dirs fc-cache: "/opt/kde3/share/fonts/override": caching, 0 fonts, 0 dirs fc-cache: "/usr/local/share/fonts": skipping, no such directory fc-cache: "/root/.fonts": skipping, no such directory fc-cache: "/root/.fonts/kde-override": skipping, no such directory fc-cache: "/usr/lib/ooo-2.0/share/fonts": caching, 0 fonts, 1 dirs fc-cache: "/usr/lib/ooo-2.0/share/fonts/truetype": caching, 1 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/Acrobat7/Resource/Font": caching, 16 fonts, 1 dirs fc-cache: "/usr/X11R6/lib/Acrobat7/Resource/Font/PFM": caching, 0 fonts, 0 dirs fc-cache: succeeded root@magellan:~# fc-cache -v fc-cache: "/usr/share/fonts": caching, 0 fonts, 3 dirs fc-cache: "/usr/share/fonts/bdf": caching, 0 fonts, 0 dirs fc-cache: "/usr/share/fonts": skipping, looped directory detected fc-cache: "/usr/share/fonts/wine": caching, 1 fonts, 0 dirs fc-cache: "/usr/X11R6/lib/X11/fonts": caching, 0 fonts, 24 dirs fc-cache: "/usr/X11R6/lib/X11/fonts/japanese": caching, 30 fonts, 0 dirs ????????????? (core dumped) root@magellan:~# I.e. when running "fc-cache -v" the second time, it dumps core. Of course the magic numbers in the cache files are correct already, they are all 0xFC02FC03 (latest CVS). Note that during the second run of "fc-cache -v" it always writes "caching" instead of "skipping" to standard output. I.e. it doesn''t seem to notice that the cache files are already up-to-date. -- Mike FABIAN <mfabian@suse.de> http://www.suse.de/~mfabian ?????????????
Frederic Crozat
2006-Feb-17 09:29 UTC
[Fontconfig] Status about fontconfig CVS regarding cache handling
Le vendredi 17 f?vrier 2006 ? 11:31 -0500, Patrick Lam a ?crit :> Frederic Crozat wrote: > > If I remove the affected cache, fc-cache is able to update cache for > > this directory and crashes on one of the next directory :) > > > > I''ve attached the offending file (be careful, it is renamed). > > This cache has the new magic. How odd. > > 000000c0 65 31 2f 61 64 6f 62 65 73 74 64 33 35 00 00 *03* > 000000d0 *fc* *02* *fc* 1e 8e 00 00 9e 9e b1 53 23 00 00 00 ee > > (That''s 03 fc 02 fc, which is what 0xfc02fc03 looks like when you write it.) > > Are you sure that''s an old cache? It looks like a new cache to me, so > that perhaps you have mixed versions of fontconfig. My fontconfig > crashes when you give it this file, but it should: it has the new MAGIC > and an old format. > > There doesn''t seem to be any other explanation aside from mixed > versions. fontconfig definitely bails on caches with wrong MAGIC now.The bug is probably triggered because I''m using packages : cache are first regenerated using fc-cache -f (in the package) which doesn''t seem to crash. but if I run fc-cache -v after that, it crashes.. -- Frederic Crozat <fcrozat@mandriva.com> Mandriva
Mike FABIAN
2006-Feb-17 09:31 UTC
[Fontconfig] Re: Status about fontconfig CVS regarding cache handling
Mike FABIAN <mfabian@suse.de> ????????:> Frederic Crozat <fcrozat@mandriva.com> ????????: > >> Le vendredi 17 f?vrier 2006 ? 10:22 -0500, Patrick Lam a ?crit : >>> Frederic Crozat wrote: >>> > Le vendredi 17 f?vrier 2006 ? 09:48 -0500, Patrick Lam a ?crit : >>> > >>> >>Frederic Crozat wrote: >>> >> >>> >>>Not really, now it crashes when starting fc-cache -v : >>> >> >>> >>That''s probably due to the change in cache file format without a change >>> >>in MAGIC. I''ve now bumped up MAGIC to 0xFC02FC03. Your fontconfig >>> >>shouldn''t crash anymore. >>> > >>> > Well, it still does with updated code (same stack). >>> >>> What if you blow away the cache files? >> >> If I remove the affected cache, fc-cache is able to update cache for >> this directory and crashes on one of the next directory :) >> >> I''ve attached the offending file (be careful, it is renamed). > > I see the same crashes Frederic sees with the same backtrace. > > I can easily reproduce it like this (as root): > > root@magellan:~# rm -f /var/cache/fontconfig/* ~/.fonts.cache-2 > root@magellan:~# fc-cache -v > fc-cache: "/usr/share/fonts": caching, 0 fonts, 3 dirs[...]> fc-cache: "/usr/X11R6/lib/Acrobat7/Resource/Font/PFM": caching, 0 fonts, 0 dirs > fc-cache: succeeded > root@magellan:~# fc-cache -v > fc-cache: "/usr/share/fonts": caching, 0 fonts, 3 dirs > fc-cache: "/usr/share/fonts/bdf": caching, 0 fonts, 0 dirs > fc-cache: "/usr/share/fonts": skipping, looped directory detected > fc-cache: "/usr/share/fonts/wine": caching, 1 fonts, 0 dirs > fc-cache: "/usr/X11R6/lib/X11/fonts": caching, 0 fonts, 24 dirs > fc-cache: "/usr/X11R6/lib/X11/fonts/japanese": caching, 30 fonts, 0 dirs > ????????????? (core dumped) > root@magellan:~# > > I.e. when running "fc-cache -v" the second time, it dumps core. > Of course the magic numbers in the cache files are correct already, > they are all 0xFC02FC03 (latest CVS). > > Note that during the second run of "fc-cache -v" it always writes > "caching" instead of "skipping" to standard output. I.e. it doesn''t > seem to notice that the cache files are already up-to-date.In gdb I see that FcDirCacheHasCurrentArch () always returns FcFalse. In the following piece of code from FcDirCacheHasCurrentArch (): if (read(fd, &metadata, sizeof(FcCache)) != sizeof(FcCache)) { close (fd); return FcFalse; } if (metadata.magic != FC_CACHE_MAGIC) { close (fd); return FcFalse; } it seems to read complete junk into "metadata", gdb shows me: (gdb) p/x metadata $9 = {magic = 0x7273752f, count = 0x6168732f, bank = 0x662f6572, pattern_count = 0x73746e6f, patternelt_count = 0x6664622f, valuelist_count = 0x73752f00, str_count = 0x68732f72, langset_count = 0x2f657261, charset_count = 0x746e6f66, charset_numbers_count = 0x74742f73, charset_leaf_count = 0x752f0074, charset_leaf_idx_count = 0x732f7273} (gdb) and then of course if (metadata.magic != FC_CACHE_MAGIC) is true and it returns with FcFalse; -- Mike FABIAN <mfabian@suse.de> http://www.suse.de/~mfabian ?????????????
Patrick Lam
2006-Feb-18 09:57 UTC
[Fontconfig] Re: Status about fontconfig CVS regarding cache handling
Mike FABIAN wrote:> In the following piece of code from FcDirCacheHasCurrentArch ():Thanks. I forgot about the extra bits of info after current_arch_start. I''ve fixed fcrozat''s crash, although there might still be a bug lurking in the case when FcDirCacheHasCurrentArch returns FcFalse; I''ll investigate that. pat
Patrick Lam
2006-Feb-18 10:19 UTC
[Fontconfig] Re: Status about fontconfig CVS regarding cache handling
Mike FABIAN wrote:> is true and it returns with FcFalse;I''ve fixed the underlying problem which gets triggered by this too. pat
Frederic Crozat
2006-Feb-20 02:19 UTC
[Fontconfig] Re: Status about fontconfig CVS regarding cache handling
Le samedi 18 f?vrier 2006 ? 13:23 -0500, Patrick Lam a ?crit :> Mike FABIAN wrote: > > is true and it returns with FcFalse; > > I''ve fixed the underlying problem which gets triggered by this too.Ok, I can confirm that the crash is fixed. The cache being always updated by fc-cache if old version (but with correct magic) in present in the font directory is still there but I''m not sure we can fix it with something more than --really-force (which is fixing the issue). WDYT ? -- Frederic Crozat <fcrozat@mandriva.com> Mandriva
Patrick Lam
2006-Feb-20 06:24 UTC
[Fontconfig] Re: Status about fontconfig CVS regarding cache handling
Frederic Crozat wrote:> Ok, I can confirm that the crash is fixed.Great. I''m thinking of letting CVS HEAD bake for a week and if we don''t find any new bugs I''ll package 2.3.94.> The cache being always updated by fc-cache if old version (but with > correct magic) in present in the font directory is still there but I''m > not sure we can fix it with something more than --really-force (which is > fixing the issue). WDYT ?For me, fc-cache always blows away caches in /usr if it''s creating caches in /var/cache. e.g. 1. fc-cache 2. cp /var/cache/fontconfig/bdbd6d7262ea0e8c6174f393e1c908c8.cache-2 /usr/share/fonts/truetype/ttf-bitstream-vera/fonts.cache-2 3. fc-cache -v * blows away /usr/share/fonts/truetype/.../fonts.cache-2 * creates updated bdbd6d...cache-2 4. fc-cache -v * skips /usr/share/fonts/truetype/.../fonts.cache-2 This continues to be the case, I believe, even if fonts.cache-2 has incorrect magic. Please give me steps to reproduce cache-always-updated. pat
Frederic Crozat
2006-Feb-20 06:42 UTC
[Fontconfig] Re: Status about fontconfig CVS regarding cache handling
Le lundi 20 f?vrier 2006 ? 09:26 -0500, Patrick Lam a ?crit :> Frederic Crozat wrote: > > Ok, I can confirm that the crash is fixed. > > Great. I''m thinking of letting CVS HEAD bake for a week and if we don''t > find any new bugs I''ll package 2.3.94.I''ve uploaded today snapshot to Mandriva cooker.. We''ll see if cooker users screem ;)> > The cache being always updated by fc-cache if old version (but with > > correct magic) in present in the font directory is still there but I''m > > not sure we can fix it with something more than --really-force (which is > > fixing the issue). WDYT ? > > For me, fc-cache always blows away caches in /usr if it''s creating > caches in /var/cache. e.g. > > 1. fc-cache > 2. cp /var/cache/fontconfig/bdbd6d7262ea0e8c6174f393e1c908c8.cache-2 > /usr/share/fonts/truetype/ttf-bitstream-vera/fonts.cache-2 > 3. fc-cache -v > * blows away /usr/share/fonts/truetype/.../fonts.cache-2 > * creates updated bdbd6d...cache-2 > 4. fc-cache -v > * skips /usr/share/fonts/truetype/.../fonts.cache-2 > > This continues to be the case, I believe, even if fonts.cache-2 has > incorrect magic. > > Please give me steps to reproduce cache-always-updated.Oops, I just tried again and it is FIXED !! I only tried fc-cache -v one time (which was rebuilding the cache and removing the file), not twice. Sorry for the false alarm. -- Frederic Crozat <fcrozat@mandriva.com> Mandriva
Mike FABIAN
2006-Feb-20 06:45 UTC
[Fontconfig] Re: Status about fontconfig CVS regarding cache handling
Frederic Crozat <fcrozat@mandriva.com> ????????:> Le samedi 18 f?vrier 2006 ? 13:23 -0500, Patrick Lam a ?crit : >> Mike FABIAN wrote: >> > is true and it returns with FcFalse; >> >> I''ve fixed the underlying problem which gets triggered by this too. > > Ok, I can confirm that the crash is fixed.Yes, I can also confirm that.> The cache being always updated by fc-cache if old version (but with > correct magic) in present in the font directory is still there but I''m > not sure we can fix it with something more than --really-force (which is > fixing the issue). WDYT ?How do you reproduce that? I think I cannot reproduce it. If I copy a cache file from /var/cache/fontconfig to the appropriate font directory, rename it to fonts.cache-2 and then touch that font directory, "fc-cache -v" correctly removes the cache file in the directory and updates the cache file in /var/cache/fontconfig. I tried to make the font directory readonly by adding a font directory to a readonly partition to make it impossible for fontconfig to remove the cache file in the directory. But even in that case it seems to work correctly: root@magellan:/var/cache/fontconfig# grep local/test-fonts * ??????????fac913a0a223655c1409661e791e1833.cache-2??????? root@magellan:/var/cache/fontconfig# cp fac913a0a223655c1409661e791e1833.cache-2 /local/test-fonts/fonts.cache-2 root@magellan:/var/cache/fontconfig# touch /local/test-fonts root@magellan:/var/cache/fontconfig# mount -o remount,ro /local root@magellan:/var/cache/fontconfig# mount | grep hda2 /dev/hda2 on /local type ext3 (ro) root@magellan:/var/cache/fontconfig# root@magellan:/var/cache/fontconfig# ll --full -d /local/test-fonts drwxr-xr-x 2 root root 4096 2006-02-20 15:37:36.000000000 +0100 /local/test-fonts/ root@magellan:/var/cache/fontconfig# ls --full /local/test-fonts/fonts.cache-2 /var/cache/fontconfig/fac913a0a223655c1409661e791e1833.cache-2 -rw-r--r-- 1 root root 45056 2006-02-20 15:28:30.000000000 +0100 /local/test-fonts/fonts.cache-2 -rw-r--r-- 1 root root 45056 2006-02-20 15:36:29.000000000 +0100 /var/cache/fontconfig/fac913a0a223655c1409661e791e1833.cache-2 root@magellan:/var/cache/fontconfig# fc-cache -v /local/test-fonts fc-cache: "/local/test-fonts": caching, 20 fonts, 0 dirs fc-cache: succeeded root@magellan:/var/cache/fontconfig# fc-cache -v /local/test-fonts fc-cache: "/local/test-fonts": skipping, 20 fonts, 0 dirs fc-cache: succeeded root@magellan:/var/cache/fontconfig# root@magellan:/var/cache/fontconfig# ls --full -d /local/test-fonts drwxr-xr-x 2 root root 4096 2006-02-20 15:37:36.000000000 +0100 /local/test-fonts/ root@magellan:/var/cache/fontconfig# ls --full /local/test-fonts/fonts.cache-2 /var/cache/fontconfig/fac913a0a223655c1409661e791e1833.cache-2 -rw-r--r-- 1 root root 45056 2006-02-20 15:28:30.000000000 +0100 /local/test-fonts/fonts.cache-2 -rw-r--r-- 1 root root 45056 2006-02-20 15:38:41.000000000 +0100 /var/cache/fontconfig/fac913a0a223655c1409661e791e1833.cache-2 root@magellan:/var/cache/fontconfig# -- Mike FABIAN <mfabian@suse.de> http://www.suse.de/~mfabian ?????????????
Patrick Lam
2006-Feb-20 06:49 UTC
[Fontconfig] Re: Status about fontconfig CVS regarding cache handling
Mike FABIAN wrote:> I think I cannot reproduce it. If I copy a cache file from > /var/cache/fontconfig to the appropriate font directory, rename it to > fonts.cache-2 and then touch that font directory, "fc-cache -v" > correctly removes the cache file in the directory and > updates the cache file in /var/cache/fontconfig.Great. I hope fontconfig is relatively stable now; we''ll see... pat