[cDAC] Preserve basic object type input - #131836
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 67f1c1e2-7373-4c6b-8c81-b0442336bcdd
|
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. |
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
hoyosjs
approved these changes
Aug 4, 2026
rcj1
enabled auto-merge (squash)
August 4, 2026 22:43
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes GetBasicObjectInfo to treat pObjTypeData as a true in/out parameter by preserving the caller-provided struct contents on failure (e.g., invalid object references), aligning behavior with the intended contract for this API.
Changes:
- Stop zeroing
*pObjTypeDataat the start ofDacDbiImpl.GetBasicObjectInfo, so caller-initialized type info isn’t clobbered when the reference is invalid. - Update the
IDacDbiInterface::GetBasicObjectInfoIDL signature to markpObjTypeDataas[in, out]rather than[out].
Show a summary per file
| File | Description |
|---|---|
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs | Preserves the caller-provided DebuggerIPCE_ExpandedTypeData when the object reference is invalid. |
| src/coreclr/inc/dacdbi.idl | Updates the IDL contract to reflect pObjTypeData as an in/out parameter. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 1
hoyosjs
approved these changes
Aug 4, 2026
tommcdon
approved these changes
Aug 4, 2026
Contributor
There was a problem hiding this comment.
Copilot's findings
Suppressed comments (1)
src/coreclr/debug/inc/dacdbiinterface.h:1698
- The comment and IDL now describe
pObjTypeDataas an in/out parameter, but the C++ interface signature still annotates it asOUT. That makes the contract inconsistent and can mislead call sites and reviewers about whether the incoming contents must be preserved/considered. Update the signature to drop theOUTannotation (or otherwise mark it in/out) forpObjTypeData.
// in/out: pObjTypeData - expanded type information for the object
// Note: returns an appropriate failure HRESULT on error
virtual HRESULT STDMETHODCALLTYPE GetBasicObjectInfo(CORDB_ADDRESS objectAddress, OUT BOOL * pIsValidRef, OUT UINT * pObjSize, OUT UINT * pObjOffsetToVars, OUT DebuggerIPCE_ExpandedTypeData * pObjTypeData) = 0;
- Files reviewed: 3/3 changed files
- Comments generated: 0 new
Contributor
Author
|
/ba-g everything is green except "build monitor helix jobs" |
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.
This is an inout param. Found via assert in an internal diagnostic test.