Conversation
Backport of dotnet#134127 to release/10.0. When there are multiple CPU groups on Windows, the OS can assign the current process into any of these groups. When CPU groups support is not enabled for GC, the computed CPU index can exceed processor-to-heap and NUMA-node-to-heap arrays and corrupt memory. Size these arrays from the validated maximum processor group count, including groups reserved for CPU hot-add. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: da1e6e4c-bb17-4b8b-9962-b0b5f8b38bcb
|
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. |
Contributor
|
Tagging subscribers to this area: @anicka-net, @dotnet/gc |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review issues were identified.
Pull request overview
Backports a Windows GC fix for systems with multiple processor groups, preventing out-of-bounds processor mappings.
Changes:
- Cache and validate the Windows processor-group count.
- Size GC mappings and affinity storage for the maximum processor space.
File summaries
| File | Description |
|---|---|
src/coreclr/gc/windows/gcenv.windows.cpp |
Updates processor capacity initialization and affinity allocation. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
jkotas
approved these changes
Sep 18, 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 #134127 to release/10.0.
Customer Impact
On Windows systems with multiple CPU groups, a process running in a nonzero processor group can use a packed processor index beyond the dynamically allocated GC processor-to-heap mapping. This can write past the allocation and cause heap corruption when GC CPU-group support is disabled.
The fix sizes the relevant mappings and affinity set for the maximum possible processor-group index space. It also validates and caches the Windows processor-group count during GC OS initialization.
This issue was reported by two 1st party customers independently.
Regression
Regression introduced by #131740.
Testing
Built the checked x64 CoreCLR runtime with:
src\coreclr\build-runtime.cmd -x64 -checked -component runtimeRisk
Low. This is a direct backport of the fix merged into main in #134127. The change only increases Windows GC processor-indexed allocation capacity and fails initialization if the topology API unexpectedly returns zero.
Note
This pull request description was generated with GitHub Copilot.