Skip to content

Symbols generated by ILAsm do not contain a PdbChecksum debug directory entry #62484

Closed

Description

@clairernovotny

The System.Runtime.CompilerServices.Unsafe 6.0 package does not have symbols on MSDL or NuGet's symbol server.

@ericstj

Activity

  1. ghost added
    untriaged
    on Dec 7, 2021
  2. safern commented on Dec 7, 2021

    @safern
    Member

    I just checked if we emmited PDBs for this project and we do. I tested it out on the 6.0 branch and we do generate the PDB and also we create a symbols package with the PDBs in it. So I wonder if this was a publishing issue or if we need to adjust the way we do publishing.

  3. ericstj commented on Dec 7, 2021

    @ericstj
    Member

    I think we're publishing correctly. I can see the symbols when I use symchk. What's interesting are some errors from symchk.

    Public symbol server (I see the same when using the internal server)

    C:\Users\erics\Downloads\system.runtime.compilerservices.unsafe.6.0.0\lib\net6.0>\debuggers\SymChk.exe -s https://msdl.microsoft.com/download/symbols -v System.Runtime.CompilerServices.Unsafe.dll
    [SYMCHK] Searching for symbols to C:\Users\erics\Downloads\system.runtime.compilerservices.unsafe.6.0.0\lib\net6.0\System.Runtime.CompilerServices.Unsafe.dll in path https://msdl.microsoft.com/download/symbols
    DBGHELP: Symbol Search Path: https://msdl.microsoft.com/download/symbols
    [SYMCHK] Using search path "https://msdl.microsoft.com/download/symbols"
    DBGHELP: No header for C:\Users\erics\Downloads\system.runtime.compilerservices.unsafe.6.0.0\lib\net6.0\System.Runtime.CompilerServices.Unsafe.dll.  Searching for image on disk
    DBGHELP: C:\Users\erics\Downloads\system.runtime.compilerservices.unsafe.6.0.0\lib\net6.0\System.Runtime.CompilerServices.Unsafe.dll - OK
    SYMSRV:  BYINDEX: 0x1
             https://msdl.microsoft.com/download/symbols
             System.Runtime.CompilerServices.Unsafe.pdb
             7C39E25E02074F4BAEDC1C131C0461671
    SYMSRV:  UNC: C:\debuggers\sym\System.Runtime.CompilerServices.Unsafe.pdb\7C39E25E02074F4BAEDC1C131C0461671\System.Runtime.CompilerServices.Unsafe.pdb - path not found
    SYMSRV:  UNC: C:\debuggers\sym\System.Runtime.CompilerServices.Unsafe.pdb\7C39E25E02074F4BAEDC1C131C0461671\System.Runtime.CompilerServices.Unsafe.pd_ - path not found
    SYMSRV:  UNC: C:\debuggers\sym\System.Runtime.CompilerServices.Unsafe.pdb\7C39E25E02074F4BAEDC1C131C0461671\file.ptr - path not found
    SYMSRV:  HTTPGET: /download/symbols/index2.txt
    SYMSRV:  HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
    SYMSRV:  HTTPGET: /download/symbols/System.Runtime.CompilerServices.Unsafe.pdb/7C39E25E02074F4BAEDC1C131C0461671/System.Runtime.CompilerServices.Unsafe.pdb
    SYMSRV:  HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
    SYMSRV:  HTTPGET: /download/symbols/System.Runtime.CompilerServices.Unsafe.pdb/7C39E25E02074F4BAEDC1C131C0461671/System.Runtime.CompilerServices.Unsafe.pd_
    SYMSRV:  HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
    SYMSRV:  HTTPGET: /download/symbols/System.Runtime.CompilerServices.Unsafe.pdb/7C39E25E02074F4BAEDC1C131C0461671/file.ptr
    SYMSRV:  HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
    SYMSRV:  RESULT: 0x80190194
    SYMSRV:  BYINDEX: 0x2
             https://msdl.microsoft.com/download/symbols
             System.Runtime.CompilerServices.Unsafe.pdb
             7C39E25E02074F4BAEDC1C131C046167ffffffff
    SYMSRV:  UNC: C:\debuggers\sym\System.Runtime.CompilerServices.Unsafe.pdb\7C39E25E02074F4BAEDC1C131C046167ffffffff\System.Runtime.CompilerServices.Unsafe.pdb - path not found
    SYMSRV:  UNC: C:\debuggers\sym\System.Runtime.CompilerServices.Unsafe.pdb\7C39E25E02074F4BAEDC1C131C046167ffffffff\System.Runtime.CompilerServices.Unsafe.pd_ - path not found
    SYMSRV:  UNC: C:\debuggers\sym\System.Runtime.CompilerServices.Unsafe.pdb\7C39E25E02074F4BAEDC1C131C046167ffffffff\file.ptr - path not found
    SYMSRV:  HTTPGET: /download/symbols/System.Runtime.CompilerServices.Unsafe.pdb/7C39E25E02074F4BAEDC1C131C046167ffffffff/System.Runtime.CompilerServices.Unsafe.pdb
    SYMSRV:  HttpQueryInfo: 801900c8 - HTTP_STATUS_OK
    SYMSRV:  System.Runtime.CompilerServices.Unsafe.pdb from https://msdl.microsoft.com/download/symbols: 1740 bytes -      copied
    SYMSRV:  PATH: C:\debuggers\sym\System.Runtime.CompilerServices.Unsafe.pdb\7C39E25E02074F4BAEDC1C131C046167ffffffff\System.Runtime.CompilerServices.Unsafe.pdb
    SYMSRV:  RESULT: 0x00000000
    DBGHELP: C:\debuggers\sym\System.Runtime.CompilerServices.Unsafe.pdb\7C39E25E02074F4BAEDC1C131C046167ffffffff\System.Runtime.CompilerServices.Unsafe.pdb - E_PDB_CORRUPT
    DBGHELP: System.Runtime.CompilerServices.Unsafe - no symbols loaded
    [SYMCHK] MODULE64 Info ----------------------
    [SYMCHK] Struct size: 1680 bytes
    [SYMCHK] Base: 0x400000
    [SYMCHK] Image size: 32768 bytes
    [SYMCHK] Date: 0x61734b90
    [SYMCHK] Checksum: 0x000052d8
    [SYMCHK] NumSyms: 0
    [SYMCHK] SymType: SymNone
    [SYMCHK] ModName: System.Runtime.CompilerServices
    [SYMCHK] ImageName: C:\Users\erics\Downloads\system.runtime.compilerservices.unsafe.6.0.0\lib\net6.0\System.Runtime.CompilerServices.Unsafe.dll
    [SYMCHK] LoadedImage: C:\Users\erics\Downloads\system.runtime.compilerservices.unsafe.6.0.0\lib\net6.0\System.Runtime.CompilerServices.Unsafe.dll
    [SYMCHK] PDB: ""
    [SYMCHK] CV: RSDS
    [SYMCHK] CV DWORD: 0x53445352
    [SYMCHK] CV Data:  D:\a\_work\1\s\artifacts\obj\System.Runtime.CompilerServices.Unsafe\net6.0-Release\System.Runtime.CompilerServices.Unsafe.pdb
    [SYMCHK] PDB Sig:  0
    [SYMCHK] PDB7 Sig: {7C39E25E-0207-4F4B-AEDC-1C131C046167}
    [SYMCHK] Age: 1
    [SYMCHK] PDB Matched:  TRUE
    [SYMCHK] DBG Matched:  TRUE
    [SYMCHK] Line nubmers: FALSE
    [SYMCHK] Global syms:  FALSE
    [SYMCHK] Type Info:    FALSE
    [SYMCHK] ------------------------------------
    SymbolCheckVersion  0x00000002
    Result              0x00010001
    DbgFilename         System.Runtime.CompilerServices.Unsafe.dbg
    DbgTimeDateStamp    0x00000000
    DbgSizeOfImage      0x00000000
    DbgChecksum         0x00000000
    PdbFilename         D:\a\_work\1\s\artifacts\obj\System.Runtime.CompilerServices.Unsafe\net6.0-Release\System.Runtime.CompilerServices.Unsafe.pdb
    PdbSignature        {7C39E25E-0207-4F4B-AEDC-1C131C046167}
    PdbDbiAge           0x00000001
    [SYMCHK] [ 0x00000000 - 0x00010001 ] Checked "C:\Users\erics\Downloads\system.runtime.compilerservices.unsafe.6.0.0\lib\net6.0\System.Runtime.CompilerServices.Unsafe.dll"
    SYMCHK: System.Runtime.CompilerServices.Unsafe.dll FAILED  - System.Runtime.CompilerServices.Unsafe.pdb mismatched or not found
    
    SYMCHK: FAILED files = 1
    SYMCHK: PASSED + IGNORED files = 0
    

    The interesting parts seem to be:

    DBGHELP: C:\debuggers\sym\System.Runtime.CompilerServices.Unsafe.pdb\7C39E25E02074F4BAEDC1C131C046167ffffffff\System.Runtime.CompilerServices.Unsafe.pdb - E_PDB_CORRUPT
    DBGHELP: System.Runtime.CompilerServices.Unsafe - no symbols loaded
    ...
    [SYMCHK] PDB Matched:  TRUE
    [SYMCHK] DBG Matched:  TRUE
    [SYMCHK] Line nubmers: FALSE
    [SYMCHK] Global syms:  FALSE
    [SYMCHK] Type Info:    FALSE
    

    And although Line Numbers is misspelled, that's not the problem 😄 I wonder if symchk complains about the PDB in the same way from a local build, or after we run linker during the build? Perhaps isolating the error to a particular part of the build/publish pipeline can let us know where to find the issue?

  4. ericstj commented on Dec 7, 2021

    @ericstj
    Member

    Well, I was able to reproduce the same error when running locally, so perhaps it's a bug in ilasm?

    C:\src\dotnet\runtime\artifacts\bin\System.Runtime.CompilerServices.Unsafe\net6.0-Debug>\debuggers\SymChk.exe -s .\ System.Runtime.CompilerServices.Unsafe.dll -V
    ...
    DBGHELP: .\System.Runtime.CompilerServices.Unsafe.pdb - E_PDB_CORRUPT
    ...
    

    This might be relevant: #5051

  5. ericstj commented on Dec 7, 2021

    @ericstj
    Member
  6. ericstj commented on Dec 8, 2021

    @ericstj
    Member

    This does appear to be unique to 6.0, but not in the way I expected.

    Pre-6.0 builds of System.Runtime.CompilerServices.Unsafe look like they don't have a PDB and symchk seems to ignore them:

    C:\Users\erics\.nuget\packages\system.runtime.compilerservices.unsafe\5.0.0\lib\netcoreapp2.0>\debuggers\SymChk.exe -s https://msdl.microsoft.com/download/symbols -av -pf -v System.Runtime.CompilerServices.Unsafe.dll
    [SYMCHK] Searching for symbols to C:\Users\erics\.nuget\packages\system.runtime.compilerservices.unsafe\5.0.0\lib\netcoreapp2.0\System.Runtime.CompilerServices.Unsafe.dll in path https://msdl.microsoft.com/download/symbols
    SymbolCheckVersion  0x00000002
    Result              0x00000002
    DbgFilename
    DbgTimeDateStamp    0x00000000
    DbgSizeOfImage      0x00000000
    DbgChecksum         0x00000000
    PdbFilename
    PdbSignature        {00000000-0000-0000-0000-000000000000}
    PdbDbiAge           0x00000000
    [SYMCHK] [ 0x40000008 - 0x00000002 ] Checked "C:\Users\erics\.nuget\packages\system.runtime.compilerservices.unsafe\5.0.0\lib\netcoreapp2.0\System.Runtime.CompilerServices.Unsafe.dll"
    
    SYMCHK: FAILED files = 0
    SYMCHK: PASSED + IGNORED files = 1
    

    So perhaps this is the first time ILAsm is emitting PDBs in a way that SymChk can find them (perhaps it's the fitst time we're consuming 99bbb19) and SymChk doesn't like the emitted PDBs. @hoyosjs @jkotas @mikem8361 is there someone from the runtime/debugger side who can help here and have a look?

  7. changed the title [-]Missing symbols for System.Runtime.CompilerServices.Unsafe[/-] [+]Missing symbols for System.Runtime.CompilerServices.Unsafe (ilasm producing corrupt PDBs)[/+] on Dec 8, 2021
  8. ericstj commented on Dec 8, 2021

    @ericstj
    Member

    I'm having a conversation with the debugger team about this offline. To make certain we're looking at the same thing, @clairernovotny could you please confirm you're seeing the same thing around missing symbols that I am? I want to make sure that a fix to symchk / debugger apis it uses will also fix whatever mechanism you used to identify this problem to begin with.

  9. JulieLeeMSFT commented on Dec 8, 2021

    @JulieLeeMSFT
    Member

    cc @dotnet/jit-contrib.

  10. hoyosjs commented on Dec 9, 2021

    @hoyosjs
    Member

    Looking at this

    • The symbol package has a portable PDB.
    • The symbol uploading process checks for Windows PDBs and uses symreader-converter to create a full PDB. For some reason the full PDB wasn't indexed in 6.0 (we had some issues with symbol conversion in 6.0.0).
    • Symchk currently only supports full PDBs well. The PDB is valid, it's just not one symchk supports. I verified, and portable PDBs were available both in symweb and msdl. I've additionally converted them to full PDB and published them:
    [SYMCHK] Searching for symbols to E:\repos\dotnet-symuploader\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net6.0\System.Runtime.CompilerServices.Unsafe.dll in path https://msdl.microsoft.com/download/symbols
    DBGHELP: Symbol Search Path: https://msdl.microsoft.com/download/symbols
    [SYMCHK] Using search path "https://msdl.microsoft.com/download/symbols"
    DBGHELP: No header for E:\repos\dotnet-symuploader\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net6.0\System.Runtime.CompilerServices.Unsafe.dll.  Searching for image on disk
    DBGHELP: E:\repos\dotnet-symuploader\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net6.0\System.Runtime.CompilerServices.Unsafe.dll - OK
    SYMSRV:  BYINDEX: 0x1
             https://msdl.microsoft.com/download/symbols
             System.Runtime.CompilerServices.Unsafe.pdb
             7C39E25E02074F4BAEDC1C131C0461671
    SYMSRV:  UNC: C:\Debuggers\sym\System.Runtime.CompilerServices.Unsafe.pdb\7C39E25E02074F4BAEDC1C131C0461671\System.Runtime.CompilerServices.Unsafe.pdb - path not found
    SYMSRV:  UNC: C:\Debuggers\sym\System.Runtime.CompilerServices.Unsafe.pdb\7C39E25E02074F4BAEDC1C131C0461671\System.Runtime.CompilerServices.Unsafe.pd_ - path not found
    SYMSRV:  UNC: C:\Debuggers\sym\System.Runtime.CompilerServices.Unsafe.pdb\7C39E25E02074F4BAEDC1C131C0461671\file.ptr - path not found
    SYMSRV:  HTTPGET: /download/symbols/index2.txt
    SYMSRV:  HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
    SYMSRV:  HTTPGET: /download/symbols/System.Runtime.CompilerServices.Unsafe.pdb/7C39E25E02074F4BAEDC1C131C0461671/System.Runtime.CompilerServices.Unsafe.pdb
    SYMSRV:  HttpQueryInfo: 801900c8 - HTTP_STATUS_OK
    SYMSRV:  System.Runtime.CompilerServices.Unsafe.pdb from https://msdl.microsoft.com/download/symbols: 24064 bytes - copied
    SYMSRV:  PATH: C:\Debuggers\sym\System.Runtime.CompilerServices.Unsafe.pdb\7C39E25E02074F4BAEDC1C131C0461671\System.Runtime.CompilerServices.Unsafe.pdb
    SYMSRV:  RESULT: 0x00000000
    DBGHELP: System.Runtime.CompilerServices.Unsafe - private symbols & lines
            C:\Debuggers\sym\System.Runtime.CompilerServices.Unsafe.pdb\7C39E25E02074F4BAEDC1C131C0461671\System.Runtime.CompilerServices.Unsafe.pdb
    [SYMCHK] MODULE64 Info ----------------------
    [SYMCHK] Struct size: 1680 bytes
    [SYMCHK] Base: 0x400000
    [SYMCHK] Image size: 32768 bytes
    [SYMCHK] Date: 0x61734b90
    [SYMCHK] Checksum: 0x000052d8
    [SYMCHK] NumSyms: 0
    [SYMCHK] SymType: SymPDB
    [SYMCHK] ModName: System.Runtime.CompilerServices
    [SYMCHK] ImageName: E:\repos\dotnet-symuploader\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net6.0\System.Runtime.CompilerServices.Unsafe.dll
    [SYMCHK] LoadedImage: E:\repos\dotnet-symuploader\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net6.0\System.Runtime.CompilerServices.Unsafe.dll
    [SYMCHK] PDB: "C:\Debuggers\sym\System.Runtime.CompilerServices.Unsafe.pdb\7C39E25E02074F4BAEDC1C131C0461671\System.Runtime.CompilerServices.Unsafe.pdb"
    [SYMCHK] CV: RSDS
    [SYMCHK] CV DWORD: 0x53445352
    [SYMCHK] CV Data:  D:\a\_work\1\s\artifacts\obj\System.Runtime.CompilerServices.Unsafe\net6.0-Release\System.Runtime.CompilerServices.Unsafe.pdb
    [SYMCHK] PDB Sig:  0
    [SYMCHK] PDB7 Sig: {7C39E25E-0207-4F4B-AEDC-1C131C046167}
    [SYMCHK] Age: 1
    [SYMCHK] PDB Matched:  TRUE
    [SYMCHK] DBG Matched:  TRUE
    [SYMCHK] Line nubmers: TRUE
    [SYMCHK] Global syms:  TRUE
    [SYMCHK] Type Info:    FALSE
    [SYMCHK] ------------------------------------
    SymbolCheckVersion  0x00000002
    Result              0x000f0001
    DbgFilename
    DbgTimeDateStamp    0x61734b90
    DbgSizeOfImage      0x00008000
    DbgChecksum         0x000052d8
    PdbFilename         C:\Debuggers\sym\System.Runtime.CompilerServices.Unsafe.pdb\7C39E25E02074F4BAEDC1C131C0461671\System.Runtime.CompilerServices.Unsafe.pdb
    PdbSignature        {7C39E25E-0207-4F4B-AEDC-1C131C046167}
    PdbDbiAge           0x00000001
    [SYMCHK] [ 0x00000000 - 0x000f0001 ] Checked "E:\repos\dotnet-symuploader\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net6.0\System.Runtime.CompilerServices.Unsafe.dll"
    
    SYMCHK: FAILED files = 0
    SYMCHK: PASSED + IGNORED files = 1
    

    I think this is just an artifact of properly publishing symbol packages, which slipped in 6.0.0.

  11. 19 remaining items

  12. added
    Priority:2
    on Apr 24, 2023
  13. ghost added
    in-pr
    on Apr 26, 2023
  14. TIHan commented on Apr 26, 2023

    @TIHan
    Contributor

    Still work-in-progress, but I managed to add the PdbChecksum debug directory entry: #85344

  15. self-assigned this
    on Apr 27, 2023
  16. ghost removed
    in-pr
    on May 27, 2023
  17. ghost added
    in-pr
    on May 31, 2023
  18. ghost removed
    in-pr
    on Jun 30, 2023
  19. ghost added
    in-pr
    on Jul 14, 2023
  20. ghost removed
    in-pr
    on Aug 23, 2023
  21. added
    in-pr
    on Jun 4, 2024
  22. added a commit that references this issue on Jan 9, 2025
    eb0490e
  23. locked and limited conversation to collaborators on Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority:2area-ILTools-coreclrin-pr

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions