Skip to content

Conversation

@max-charlamb
Copy link
Member

@max-charlamb max-charlamb commented Aug 19, 2025

#118702 (review)

Modifies the Target to throw VirtualReadException when there is a failure when doing a virtual read. This has an HResult of CORDBG_E_READVIRTUAL_FAILURE matching the DACs return in the same scenario.

Note, global reads continue to throw InvalidOperationException as these don't trigger a virtual read, but return a value from a dictionary.

Copilot AI review requested due to automatic review settings August 19, 2025 17:54
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 introduces a new specific exception type VirtualReadException to replace the generic InvalidOperationException for virtual memory read failures in the cDAC diagnostic component. This provides better error handling specificity and clearer debugging information.

Key changes:

  • Introduces VirtualReadException class with appropriate HResult for virtual read failures
  • Replaces InvalidOperationException catches/throws with VirtualReadException throughout the codebase
  • Updates method signatures and documentation to reflect the new exception type

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
VirtualReadException.cs New exception class specifically for virtual read failures with proper HResult
CorDbHResults.cs Made class public and moved to correct namespace for wider accessibility
ContractDescriptorTarget.cs Updated read methods to throw VirtualReadException and updated method signatures
Target.cs Added exception documentation to abstract methods and updated Write method signature
ClrDataModule.cs Updated catch block to handle VirtualReadException instead of InvalidOperationException
SOSDacImpl.cs Removed redundant catch block for InvalidOperationException
PrintfStressMessageFormatter.cs Updated exception handling for string read operations
AMD64Unwinder.cs Updated exception handling for memory read failures

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @steveisok, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

@rcj1 rcj1 left a comment

Choose a reason for hiding this comment

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

LGTM

@max-charlamb max-charlamb merged commit 34d517f into dotnet:main Aug 19, 2025
48 checks passed
@max-charlamb max-charlamb deleted the cdac-virtual-read-failure branch August 19, 2025 21:31
@github-actions github-actions bot locked and limited conversation to collaborators Sep 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants