[PATCH] D43834: Fix use after free in PDB linker.

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 27 16:52:23 PST 2018


smeenai added a comment.

In https://reviews.llvm.org/D43834#1021427, @zturner wrote:

> In https://reviews.llvm.org/D43834#1021379, @smeenai wrote:
>
> > To clarify, this is only an issue when using type server PDBs, right?
>
>
> Yes
>
> > In other words, if we're purely cross-compiling using clang and lld-link, we wouldn't run into this, since clang-cl doesn't use type server PDBs (in other words, it does `/Z7` instead of `/Zi`)?
>
> No.  clang-cl doesn't *generate* type server PDBs, so its' true that all debug info *generated by clang-cl* will not experience this.  But you will need to link against the CRT, and that will pull in some variant of `libcmt.pdb`, and that is where you will hit this bug.


We're linking against the dynamic CRT, and my VS 2017 install doesn't include PDBs for the dynamic CRT libraries (e.g. I see libcmt.pdb, but not anything for msvcrt). We were also not copying over those PDBs to our cross-compilation sysroot anyway, though that was just an oversight on our part and not anything intentional (but if they don't have PDBs for the dynamic CRT libraries, it's irrelevant for us anyway).


https://reviews.llvm.org/D43834





More information about the llvm-commits mailing list