Skip to content

[cDAC] Preserve basic object type input - #131836

Merged
rcj1 merged 2 commits into
dotnet:mainfrom
rcj1:fix-bug-6
Aug 5, 2026
Merged

[cDAC] Preserve basic object type input#131836
rcj1 merged 2 commits into
dotnet:mainfrom
rcj1:fix-bug-6

Conversation

@rcj1

@rcj1 rcj1 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

This is an inout param. Found via assert in an internal diagnostic test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 67f1c1e2-7373-4c6b-8c81-b0442336bcdd
Copilot AI review requested due to automatic review settings August 4, 2026 22:40
@rcj1
rcj1 requested review from hoyosjs and max-charlamb August 4, 2026 22:41
@rcj1 rcj1 removed their assignment Aug 4, 2026
@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.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@rcj1
rcj1 enabled auto-merge (squash) August 4, 2026 22:43

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 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 *pObjTypeData at the start of DacDbiImpl.GetBasicObjectInfo, so caller-initialized type info isn’t clobbered when the reference is invalid.
  • Update the IDacDbiInterface::GetBasicObjectInfo IDL signature to mark pObjTypeData as [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

Comment thread src/coreclr/inc/dacdbi.idl
Copilot AI review requested due to automatic review settings August 4, 2026 22:56

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.

Copilot's findings

Suppressed comments (1)

src/coreclr/debug/inc/dacdbiinterface.h:1698

  • The comment and IDL now describe pObjTypeData as an in/out parameter, but the C++ interface signature still annotates it as OUT. 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 the OUT annotation (or otherwise mark it in/out) for pObjTypeData.
    //     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

@rcj1

rcj1 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

/ba-g everything is green except "build monitor helix jobs"

@rcj1
rcj1 merged commit 173e6b4 into dotnet:main Aug 5, 2026
137 of 139 checks passed
@rcj1
rcj1 deleted the fix-bug-6 branch August 5, 2026 01:23
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc1 milestone Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants