Skip to content

Implement IXCLRDataTypeDefinition metadata methods in cDAC - #131365

Merged
rcj1 merged 14 commits into
mainfrom
copilot/draft-implement-getcorelementtype-getname-gettoken
Jul 30, 2026
Merged

rcj1 merged 14 commits into
mainfrom
copilot/draft-implement-getcorelementtype-getname-gettoken

Conversation

Copilot AI commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Implements cDAC-backed GetCorElementType, GetName, and GetTokenAndScope for IXCLRDataTypeDefinition.

Changes

  • Retain the module, type handle, and metadata token in ClrDataTypeDefinition.
  • Match native DAC naming, buffer, and HRESULT semantics.
  • Cross-validate cDAC results against the legacy DAC in debug builds.
  • Add coverage for outputs, invalid arguments, and buffer truncation.

Note

This description was generated by GitHub Copilot.

Copilot AI and others added 5 commits July 25, 2026 04:15
Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 25, 2026 04:26

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 was unable to review this pull request because there is no eligible user to bill. To allow Copilot reviews on bot-authored pull requests, enable direct organization billing in your organization's Copilot settings.

@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.

Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 25, 2026 04:54

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 was unable to review this pull request because there is no eligible user to bill. To allow Copilot reviews on bot-authored pull requests, enable direct organization billing in your organization's Copilot settings.

Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 25, 2026 04:55

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 was unable to review this pull request because there is no eligible user to bill. To allow Copilot reviews on bot-authored pull requests, enable direct organization billing in your organization's Copilot settings.

Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 25, 2026 06:06

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 was unable to review this pull request because there is no eligible user to bill. To allow Copilot reviews on bot-authored pull requests, enable direct organization billing in your organization's Copilot settings.

Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 25, 2026 06:34

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 was unable to review this pull request because there is no eligible user to bill. To allow Copilot reviews on bot-authored pull requests, enable direct organization billing in your organization's Copilot settings.

Copilot finished work on behalf of rcj1 July 25, 2026 06:36
@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 marked this pull request as ready for review July 27, 2026 18:08
@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.

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

  • Files reviewed: 3/3 changed files
  • Comments generated: 3

Copilot AI review requested due to automatic review settings July 29, 2026 21:32

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

Comments suppressed due to low confidence (1)

src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ClrDataTypeDefinition.cs:123

  • In the DEBUG cross-validation, new(nameBuf) assumes nameBuf is null-terminated. If the caller passes a non-null buffer with bufLen == 0, CopyStringToBuffer won't write a terminator and new string(nameBuf) can read past the caller’s buffer and crash/debug-assert unpredictably. Guard the string comparisons on bufLen > 0 (or otherwise ensure termination) before constructing strings from the caller-provided pointer.
                    if (nameBuf is not null)
                    {
                        string dacName = new(pNameBufLocal);
                        string cdacName = new(nameBuf);
                        Debug.Assert(dacName == cdacName, $"cDAC: {cdacName}, DAC: {dacName}");
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new

Copilot AI review requested due to automatic review settings July 29, 2026 21:47

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

Comments suppressed due to low confidence (1)

src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ClrDataTypeDefinition.cs:124

  • In the DEBUG cross-validation block, the string comparison uses new string(nameBuf) even when bufLen == 0. In that case OutputBufferHelpers.CopyStringToBuffer doesn't write a null terminator, and new string(char*) can read past the caller-provided buffer (potential AV) during debug-only validation. Guard the string construction/comparison so it only runs when there is at least 1 character of buffer.
                    if (nameBuf is not null)
                    {
                        string dacName = new(pNameBufLocal);
                        string cdacName = new(nameBuf);
                        Debug.Assert(dacName == cdacName, $"cDAC: {cdacName}, DAC: {dacName}");
                    }
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new

@rcj1
rcj1 enabled auto-merge (squash) July 29, 2026 22:53
@rcj1
rcj1 merged commit 7028c47 into main Jul 30, 2026
72 checks passed
@rcj1
rcj1 deleted the copilot/draft-implement-getcorelementtype-getname-gettoken branch July 30, 2026 01:14
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc1 milestone Jul 30, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 30, 2026
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.

5 participants