Skip to content

[cDAC] bugfix for threadstatics stored directly on ThreadLocalData#120922

Merged
rcj1 merged 1 commit intodotnet:mainfrom
rcj1:bugfix-threadstatic
Oct 21, 2025
Merged

[cDAC] bugfix for threadstatics stored directly on ThreadLocalData#120922
rcj1 merged 1 commit intodotnet:mainfrom
rcj1:bugfix-threadstatic

Conversation

@rcj1
Copy link
Contributor

@rcj1 rcj1 commented Oct 20, 2025

No description provided.

@rcj1 rcj1 requested review from Copilot and max-charlamb October 20, 2025 22:16
Copy link
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 fixes a bug in the thread-local static base address calculation for the DirectOnThreadLocalData case. The fix ensures that when thread-local statics are stored directly on ThreadLocalData, the index offset is properly added to the base pointer instead of returning just the base pointer.

Key Changes

  • Corrected the calculation of threadLocalStaticBase to include the indexOffset when handling DirectOnThreadLocalData TLS index type
  • Updated both implementation code and documentation to reflect the fix

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Thread_1.cs Fixed bug by adding indexOffset to threadLocalDataPtr for DirectOnThreadLocalData case
docs/design/datacontracts/Thread.md Updated documentation to match the corrected implementation

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Oct 20, 2025
@rcj1 rcj1 requested a review from hoyosjs October 20, 2025 22:17
@max-charlamb max-charlamb added area-Diagnostics-coreclr and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Oct 20, 2025
@dotnet-policy-service
Copy link
Contributor

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

@rcj1 rcj1 merged commit 768bb6d into dotnet:main Oct 21, 2025
50 checks passed
@rcj1 rcj1 deleted the bugfix-threadstatic branch October 21, 2025 00:14
@github-actions github-actions bot locked and limited conversation to collaborators Nov 20, 2025
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.

4 participants