[Issue 8668] Cache overlay, unexpected behaviour and occasional segfaults