Skip to content

[cDAC] Fix stale Continuation MT bug#129109

Merged
rcj1 merged 1 commit into
dotnet:mainfrom
rcj1:fix-cont-bug
Jun 8, 2026
Merged

[cDAC] Fix stale Continuation MT bug#129109
rcj1 merged 1 commit into
dotnet:mainfrom
rcj1:fix-cont-bug

Conversation

@rcj1
Copy link
Copy Markdown
Contributor

@rcj1 rcj1 commented Jun 8, 2026

_continuationMethodTablePointer and _continuationSingletonEEClassPointer are not filled on startup, but on the first creation of a Continuation without metadata. Therefore, on a live target we may read a null MT if we only read upon contract creation. Update this such that if these are still null, we try again to read them.

@rcj1 rcj1 requested review from Copilot and noahfalk June 8, 2026 01:37
@rcj1 rcj1 requested review from barosiak and max-charlamb June 8, 2026 01:37
@rcj1 rcj1 changed the title Fix stale Continuation MT bug [cDAC] Fix stale Continuation MT bug Jun 8, 2026
@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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 makes continuation-related globals in the cDAC RuntimeTypeSystem contract resilient to late initialization by lazily re-reading the globals when cached values are still null, rather than only capturing them at contract construction time.

Changes:

  • Make continuation MT / singleton EEClass pointers lazily refreshed in RuntimeTypeSystem_1 when still null.
  • Add the same lazy refresh behavior in TypeValidation so MethodTable validation can succeed once the target initializes the globals.
Show a summary per file
File Description
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/RuntimeTypeSystemHelpers/TypeValidation.cs Lazily re-reads continuation globals when cached values are null, enabling validation paths to recover on live targets.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/RuntimeTypeSystem_1.cs Lazily re-reads continuation globals in the main contract implementation so IsContinuationWithoutMetadata can work after late initialization.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

@rcj1 rcj1 merged commit 1818a74 into dotnet:main Jun 8, 2026
70 of 74 checks passed
@rcj1 rcj1 deleted the fix-cont-bug branch June 8, 2026 17:34
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.

3 participants