Skip to content

Conversation

max-charlamb
Copy link
Member

@max-charlamb max-charlamb commented Sep 25, 2025

resolves #119921

While working on #119965, I ran into another issue where we expect to be able to map MethodDef -> MethodDesc using the LookupMap on the module for methods on the stack in minidump scenarios. #119111 inadvertently removed the call to Module::LookupMethodDef from GetIL where it was enumerated. As a fix, I modified MethodDesc::EnumMemoryRegions to explicitly enumerate it.

Sample call stack from before #119111 was merged:

MSCORDACCORE! DacInstantiateTypeByAddressHelper + 0x70 (0x00007ffb`5edfc870)
MSCORDACCORE! Module::LookupMethodDef + 0xA4 (0x00007ffb`5ede6244)
MSCORDACCORE! ILCodeVersion::GetIL + 0xA9 (0x00007ffb`5ee83d29)
MSCORDACCORE! MethodDesc::EnumMemoryRegions + 0x670 (0x00007ffb`5ee7b540)
MSCORDACCORE! Thread::EnumMemoryRegionsWorker + 0x8E6 (0x00007ffb`5ee745a6)
MSCORDACCORE! Thread::EnumMemoryRegions + 0x364 (0x00007ffb`5ee73c94)
MSCORDACCORE! ThreadStore::EnumMemoryRegions + 0x323 (0x00007ffb`5ee74943)
MSCORDACCORE! ClrDataAccess::EnumMemDumpAllThreadsStack + 0x580 (0x00007ffb`5ee2b040)
MSCORDACCORE! ClrDataAccess::EnumMemoryRegionsWorkerSkinny + 0x52 (0x00007ffb`5ee2c8f2)
MSCORDACCORE! ClrDataAccess::EnumMemoryRegionsWrapper + 0x25 (0x00007ffb`5ee2cdb5)
MSCORDACCORE! ClrDataAccess::EnumMemoryRegions + 0x134 (0x00007ffb`5ee2cf24)

@Copilot Copilot AI review requested due to automatic review settings September 25, 2025 21:55
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds memory enumeration for method definition lookup in minidumps to fix issue #119921. The change ensures that the memory required for MethodDefLookup operations is included when enumerating memory regions for debugging purposes.

  • Adds a call to LookupMethodDef during memory region enumeration to ensure required memory is captured

Copy link
Contributor

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

@max-charlamb max-charlamb merged commit 93c2aba into main Sep 26, 2025
100 of 102 checks passed
@max-charlamb max-charlamb deleted the 119921-fix-3 branch September 26, 2025 14:03
@max-charlamb
Copy link
Member Author

/backport to release/10.0

Copy link
Contributor

Started backporting to release/10.0: https://github.com/dotnet/runtime/actions/runs/18040071260

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICorDebugStackWalk.GetFrame fails in minidump without heap/binaries in .NET 10 preview 7+
2 participants