Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

The PDB checksum checking doesn't work for Windows PDBs #134

Open
mikem8361 opened this issue Oct 25, 2019 · 3 comments
Open

The PDB checksum checking doesn't work for Windows PDBs #134

mikem8361 opened this issue Oct 25, 2019 · 3 comments
Assignees
Milestone

Comments

@mikem8361
Copy link
Member

There is very subtle bug in the Windows PDB key generator that caused the pdb checksum list never to be passed to the SymbolStoreKey constructor (one of the closing parentheses is in the wrong place causing pdbChecksums to be passed to the string.Format instead of BuildKey).

PDBFileKeyGenerator.cs line 52:

-       return BuildKey(path, string.Format("{0}{1:x}", signature.ToString("N"), age, pdbChecksums));
+       return BuildKey(path, string.Format("{0}{1:x}", signature.ToString("N"), age), clrSpecialFile: false, pdbChecksums);

Once this was fixed, symbol downloads for Windows PDBs (i.e. Microsoft.Extensions.Hosting.Abstractions.ni.pdb) started failing because ChecksumValidator.cs seems to only handle portable PDBs:

        private static uint GetPdbStreamOffset(Stream pdbStream)
        {
            pdbStream.Position = 0;
            using (var reader = new BinaryReader(pdbStream, Encoding.UTF8, leaveOpen: true))
            {
                pdbStream.Seek(4 + // Signature
                               2 + // Version Major
                               2 + // Version Minor
                               4,  // Reserved)
                               SeekOrigin.Begin);

                // skip the version string
                uint versionStringSize = reader.ReadUInt32();     <<------- exception

                pdbStream.Seek(versionStringSize, SeekOrigin.Current);
@mikem8361 mikem8361 added this to the 3.1 milestone Oct 25, 2019
@gregg-miskelly
Copy link
Contributor

FYI I don't think anything supports PDB checksums for Windows PDBs.

@tmat
Copy link
Member

tmat commented Oct 29, 2019

I heard that C++ now emits PDB checksums, but Roslyn does not currently: dotnet/roslyn#24429

@gregg-miskelly
Copy link
Contributor

I double checked the VS debugger sources, and VS will ignore checksums when searching for non-portable PDBs. I don't know if symsrv.dll wound up added support, but, at least originally, it also only supported portable PDBs.

@mikem8361 mikem8361 self-assigned this Jan 3, 2020
@mikem8361 mikem8361 modified the milestones: 3.1, Future Jan 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants