Skip to content

[release/8.0-staging] Fix generation of minidump (#115562) #116052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 8.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 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 aims to address a customer-reported issue where an exception in GetIL causes incomplete minidump generation. The changes add a nested try/catch block around IL version method calls to ensure that an exception from GetIL does not prevent processing of other memory regions.

  • Added a try/catch block around IL version method calls.
  • Restricted exception rethrowing to COR_E_OPERATIONCANCELLED.
Comments suppressed due to low confidence (1)

src/coreclr/vm/method.cpp:3797

  • [nitpick] The nested try/catch block around IL version calls improves minidump reliability, but please confirm that handling only COR_E_OPERATIONCANCELLED is sufficient for this context. It may be helpful to document the reasoning for limiting the catch to this exception type.
              ilVersion.GetIL();

@tommcdon
Copy link
Member Author

tommcdon commented May 28, 2025

Closing as a dupe to #115739

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

Successfully merging this pull request may close these issues.

2 participants