Skip to content

Order sync-table lookups and SyncBlock publication - #135179

Merged
jkotas merged 18 commits into
mainfrom
copilot/fix-concurrent-sync-table-growth
Oct 5, 2026
Merged

jkotas merged 18 commits into
mainfrom
copilot/fix-concurrent-sync-table-growth

Conversation

Copilot AI commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Passive lookups must acquire the object-header bits before resolving the index through g_pSyncTable; this prevents combining an older table base with a newer index. Initialized SyncBlocks are release-published before a newly allocated index is published.

  • Lookup: Acquire the header bits, validate/decode the SyncBlock index, then read the indexed table entry.
  • Publication: Store the fully initialized SyncBlock before publishing a newly allocated index.
  • Cleanup: Remove obsolete precious/disposable state and unused GC cleanup helpers.

Fixes #134252

@azure-pipelines

azure-pipelines Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 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: jkotas <6668460+jkotas@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix concurrent sync-table growth to prevent out of bounds reads Order sync-table lookups and SyncBlock publication Oct 4, 2026
Copilot AI requested a review from jkotas October 4, 2026 03:37
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke
See info in area-owners.md if you want to be subscribed.

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 review overview

🔵 Needs a closer look

These VM memory-ordering changes need maintainer review and optimized x64/Arm64 correctness and performance validation.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Addresses #134252 by ordering CoreCLR sync-table lookups and publishing fully initialized SyncBlocks without adding reader locks.

Changes:

  • Acquire-load the header index, table, and entry while preserving DAC access.
  • Set lifetime metadata before release-publishing SyncBlocks.
  • Route RCW and ETW readers through acquire loads.

No builds, tests, or benchmarks were run.

File Description
src/​coreclr/​vm/​syncblk.h Adds ordered acquire lookups and preserves DAC access.
src/​coreclr/​vm/​syncblk.cpp Orders validation reads and SyncBlock publication.
src/​coreclr/​vm/​runtimecallablewrapper.h Updates RCW object and block lookups.
src/​coreclr/​vm/​runtimecallablewrapper.cpp Acquire-loads the block during RCW initialization.
src/​coreclr/​vm/​eventtrace_bulktype.cpp Updates ETW table and block reads.

Comment thread src/coreclr/vm/syncblk.h
Comment thread src/coreclr/vm/syncblk.h Outdated
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Copilot AI requested a review from jkotas October 4, 2026 06:01
Comment thread src/coreclr/vm/runtimecallablewrapper.h Outdated
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Copilot AI requested a review from jkotas October 4, 2026 06:20
Comment thread src/coreclr/vm/syncblk.h Outdated
Comment thread src/coreclr/vm/runtimecallablewrapper.h Outdated
Comment thread src/coreclr/vm/runtimecallablewrapper.cpp Outdated
Comment thread src/coreclr/vm/syncblk.h Outdated
Comment thread src/coreclr/vm/syncblk.h Outdated
Comment thread src/coreclr/vm/syncblk.h Outdated
Comment thread src/coreclr/vm/comcallablewrapper.cpp Outdated

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 review overview

🔵 Needs a closer look

Lock-free publication and GC-lifetime changes require final maintainer review and architecture-specific validation beyond this source-only assessment.

Review effort: Balanced
Findings: 2 Low severity

Open (2)
Resolved since last review (1)

Comment thread src/coreclr/vm/syncblk.cpp
Comment thread src/coreclr/vm/syncblk.h
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>

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 review overview

🔵 Needs a closer look

The lock-free memory-ordering changes warrant maintainer confirmation and optimized x64/Arm64 concurrent-growth validation.

Review effort: Balanced
Findings: None

Resolved since last review (2)

@jkotas
jkotas marked this pull request as ready for review October 5, 2026 06:12
Comment thread src/coreclr/vm/syncblk.h
Comment thread src/coreclr/vm/syncblk.h
@jkotas
jkotas merged commit a95fccd into main Oct 5, 2026
112 of 114 checks passed
@jkotas
jkotas deleted the copilot/fix-concurrent-sync-table-growth branch October 5, 2026 20:53
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 6, 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.

Concurrent sync-table growth can make monitor and hash lookup read out of bounds

4 participants