Skip to content

Suppress DOTNET_GCHeapAffinitizeRanges during crossgen2 execution#130381

Open
jtschuster wants to merge 2 commits into
dotnet:mainfrom
jtschuster:jtschuster-cuddly-spoon
Open

Suppress DOTNET_GCHeapAffinitizeRanges during crossgen2 execution#130381
jtschuster wants to merge 2 commits into
dotnet:mainfrom
jtschuster:jtschuster-cuddly-spoon

Conversation

@jtschuster

Copy link
Copy Markdown
Member

The GetConfigurationVariables test sets DOTNET_GCHeapAffinitizeRanges=1. crossgen2 embeds Server GC, which parses this affinity config at heap init. On Windows the value must use the group:index format, so the bare "1" is invalid and the runtime aborts before Main
(CLR_E_GC_BAD_AFFINITY_CONFIG_FORMAT), crashing crossgen2 with exit -1.

Add DOTNET_GCHeapAffinitizeRanges to the crossgen2 environment-variable suppression list (alongside DOTNET_GCName/GCStress/HeapVerify/ReadyToRun) so crossgen2, a build tool, does not inherit the test target process's GC affinity configuration.

Fixes #130289

The GetConfigurationVariables test sets DOTNET_GCHeapAffinitizeRanges=1.
crossgen2 embeds Server GC, which parses this affinity config at heap
init. On Windows the value must use the group:index format, so the bare
"1" is invalid and the runtime aborts before Main
(CLR_E_GC_BAD_AFFINITY_CONFIG_FORMAT), crashing crossgen2 with exit -1.

Add DOTNET_GCHeapAffinitizeRanges to the crossgen2 environment-variable
suppression list (alongside DOTNET_GCName/GCStress/HeapVerify/ReadyToRun)
so crossgen2, a build tool, does not inherit the test target process's GC
affinity configuration.

Fixes dotnet#130289

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 8, 2026 21:59

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.

Pull request overview

Updates the crossgen2 execution scripts used by src/tests to ensure crossgen2 (a build tool invoked during ReadyToRun test compilation) does not inherit GC-affinity configuration from the test environment.

Changes:

  • Add DOTNET_GCHeapAffinitizeRanges to the list of DOTNET_* variables suppressed during crossgen2 execution in the bash snippet.
  • Add DOTNET_GCHeapAffinitizeRanges to the variables cleared under setlocal for the Windows batch snippet (scoped to crossgen2/R2RDump invocation).

@jtschuster

Copy link
Copy Markdown
Member Author

/azp run runtime-coreclr outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@jtschuster jtschuster requested a review from davidwrighton July 9, 2026 18:22
@JulieLeeMSFT JulieLeeMSFT added the Priority:1 Work that is critical for the release, but we could probably ship without label Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-ReadyToRun Priority:1 Work that is critical for the release, but we could probably ship without

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Test failure: GC/API/GC/GetConfigurationVariables/GetConfigurationVariables.cmd

3 participants