Skip to content

[WIP] Test fix for diagnostics failure - #131777

Draft
rcj1 wants to merge 1 commit into
dotnet:mainfrom
rcj1:test-method-instance
Draft

[WIP] Test fix for diagnostics failure#131777
rcj1 wants to merge 1 commit into
dotnet:mainfrom
rcj1:test-method-instance

Conversation

@rcj1

@rcj1 rcj1 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@rcj1 rcj1 added the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Aug 3, 2026
Copilot AI review requested due to automatic review settings August 3, 2026 22:52
@rcj1 rcj1 added the NO-REVIEW Experimental/testing PR, do NOT review it label Aug 3, 2026
@rcj1
rcj1 had a problem deploying to copilot-pat-pool August 3, 2026 22:53 — with GitHub Actions Failure
@rcj1 rcj1 self-assigned this Aug 3, 2026
@rcj1
rcj1 temporarily deployed to copilot-pat-pool August 3, 2026 22:53 — with GitHub Actions Inactive
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adjusts legacy cDAC vs native DAC behavior validation and exception handling in method-instance enumeration paths used by SOS-style COM interfaces, seemingly to address a diagnostics/test failure involving HRESULT mismatches between implementations.

Changes:

  • Removes legacy fallback behavior on exceptions in IXCLRDataProcess.EnumMethodInstanceByAddress, returning the exception HRESULT instead.
  • Relaxes DEBUG-only HRESULT validation in IXCLRDataMethodDefinition.EnumInstance to allow cDAC success when the legacy DAC fails (AllowCdacSuccess).
Show a summary per file
File Description
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/SOSDacImpl.IXCLRDataProcess.cs Changes exception handling for per-item method-instance enumeration (removes legacy fallback).
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ClrDataMethodDefinition.cs Updates DEBUG HRESULT validation mode to tolerate cDAC success when legacy DAC fails.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment on lines 1006 to 1009
catch (System.Exception ex)
{
// The cDAC's IterateMethodInstances() implementation is incomplete compared
// to the native DAC's EnumMethodInstances::Next(). The native DAC uses a
// MethodIterator backed by AppDomain assembly iteration with EX_TRY/EX_CATCH
// error handling around each step. The cDAC re-implements this with
// IterateModules()/IterateMethodInstantiations()/IterateTypeParams() which
// call into IRuntimeTypeSystem and ILoader contracts. These contract calls
// (e.g. GetMethodTable, GetTypeHandle, GetMethodDescForSlot, GetModule,
// GetTypeDefToken) can throw when encountering method descs or type handles
// from assemblies/modules that the cDAC cannot fully process. This has been
// observed for generic method instantiations (cases 2-4 in
// IterateMethodInstances) in the SOS.WebApp3 integration test.
//
// Fall back to the legacy DAC result when available, otherwise propagate the error.
if (_legacyProcess is not null)
{
hr = hrLocal;
method.Interface = legacyMethod;
}
else
{
hr = ex.HResult;
}
hr = ex.HResult;
}
{
hr = ex.HResult;
}
hr = ex.HResult;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this mean that the underlying issue is already resolved and SOS.WebApp3 no longer fails in situations where the legacy DAC would have succeeded?

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

Labels

area-Diagnostics-cdac NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) NO-REVIEW Experimental/testing PR, do NOT review it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants