postinstall: fontconfig abnormal exit

Brian Inglis
Fri Jul 23 03:37:32 GMT 2021

On 2021-07-21 13:26, Ken Brown via Cygwin wrote:
> On 7/20/2021 1:00 PM, Brian Inglis wrote:
>  > On 2020-09-12 06:56, Ken Brown via Cygwin wrote:
>> For fontconfig fc-cache-1 appears to have been creating thousands (on 
>> Cygwin 64 millions) of small <1KB 
>> /var/cache/fontconfig/%8x-%4x-%4x-%4x-%12x-le{64,32d8}.cache-7 files.
>> The problems could have originally been caused by an old bug:
>> combined with many font additions around that time, mainly working on 
>> Cygwin 64, where I use X, and manually run fontconfig postinstall 
>> script, to try to avoid long setup postinstalls, whereas on Cygwin 32 
>> I don't use X or manually run postinstall scripts, just get run after 
>> setup.
>> I have about 200 Windows MS font files, 1000 non-MS font files, and 
>> about 800 Cygwin font files, from multiple distros and elsewhere, 
>> including some with full BMP coverage, some with SMP coverage, some 
>> for fallback code points, others with group ranges.
>> I rm'ed -rf /var/cache/fontconfig/ with a few thousand files on Cygwin 
>> 32 and rebuilt it okay with only 65 cache files.
>> I tried rm -rf /var/cache/fontconfig/ on Cygwin 64 but got many 
>> permission errors and killed it.
> The preremove script for libfontconfig1 should remove all those cache 
> files every time libfontconfig1 is updated, so you should have gotten a 
> fresh start every once in a while.  Apparently something went wrong.
>> I gave up waiting for ls -U to show any results on Cygwin 64 or 
>> Explorer on that dir to show any file details, but cmd /c dir | less 
>> displays the base info for hundreds of thousands of files, and wc 
>> reports millions.
>> I am still waiting for an elevated cmd to rmdir /s /q fontconfig there!
>> Do you know why fc-cache-1 is run rather than fc-cache and what the 
>> difference is?
> They're identical.  It's just a packaging issue.  fc-cache is in the 
> fontconfig package, and fc-cache-1 is in the libfontconfig1 package.  
> That way fc-cache-1 is available for use in postinstall scripts for 
> users who install libfontconfig1 (probably because something requires 
> it) but not fontconfig.
>> What would give you useful information once I have the fontconfig 
>> cache cleared?
>> Might running FC_DEBUG=65535 fc-cache-1 -fsv provide useful info?
>> Or do so with strace?
>> Would running file on the font files give enough info about properties 
>> to be of any help?
> I'm not an expert on fontconfig, so I probably can't help.
>> What is the best approach to get the minimal cache files recreated?
> I would expect that this would always happen as a result of running 
> setup and letting the preremove/postinstall scripts do their job.  I 
> don't know what went wrong in your case.
>> What is the best approach to avoid thousand of cache files in future?
> Again, I don't know why that happened in the first place.

Thanks, I'll just assume between fontconfig and Windows profile issues 
in 2018 something went nuts, and once the directory has been cleared, 
I'll add a monitoring cron job on the cache.

Elevated cmd to clear directory still running days later!


	$ cmd /c dir fontconfig | wc

now showing only 207348 files left to delete after a few minutes, and

	 $ /bin/ls -1U fontconfig | wc

likewise! ;^>

Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]

More information about the Cygwin mailing list