[PATCH] D43834: Fix use after free in PDB linker.
Zachary Turner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 27 15:55:59 PST 2018
zturner added a comment.
In https://reviews.llvm.org/D43834#1021297, @rnk wrote:
> How many bytes does a PDB session allocator end up holding? Try the debug CRT PDB, since it's the most common one. I suspect it holds a ton of temporary data that we really should throw away after closing the type server PDB.
> A different way of fixing this would be to disable the optimization that skips copying records without type indices.
> Or, why are these non-remapped records even being copied into BumpPtrAllocator memory? Why don't they come directly from the PDB's MemoryBuffer? Can we extend the life of the memory mapped PDB instead? That memory is shared with the FS cache, and is much cheaper to keep around.
I suspect it is due to records which are discontiguous. Whenever we encounter one of those, we have to make a copy and piece it together so that it will be contiguous. I can confirm that the number of bytes is small though.
More information about the llvm-commits