[all-commits] [llvm/llvm-project] 98bc30: [lld][COFF] Fix TypeServerSource lookup on GUID co...

Tobias Hieta via All-commits all-commits at lists.llvm.org
Sat Apr 2 01:09:20 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 98bc304e9faded44f1d8988ffa4c5d8b50c759ec
      https://github.com/llvm/llvm-project/commit/98bc304e9faded44f1d8988ffa4c5d8b50c759ec
  Author: Tobias Hieta <tobias.hieta at ubisoft.com>
  Date:   2022-04-02 (Sat, 02 Apr 2022)

  Changed paths:
    M lld/COFF/DebugTypes.cpp
    A lld/test/COFF/Inputs/pdb-type-server-guid-collision-a-pdb.yaml
    A lld/test/COFF/Inputs/pdb-type-server-guid-collision-a.yaml
    A lld/test/COFF/Inputs/pdb-type-server-guid-collision-b-pdb.yaml
    A lld/test/COFF/Inputs/pdb-type-server-guid-collision-b.yaml
    A lld/test/COFF/pdb-type-server-guid-collision-invalid.test
    A lld/test/COFF/pdb-type-server-guid-collision-valid.test

  Log Message:
  -----------
  [lld][COFF] Fix TypeServerSource lookup on GUID collisions

Microsoft shipped a bunch of PDB files with broken/invalid GUIDs
which lead lld to use 0xFF as the key for these files in an internal
cache. When multiple files have this key it will lead to collisions
and confused symbol lookup.

Several approaches to fix this was considered. Including making the key
the path to the PDB file, but this requires some filesystem operations
in order to normalize the file path.

Since this only happens with malformatted PDB files and we haven't
seen this before they malformatted files where shipped with visual
studio we probably shouldn't optimize for this use-case.

Instead we now just don't insert files with Guid == 0xFF into the
cache map and warn if we get collisions so similar problems can be
found in the future instead of being silent.

Discussion about the root issue and the approach to this fix can be found on Github: https://github.com/llvm/llvm-project/issues/54487

Reviewed By: aganea

Differential Revision: https://reviews.llvm.org/D122372




More information about the All-commits mailing list