Summary
Commit c835d0f ("Change heap dumps to use HEAP2 as the default", #127321) causes ~75 types from non-R2R shared framework assemblies to have unresolvable names in heap dumps. These types have valid MethodTables, Modules, and mdTokens in the dump, but the PE metadata pages for their assemblies are missing, so TypeString::AppendType cannot read the type name.
Affected Assemblies
Microsoft.Extensions.Options.dll
Microsoft.Extensions.Logging.Debug.dll
Microsoft.Extensions.Logging.EventLog.dll
System.Private.CoreLib.dll (at least one type)
Evidence
Running !dumpmt on UNKNOWN types shows valid metadata except the name:
!dumpmt 00007ffa432fce58
EEClass: 00007FFA43145EB0
Module: 00007FFA42FB3EC0
Name: <error>
mdToken: 0000000002000039
File: Microsoft.Extensions.Options.dll
The old HEAP path enumerated these by iterating m_TypeDefToMethodTableMap → MethodTable::EnumMemoryRegions → Module/PEAssembly/PEImage::EnumMemoryRegions, which captured the PE metadata pages. HEAP2 relies on LoaderAllocator heap enumeration which captures the MethodTable bytes but not the referenced PE image metadata pages.
Impact
Related
/cc @hoyosjs
Summary
Commit c835d0f ("Change heap dumps to use HEAP2 as the default", #127321) causes ~75 types from non-R2R shared framework assemblies to have unresolvable names in heap dumps. These types have valid MethodTables, Modules, and mdTokens in the dump, but the PE metadata pages for their assemblies are missing, so
TypeString::AppendTypecannot read the type name.Affected Assemblies
Microsoft.Extensions.Options.dllMicrosoft.Extensions.Logging.Debug.dllMicrosoft.Extensions.Logging.EventLog.dllSystem.Private.CoreLib.dll(at least one type)Evidence
Running
!dumpmton UNKNOWN types shows valid metadata except the name:The old HEAP path enumerated these by iterating
m_TypeDefToMethodTableMap→MethodTable::EnumMemoryRegions→Module/PEAssembly/PEImage::EnumMemoryRegions, which captured the PE metadata pages. HEAP2 relies on LoaderAllocator heap enumeration which captures the MethodTable bytes but not the referenced PE image metadata pages.Impact
!timerinfocrashes withDebug.Assertwhen it hits one of these types (fixed in [cDAC] Fix GetMethodTableName empty type name mismatch #127405)!dumpheap -statshows ~75 types as UNKNOWN<error>for these typesRelated
E_OUTOFMEMORYfor empty type names (separate bug exposed by this)/cc @hoyosjs