cache_test intermittently fails
See e.g. https://gitlab.freedesktop.org/Venemo/mesa/-/jobs/1602310:
--- stderr ---
Failed to create ./cache-test-tmp/xdg-cache-home for shader cache (No such file or directory)---disabling.
Failed to create ./cache-test-tmp/mesa-glsl-cache-dir for shader cache (No such file or directory)---disabling.
Error: Test 'disk_cache_put eviction last file == MAX_SIZE (1MB)' failed: Expected=true, Actual=false
Error: Test 'eviction after overflow with MAX_SIZE=1M' failed: Expected=1, Actual=0
-------
(The first two lines also appear on successful runs of the test, so they might be harmless)
valgrind
flags some errors for this test:
==652411== Use of uninitialised value of size 8
==652411== at 0x10CD23: _mesa_sha1_format (mesa-sha1.c:47)
==652411== by 0x10B77C: get_cache_file.isra.0 (disk_cache.c:472)
==652411== by 0x10C76F: disk_cache_get (disk_cache.c:1163)
==652411== by 0x10AFDA: does_cache_contain (cache_test.c:155)
==652411== by 0x10B04A: wait_until_file_written (cache_test.c:177)
==652411== by 0x10B0B5: cache_exists (cache_test.c:195)
==652411== by 0x10A6BB: test_disk_cache_create (cache_test.c:235)
==652411== by 0x10A6BB: main (cache_test.c:504)
==652411== Uninitialised value was created by a stack allocation
==652411== at 0x10B060: cache_exists (cache_test.c:187)
==652411==
==652411== Use of uninitialised value of size 8
==652411== at 0x10CD31: _mesa_sha1_format (mesa-sha1.c:48)
==652411== by 0x10B77C: get_cache_file.isra.0 (disk_cache.c:472)
==652411== by 0x10C76F: disk_cache_get (disk_cache.c:1163)
==652411== by 0x10AFDA: does_cache_contain (cache_test.c:155)
==652411== by 0x10B04A: wait_until_file_written (cache_test.c:177)
==652411== by 0x10B0B5: cache_exists (cache_test.c:195)
==652411== by 0x10A6BB: test_disk_cache_create (cache_test.c:235)
==652411== by 0x10A6BB: main (cache_test.c:504)
==652411== Uninitialised value was created by a stack allocation
==652411== at 0x10B060: cache_exists (cache_test.c:187)
These point to the
uint8_t dummy_key[20];
array in cache_exists
being used uninitialized. While it seems unlikely that the job failures are directly related to this, it would be good to fix this anyway.