[release/10.0] GC handle DAC bugfix#124914
Open
rcj1 wants to merge 2 commits intodotnet:release/10.0from
Open
Conversation
Contributor
|
Tagging subscribers to this area: @agocke, @dotnet/gc |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR backports a critical GC handle enumeration bugfix from #124875 to the release/10.0 branch. The issue occurs when using DATAS (Dynamic Adaptation To Application Sizes) where the number of GC heaps can differ from the processor count, causing the DAC (Data Access Component) to incompletely enumerate handle table buckets. The fix exposes the processor count via the GC DAC contract and updates handle enumeration logic to use it instead of assuming heap count equals processor count.
Changes:
- Exposes
g_totalCpuCountas a global variable on both Unix and Windows platforms for DAC access - Bumps GC interface minor version from 5 to 8 to indicate DAC contract extension
- Updates DAC handle enumeration to use processor count with backward compatibility fallback
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/gc/windows/gcenv.windows.cpp | Adds caching for g_totalCpuCount in GetTotalProcessorCount() matching Unix implementation |
| src/coreclr/gc/unix/gcenv.unix.cpp | Changes g_totalCpuCount from static to global visibility for DAC exposure |
| src/coreclr/gc/gcinterface.h | Bumps GC_INTERFACE_MINOR_VERSION from 5 to 8 |
| src/coreclr/gc/gcinterface.dacvars.def | Adds g_totalCpuCount to DAC variable definitions for v5.8 |
| src/coreclr/gc/gc.cpp | Updates PopulateDacVars to expose g_totalCpuCount pointer for server GC builds |
| src/coreclr/debug/daccess/daccess.cpp | Updates handle enumeration to use processor count from DAC contract v8+, with GCHeapCount() fallback |
hoyosjs
approved these changes
Feb 26, 2026
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.
Backport of #124875 to release/10.0
Customer Impact
This affects the GetHandleEnum, GetHandleEnumForTypes, and GetHandleEnumForGC DAC APIs. A bug was found in #124760 where the number of handle tables per bucket is assumed to be equal to the number of heaps in the server-GC mode. However, it is actually fixed at the number of processors; with DATAs enabled, these two may diverge and cause an incomplete enumeration of GC handles. This fix sets the correct bounds for this DAC APIs.
Regression
Since introduction of DATAs, handle enumeration may not be complete.
Testing
Tested locally
Risk
Low. The change corrects bounds for a single DAC enumeration loop.