[cDAC] Add continuation support to RuntimeTypeSystem#124918
Open
max-charlamb wants to merge 3 commits intodotnet:mainfrom
Open
[cDAC] Add continuation support to RuntimeTypeSystem#124918max-charlamb wants to merge 3 commits intodotnet:mainfrom
max-charlamb wants to merge 3 commits intodotnet:mainfrom
Conversation
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds continuation MethodTable identification to the cDAC RuntimeTypeSystem contract, enabling proper validation of dynamically-created continuation types used by the async continuation feature. Continuations are similar to arrays in that they are dynamically created and share EEClasses, requiring special handling in the MT→EEClass→MT validation roundtrip.
Changes:
- Exposes the
g_pContinuationClassIfSubTypeCreatedglobal pointer to cDAC for continuation identification - Adds
IsContinuation(TypeHandle)API to detect continuation types by checking parent MethodTable - Fixes TypeValidation to handle continuation MTs alongside arrays and generic instantiations
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/vm/datadescriptor/datadescriptor.inc | Exposes g_pContinuationClassIfSubTypeCreated as ContinuationMethodTable global pointer |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IRuntimeTypeSystem.cs | Adds IsContinuation method to contract interface with documentation |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Constants.cs | Adds ContinuationMethodTable constant name |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/RuntimeTypeSystemFactory.cs | Reads continuation MT global using TryReadGlobalPointer (handles missing global gracefully) |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/RuntimeTypeSystem_1.cs | Implements IsContinuation by comparing parent MT to continuation global pointer |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/RuntimeTypeSystemHelpers/TypeValidation.cs | Adds continuation check to MT→EEClass→MT validation logic alongside arrays/generics |
| src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.RuntimeTypeSystem.cs | Adds test infrastructure for continuation MT global pointer |
| src/native/managed/cdac/tests/MethodTableTests.cs | Adds 4 comprehensive test methods covering true positive, true negative, null global, and CanonMT validation scenarios |
a8e1857 to
492067a
Compare
bc36272 to
983ba05
Compare
...dac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/RuntimeTypeSystemFactory.cs
Show resolved
Hide resolved
noahfalk
approved these changes
Mar 3, 2026
983ba05 to
93df3d5
Compare
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.
Summary
Add IsContinuation to the cDAC RuntimeTypeSystem contract, enabling the cDAC to identify and validate continuation MethodTables created by the async continuation feature.
Continuations are dynamically-created MethodTables (similar to arrays) whose parent is the base
Continuationclass stored ing_pContinuationClassIfSubTypeCreated. Without this change, the cDAC's MT→EEClass→MT validation roundtrip would reject valid continuation MTs.Related discussion: #124780 (comment)
Changes
datadescriptor.inc— Exposeg_pContinuationClassIfSubTypeCreatedasContinuationMethodTableglobal pointerIRuntimeTypeSystem.cs— AddIsContinuation(TypeHandle)to the contract interfaceRuntimeTypeSystem_1.cs— ImplementIsContinuationby checkingParentMethodTable == continuationMethodTablePointerRuntimeTypeSystemFactory.cs— Read the continuation MT global (gracefully handles missing global viaTryReadGlobalPointer)TypeValidation.cs— Fix MT→EEClass→MT validation to allow continuations (like arrays/generics)Constants.cs— AddContinuationMethodTableconstant name