Bug#857892: fontconfig: please make the cache files reproducible

Chris Lamb lamby at debian.org
Thu Mar 16 07:44:46 UTC 2017


Source: fontconfig
Version: 2.11.0-6.7
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: randomness
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

Whilst working on the Reproducible Builds [0] we noticed that the fc-cache
command generates cache files in with non-deterministic contents.

This is problematic for us as bootstrapping a new Debian system will result
in different contents under /var/cache/fontconfig and thus the generated
system is not reproducible. In Tails[1] we are working around this by simply
deleting the contents of this directory [2] but this probably isn't a good
idea.

The cause is due to fc-cache writing unitialised memory during scanning of 
the directory index.

Patch attached.


 [0] https://reproducible-builds.org/
 [1] https://tails.boum.org/
 [2] https://git-tails.immerda.ch/tails/tree/config/chroot_local-hooks/99-zzzzzz_reproducible-builds-post-processing?h=feature/5630-deterministic-builds#n28


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
diff --git a/src/fcpat.c b/src/fcpat.c
index 0614ac2..374432a 100644
--- a/src/fcpat.c
+++ b/src/fcpat.c
@@ -33,6 +33,7 @@ FcPatternCreate (void)
     p = (FcPattern *) malloc (sizeof (FcPattern));
     if (!p)
 	return 0;
+    memset (p, 0, sizeof (FcPattern));
     p->num = 0;
     p->size = 0;
     p->elts_offset = FcPtrToOffset (p, NULL);


More information about the Reproducible-bugs mailing list