Handle DAC DefaultCOMImpl ref-counting fix (CLRDATA_REQUEST_REVISION 10)#1401
Merged
max-charlamb merged 2 commits intomicrosoft:mainfrom Mar 10, 2026
Merged
Handle DAC DefaultCOMImpl ref-counting fix (CLRDATA_REQUEST_REVISION 10)#1401max-charlamb merged 2 commits intomicrosoft:mainfrom
max-charlamb merged 2 commits intomicrosoft:mainfrom
Conversation
leculver
previously approved these changes
Mar 6, 2026
Contributor
leculver
left a comment
There was a problem hiding this comment.
Nitpick doesn't block merge, thanks!
The DAC's DefaultCOMImpl::Release() used post-decrement (mRef--) instead of pre-decrement (--mRef), leaking all DefaultCOMImpl-derived COM objects. ClrMD compensated with an extra Release() after wrapping enumerators. With the fix in dotnet/runtime#125231 (CLRDATA_REQUEST_REVISION bumped to 10), the extra Release() would prematurely free the object. Changes: - DacRuntime: Accept DAC version 9 and 10, store version on SOSDac - SOSDac: Add DacVersion property and ReleaseLeakedDacRef() helper that only releases the leaked ref when DacVersion < 10 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
7bedad7 to
52cafc4
Compare
jkotas
reviewed
Mar 7, 2026
| throw new InvalidDataException("This instance of CLR either has not been initialized or does not contain any data. This may indicate the dump was taken before the CLR was fully initialized, or the dump is corrupt or truncated. Failed to request DacVersion."); | ||
|
|
||
| if (version != 9) | ||
| if (version < 9) |
Member
There was a problem hiding this comment.
Should this also reject versions higher than 10? I do not think the future versions are expected to be compatible (as this change is demonstrating).
Future DAC versions may not be compatible, so reject unknown versions rather than accepting all versions >= 9. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
leculver
approved these changes
Mar 10, 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.
The DAC's DefaultCOMImpl::Release() used post-decrement (mRef--) instead of pre-decrement (--mRef), leaking all DefaultCOMImpl-derived COM objects. ClrMD compensated with an extra Release() after wrapping enumerators. With the fix in dotnet/runtime#125231 (CLRDATA_REQUEST_REVISION bumped to 10), the extra Release() would prematurely free the object.
Changes: