I originally reopened bug 184614 for this, but I'm filing it now as a separate bug. On startup, I reliably see a valgrind warning about writing uninitialized memory to disk cache. One of those warnings is in attachment 252679 [details]. I noticed the problem may be to the effect of mKeyStart on sizeof(nsDiskCacheEntry).
In particular, the sizeof(nsDiskCacheEntry) math in CreateDiskCacheEntry, which could use the offsetof trick that nsDiskCacheEntry::Size uses, or we could just get rid of mKeyStart, which is pretty easy as well.
Created attachment 252691 [details] [diff] [review] patch This removes the mKeyStart (which presumably adds 3 bytes of padding for the alignment as well), so that sizeof(nsDiskCacheEntry) is less confusing. The substantive change this should be causing is reducing the size calculation in CreateDiskCacheEntry, which does two things: * reduces the amount of memory allocated * reduces the |size| returned to nsDiskCacheMap::WriteDiskCacheEntry The latter change changes the file index; therefore I chose to bump the cache version, although I'm not sure if that's needed.
Checked in to trunk.