Skip to content

Conversation

@tommcdon
Copy link
Member

Ports #115562

Customer Impact

  • Customer reported
  • Found internally

Addresses a customer reported issue in minidump generation. The DAC implements ICLRDataEnumMemoryRegions::EnumMemoryRegions which is used by dbghelp!MiniDumpWriteDump to mark pages in the process that must be saved for actionable dumps. As some memory enumeration API's might fail at dump collection time, we implement try/catch blocks around the logic that collects memory pages so that the entire process is not aborted. We have a customer report on an issue resulting in corrupted mini-dumps, missing memory needed for stackwalking. The issue was narrowed down to a call to GetIL on an InlinedCallFrame causes an exception to be thrown during memory enumeration, resulting in skipping over other memory collection API's that would have succeeded and in turn creating a minidump missing memory needed for stackwalking. The fix addresses the issue by wrapping the IL version method calls at a lower-level with a nested try-catch block to ensure that an exception in GetIL doesn’t prevent dumping a full callstack.

Regression

  • Yes (Works well on .NET Framework)
  • No

Testing

Manually tested, the customer verified

Risk

Low risk, we are adding a more granular try/catch around dump generation code

This PR addresses a minidump generation issue by wrapping IL version method calls with a try-catch block to ensure that an exception in GetIL doesn’t prevent dumping a full callstack.

Wraps GetIL and related ILCodeVersion calls in an exception block
Uses EX_CATCH_RETHROW_ONLY_COR_E_OPERATIONCANCELLED to selectively rethrow only specific exceptions
@tommcdon tommcdon added this to the 9.0.x milestone May 28, 2025
@tommcdon tommcdon requested a review from thaystg May 28, 2025 01:52
@tommcdon tommcdon self-assigned this May 28, 2025
@Copilot Copilot AI review requested due to automatic review settings May 28, 2025 01:52
Copy link
Contributor

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 addresses an issue with minidump generation by adding a nested try/catch block around IL version method calls to ensure that exceptions from GetIL do not abort memory enumeration.

  • Adds a try block wrapping ilVersion method calls
  • Introduces a catch that rethrows only OperationCancelled exceptions to preserve full dump generation

ilVersion.GetVersionId();
ilVersion.GetRejitState();
ilVersion.GetIL();
EX_TRY
Copy link

Copilot AI May 28, 2025

Choose a reason for hiding this comment

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

Consider adding an inline comment within the try/catch block to explain why only OperationCancelled exceptions are rethrown. This will help future maintainers understand the specific exception handling strategy.

Copilot uses AI. Check for mistakes.
@tommcdon
Copy link
Member Author

Closing as a dupe to #115738

@tommcdon tommcdon closed this May 28, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jun 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants