Matthias Clasen
2006-Jan-25 09:56 UTC
[Fontconfig] confused about semantics of $HOME/.fonts.cache-2
Can somebody update me about the intended semantics of $HOME/.fonts.cache-2. Why do we need it, when there are caches for all font directories in /var/cache/fontconfig and in $HOME/.fonts ? I am also puzzled by this behaviour: $ rm $HOME/.fonts.cache-2 $ fc-list : [long font listing] $ ls -l .fonts.cache-2 -rw------- 1 mclasen mclasen 141434 Jan 25 12:57 .fonts.cache-2 $ fc-cat .fonts.cache-2 | wc -l 144 $ touch /usr/share/fonts/bitstream-vera $ fc-list : [ long font listing] $ ls -l .fonts.cache-2 -rw------- 1 mclasen mclasen 32768 Jan 25 12:58 .fonts.cache-2 $ fc-cat .fonts.cache-2 | wc -l 0 What is going on here ? Matthias
Frederic Crozat
2006-Jan-25 10:01 UTC
[Fontconfig] confused about semantics of $HOME/.fonts.cache-2
Le mercredi 25 janvier 2006 ? 12:59 -0500, Matthias Clasen a ?crit :> Can somebody update me about the intended semantics of > $HOME/.fonts.cache-2. Why do we need it, when there are caches for > all font directories in /var/cache/fontconfig and in $HOME/.fonts ?~/.fonts.cache-2 is supposed to exist only if some informations are missing in /var/cache/fontconfig (ie dirty cache) or if some fonts are in ~/.fonts (cache should not be in ~/.fonts).> I am also puzzled by this behaviour: > > $ rm $HOME/.fonts.cache-2 > $ fc-list : > > [long font listing] > > $ ls -l .fonts.cache-2 > -rw------- 1 mclasen mclasen 141434 Jan 25 12:57 .fonts.cache-2 > > $ fc-cat .fonts.cache-2 | wc -l > 144 > > $ touch /usr/share/fonts/bitstream-vera > $ fc-list : > > [ long font listing] > > $ ls -l .fonts.cache-2 > -rw------- 1 mclasen mclasen 32768 Jan 25 12:58 .fonts.cache-2 > > $ fc-cat .fonts.cache-2 | wc -l > 0 > > > What is going on here ?I think you just hit one of the various cache bugs we are investigating with Patrick and Mike. Try removing all files in /var/cache/fontconfig and re-run fc-cache as root. -- Frederic Crozat <fcrozat@mandriva.com> Mandriva
Matthias Clasen
2006-Jan-25 10:08 UTC
[Fontconfig] confused about semantics of $HOME/.fonts.cache-2
On Wed, 2006-01-25 at 19:04 +0100, Frederic Crozat wrote:> Le mercredi 25 janvier 2006 ? 12:59 -0500, Matthias Clasen a ?crit : > > Can somebody update me about the intended semantics of > > $HOME/.fonts.cache-2. Why do we need it, when there are caches for > > all font directories in /var/cache/fontconfig and in $HOME/.fonts ? > > ~/.fonts.cache-2 is supposed to exist only if some informations are > missing in /var/cache/fontconfig (ie dirty cache) or if some fonts are > in ~/.fonts (cache should not be in ~/.fonts).Hmm, I have fonts in ~/.fonts, but I get both ~/.fonts.cache-2 and ~/.fonts/fonts.cache-2 created. Also, whats the rationale for "should not be in ~/.fonts") ? Matthias
Behdad Esfahbod
2006-Jan-25 10:30 UTC
[Fontconfig] confused about semantics of $HOME/.fonts.cache-2
I can reproduce this consistently: [behdad@home ~]$ rm .fonts.cache-2* -f [behdad@home ~]$ \time fc-list | wc -l 2.49user 0.09system 0:02.59elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+29969minor)pagefaults 0swaps 198 [behdad@home ~]$ ll .fonts.cache-2* -rw------- 1 behdad behdad 286721 Jan 25 13:27 .fonts.cache-2 [behdad@home ~]$ sudo touch /usr/share/fonts/bitstream-vera [behdad@home ~]$ fc-list Segmentation fault [behdad@home ~]$ ll .fonts.cache-2* -rw------- 1 behdad behdad 286721 Jan 25 13:27 .fonts.cache-2 -rw------- 1 behdad behdad 6 Jan 25 13:27 .fonts.cache-2.LCK -rw------- 1 behdad behdad 14522 Jan 25 13:27 .fonts.cache-2.NEW [behdad@home ~]$ \time fc-list | wc -l 0.03user 0.01system 0:00.05elapsed 84%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+806minor)pagefaults 0swaps 198 [behdad@home ~]$ ll .fonts.cache-2* -rw------- 1 behdad behdad 286721 Jan 25 13:27 .fonts.cache-2 -rw------- 1 behdad behdad 6 Jan 25 13:27 .fonts.cache-2.LCK -rw------- 1 behdad behdad 14522 Jan 25 13:27 .fonts.cache-2.NEW And the backtrace: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1209092416 (LWP 28257)] 0x004d4d42 in FcGlobalCacheSave (cache=0x9b4cad0, cache_file=0x9b440e8 "/home/behdad/.fonts.cache-2", config=0x9b44008) at fccache.c:152 152 if (write (fd, chars, strlen(chars)+1) != strlen(chars)+1) (gdb) bt #0 0x004d4d42 in FcGlobalCacheSave (cache=0x9b4cad0, cache_file=0x9b440e8 "/home/behdad/.fonts.cache-2", config=0x9b44008) at fccache.c:152 #1 0x004d8910 in FcConfigBuildFonts (config=0x9b44008) at fccfg.c:328 #2 0x004e19cd in FcInitLoadConfigAndFonts () at fcinit.c:85 #3 0x004e1c66 in FcInit () at fcinit.c:103 #4 0x08048b16 in main (argc=1, argv=0xbfd03b84) at fc-list.c:119 (gdb) (gdb) p cache->dirs[0] $4 = {next = 0x9b46538, name = 0x9b5ba88 "/usr/share/fonts/bitstream-vera", metadata = {magic = -66913278, count = 10361, bank = 778904322, pattern_count = 10, patternelt_count = 164, valuelist_count = 164, str_count = 238, langset_count = 10, charset_count = 10, charset_numbers_count = 90, charset_leaf_count = 90, charset_leaf_idx_count = 10}, offset = 0, ent = 0x9b54998} I cannot do p chars, because of inlining I guess. --behdad http://behdad.org/ "Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill" -- Dan Bern, "New American Language"
Mike FABIAN
2006-Jan-26 03:59 UTC
[Fontconfig] Re: confused about semantics of $HOME/.fonts.cache-2
Behdad Esfahbod <behdad@cs.toronto.edu> ????????:> I can reproduce this consistently: > > [behdad@home ~]$ rm .fonts.cache-2* -f > [behdad@home ~]$ \time fc-list | wc -l > 2.49user 0.09system 0:02.59elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k > 0inputs+0outputs (0major+29969minor)pagefaults 0swaps > 198 > [behdad@home ~]$ ll .fonts.cache-2* > -rw------- 1 behdad behdad 286721 Jan 25 13:27 .fonts.cache-2 > [behdad@home ~]$ sudo touch /usr/share/fonts/bitstream-vera > [behdad@home ~]$ fc-list > Segmentation faultI cannot reproduce that crash with the current CVS. (with my patch improve-normalization-of-font-path-add-subdirs.patch, see http://lists.freedesktop.org/archives/fontconfig/2006-January/001939.html but I doubt this makes a difference).> [behdad@home ~]$ ll .fonts.cache-2* > -rw------- 1 behdad behdad 286721 Jan 25 13:27 .fonts.cache-2 > -rw------- 1 behdad behdad 6 Jan 25 13:27 .fonts.cache-2.LCK > -rw------- 1 behdad behdad 14522 Jan 25 13:27 .fonts.cache-2.NEW > [behdad@home ~]$ \time fc-list | wc -l > 0.03user 0.01system 0:00.05elapsed 84%CPU (0avgtext+0avgdata 0maxresident)k > 0inputs+0outputs (0major+806minor)pagefaults 0swaps > 198 > [behdad@home ~]$ ll .fonts.cache-2* > -rw------- 1 behdad behdad 286721 Jan 25 13:27 .fonts.cache-2 > -rw------- 1 behdad behdad 6 Jan 25 13:27 .fonts.cache-2.LCK > -rw------- 1 behdad behdad 14522 Jan 25 13:27 .fonts.cache-2.NEW > > > > And the backtrace: > > Program received signal SIGSEGV, Segmentation fault. > [Switching to Thread -1209092416 (LWP 28257)] > 0x004d4d42 in FcGlobalCacheSave (cache=0x9b4cad0, > cache_file=0x9b440e8 "/home/behdad/.fonts.cache-2", config=0x9b44008) > at fccache.c:152 > 152 if (write (fd, chars, strlen(chars)+1) != strlen(chars)+1) > (gdb) bt > #0 0x004d4d42 in FcGlobalCacheSave (cache=0x9b4cad0, > cache_file=0x9b440e8 "/home/behdad/.fonts.cache-2", config=0x9b44008) > at fccache.c:152 > #1 0x004d8910 in FcConfigBuildFonts (config=0x9b44008) at fccfg.c:328 > #2 0x004e19cd in FcInitLoadConfigAndFonts () at fcinit.c:85 > #3 0x004e1c66 in FcInit () at fcinit.c:103 > #4 0x08048b16 in main (argc=1, argv=0xbfd03b84) at fc-list.c:119 > (gdb) > > > (gdb) p cache->dirs[0] > $4 = {next = 0x9b46538, name = 0x9b5ba88 > "/usr/share/fonts/bitstream-vera", > metadata = {magic = -66913278, count = 10361, bank = 778904322, > pattern_count = 10, patternelt_count = 164, valuelist_count = 164, > str_count = 238, langset_count = 10, charset_count = 10, > charset_numbers_count = 90, charset_leaf_count = 90, > charset_leaf_idx_count = 10}, offset = 0, ent = 0x9b54998} > > > I cannot do p chars, because of inlining I guess. > > > --behdad > http://behdad.org/ > > "Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill" > -- Dan Bern, "New American Language" > _______________________________________________ > Fontconfig mailing list > Fontconfig@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/fontconfig >-- Mike FABIAN <mfabian@suse.de> http://www.suse.de/~mfabian ?????????????
Behdad Esfahbod
2006-Jan-26 05:38 UTC
[Fontconfig] Re: confused about semantics of $HOME/.fonts.cache-2
On Thu, 26 Jan 2006, Mike FABIAN wrote:> Behdad Esfahbod <behdad@cs.toronto.edu> =A4=B5=A4=F3=A4=CF=BD=F1=A4=AD=A4=DE=A4=B7=A4=BF: > > > I can reproduce this consistently: > > > > [behdad@home ~]$ rm .fonts.cache-2* -f > > [behdad@home ~]$ \time fc-list | wc -l > > 2.49user 0.09system 0:02.59elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k > > 0inputs+0outputs (0major+29969minor)pagefaults 0swaps > > 198 > > [behdad@home ~]$ ll .fonts.cache-2* > > -rw------- 1 behdad behdad 286721 Jan 25 13:27 .fonts.cache-2 > > [behdad@home ~]$ sudo touch /usr/share/fonts/bitstream-vera > > [behdad@home ~]$ fc-list > > Segmentation fault > > I cannot reproduce that crash with the current CVS.Note that I have installed fc-branch in my home user and not created global -2 caches. And I got random apps crashing randomly all the time after yesterday''s cvs up, so had to uninstall it. behdad> (with my patch improve-normalization-of-font-path-add-subdirs.patch, > see > > http://lists.freedesktop.org/archives/fontconfig/2006-January/001939.html > > but I doubt this makes a difference). > > > [behdad@home ~]$ ll .fonts.cache-2* > > -rw------- 1 behdad behdad 286721 Jan 25 13:27 .fonts.cache-2 > > -rw------- 1 behdad behdad 6 Jan 25 13:27 .fonts.cache-2.LCK > > -rw------- 1 behdad behdad 14522 Jan 25 13:27 .fonts.cache-2.NEW > > [behdad@home ~]$ \time fc-list | wc -l > > 0.03user 0.01system 0:00.05elapsed 84%CPU (0avgtext+0avgdata 0maxresident)k > > 0inputs+0outputs (0major+806minor)pagefaults 0swaps > > 198 > > [behdad@home ~]$ ll .fonts.cache-2* > > -rw------- 1 behdad behdad 286721 Jan 25 13:27 .fonts.cache-2 > > -rw------- 1 behdad behdad 6 Jan 25 13:27 .fonts.cache-2.LCK > > -rw------- 1 behdad behdad 14522 Jan 25 13:27 .fonts.cache-2.NEW > > > > > > > > And the backtrace: > > > > Program received signal SIGSEGV, Segmentation fault. > > [Switching to Thread -1209092416 (LWP 28257)] > > 0x004d4d42 in FcGlobalCacheSave (cache=3D0x9b4cad0, > > cache_file=3D0x9b440e8 "/home/behdad/.fonts.cache-2", config=3D0x9b44008) > > at fccache.c:152 > > 152 if (write (fd, chars, strlen(chars)+1) !=3D strlen(chars)+1) > > (gdb) bt > > #0 0x004d4d42 in FcGlobalCacheSave (cache=3D0x9b4cad0, > > cache_file=3D0x9b440e8 "/home/behdad/.fonts.cache-2", config=3D0x9b44008) > > at fccache.c:152 > > #1 0x004d8910 in FcConfigBuildFonts (config=3D0x9b44008) at fccfg.c:328 > > #2 0x004e19cd in FcInitLoadConfigAndFonts () at fcinit.c:85 > > #3 0x004e1c66 in FcInit () at fcinit.c:103 > > #4 0x08048b16 in main (argc=3D1, argv=3D0xbfd03b84) at fc-list.c:119 > > (gdb) > > > > > > (gdb) p cache->dirs[0] > > $4 =3D {next =3D 0x9b46538, name =3D 0x9b5ba88 > > "/usr/share/fonts/bitstream-vera", > > metadata =3D {magic =3D -66913278, count =3D 10361, bank =3D 778904322, > > pattern_count =3D 10, patternelt_count =3D 164, valuelist_count =3D 164, > > str_count =3D 238, langset_count =3D 10, charset_count =3D 10, > > charset_numbers_count =3D 90, charset_leaf_count =3D 90, > > charset_leaf_idx_count =3D 10}, offset =3D 0, ent =3D 0x9b54998} > > > > > > I cannot do p chars, because of inlining I guess. > > > > > > --behdad > > http://behdad.org/ > > > > "Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill" > > =09-- Dan Bern, "New American Language" > > _______________________________________________ > > Fontconfig mailing list > > Fontconfig@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/fontconfig > > > >--behdad http://behdad.org/ "Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill" =09-- Dan Bern, "New American Language"
Patrick Lam
2006-Jan-26 16:35 UTC
[Fontconfig] confused about semantics of $HOME/.fonts.cache-2
Matthias Clasen wrote:> Can somebody update me about the intended semantics of > $HOME/.fonts.cache-2. Why do we need it, when there are caches for > all font directories in /var/cache/fontconfig and in $HOME/.fonts ?Just to confirm Frederic''s answer, the fonts.cache-2 files in /var/cache/fontconfig are directory caches, while ~/.fonts.cache-2 is a global cache. The directory caches are generated by fc-cache (so regular users can''t generate them), whereas the global cache is generated on a per-user basis to handle any missing cache information that''s no in the directory caches.> $ fc-cat .fonts.cache-2 | wc -l > 0Probably a bug that I''ve squashed. pat