You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
ILLinker fails to load portable pdb files for crossgen'd assemblies #1620
In order to debug a trimmed application, I need to give the untrimmed symbols to the ILLinker so it can update the symbols as necessary.
The symbols for System.* assemblies I get from the Microsoft Symbols Server when debugging an untrimmed application appear to be the portable pdb format. However, if I feed these symbols into the ILLinker when trimming an app, the ILLinker refuses to load the .pdb because of the following check:
When debugging the ILLinker, module_guid and pdb_guid don't match, thus it returns false.
Building dotnet/runtime locally, I grabbed the crossgen'd .dll and the 2 pdb files (the .ni.pdb and portable .pdb) and tried each with the ILLinker. The ILLinker loaded the .ni.pdb file, but complained about the portable .pdb file.
@noahfalk@mikem8361 - is the above Cecil code for checking the image Guid's correct? Or does it need to be updated for crossgen'd assemblies? I know that Visual Studio can successfully load a portable .pdb with a crossgen'd binary. So I assume there is something wrong with the ILLinker in this case.
I think what you are seeing is that Cecil doesn't properly support binaries with multiple CodeView entries. I'm not aware of any binaries that do this other than those produced with NGEN and R2R. For example:
My educated guess is that if you ran your test on this binary you would see module_guid = 8BB111C4-B66F-C747-0651-09E4DB42CA10 and pdb_guid = F3DD31A3-D437-4D7D-9525-D887480DAE95. The Cecil code appears to only be reading the first CodeView entry and assumes that is the one which will correspond to the portable PDB. If Cecil continued iterating the list it would discover the 2nd entry and match it.
Activity
noahfalk commentedon Nov 12, 2020
cc @tmat
I think what you are seeing is that Cecil doesn't properly support binaries with multiple CodeView entries. I'm not aware of any binaries that do this other than those produced with NGEN and R2R. For example:
My educated guess is that if you ran your test on this binary you would see module_guid = 8BB111C4-B66F-C747-0651-09E4DB42CA10 and pdb_guid = F3DD31A3-D437-4D7D-9525-D887480DAE95. The Cecil code appears to only be reading the first CodeView entry and assumes that is the one which will correspond to the portable PDB. If Cecil continued iterating the list it would discover the 2nd entry and match it.
marek-safar commentedon Nov 12, 2020
@eerhardt would you mind filling Cecil issue at https://github.com/jbevain/cecil/ or prepare PR?
eerhardt commentedon Nov 13, 2020
I've opened jbevain/cecil#704 to track this issue.