Handle DAC DefaultCOMImpl ref-counting fix (SOS_BREAKING_CHANGE_VERSION 6)#1398
Merged
max-charlamb merged 2 commits intomicrosoft:mainfrom Mar 5, 2026
Merged
Handle DAC DefaultCOMImpl ref-counting fix (SOS_BREAKING_CHANGE_VERSION 6)#1398max-charlamb merged 2 commits intomicrosoft:mainfrom
max-charlamb merged 2 commits intomicrosoft:mainfrom
Conversation
Contributor
Author
|
@microsoft-github-policy-service agree company="Microsoft" |
Contributor
There was a problem hiding this comment.
Pull request overview
Adapts ClrMD’s DAC COM-wrapper handling to account for the ref-counting fix in newer DACs by querying SOS_BREAKING_CHANGE_VERSION and conditionally skipping the legacy “extra Release” workaround.
Changes:
- Added
SosDac9wrapper to callISOSDacInterface9::GetBreakingChangeVersion(). - Introduced
SOSDac.BreakingChangeVersionand centralized the legacy ref-count “leak” workaround inReleaseLeakedDacRef. - Wired new interface creation and disposal into
ClrDataProcessandDacServiceProvider.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Microsoft.Diagnostics.Runtime/DacInterface/SosDac9.cs | Adds COM wrapper for ISOSDacInterface9 breaking-change version query. |
| src/Microsoft.Diagnostics.Runtime/DacInterface/SosDac.cs | Stores breaking-change version and gates the legacy extra-Release() workaround behind a helper. |
| src/Microsoft.Diagnostics.Runtime/DacInterface/ClrDataProcess.cs | Adds factory to query/create SosDac9 via QueryInterface. |
| src/Microsoft.Diagnostics.Runtime/DacImplementation/DacServiceProvider.cs | Instantiates/disposes SosDac9 and populates SOSDac.BreakingChangeVersion. |
src/Microsoft.Diagnostics.Runtime/DacImplementation/DacServiceProvider.cs
Show resolved
Hide resolved
leculver
previously approved these changes
Mar 5, 2026
| private volatile Dictionary<ulong, string>? _frameNames; | ||
|
|
||
| // SOS_BREAKING_CHANGE_VERSION from ISOSDacInterface9::GetBreakingChangeVersion() | ||
| internal int BreakingChangeVersion { get; set; } |
Contributor
There was a problem hiding this comment.
nit: This is an internal class, and most of clrmd marks these properties as public on an internal class. (Though I know it's probably not consistent.)
leculver
approved these changes
Mar 5, 2026
hoyosjs
approved these changes
Mar 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adapts ClrMD to handle the DAC ref-counting fix in dotnet/runtime#125231.
Adds SosDac9 wrapper for ISOSDacInterface9::GetBreakingChangeVersion(), and extracts a
ReleaseLeakedDacRef()helper that skips the extraRelease()whenBreakingChangeVersion >= 6.