Skip to content

HEAP2 heap dumps missing PE metadata for ~75 types from non-R2R shared framework assemblies #127408

@max-charlamb

Description

@max-charlamb

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_TypeDefToMethodTableMapMethodTable::EnumMemoryRegionsModule/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

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions