Skip to content

[release/10.0] Fix g_gc_lowest_address updating - #131432

Open
janvorli wants to merge 1 commit into
dotnet:release/10.0from
janvorli:port-fix-gc-lowest-address-updating
Open

[release/10.0] Fix g_gc_lowest_address updating#131432
janvorli wants to merge 1 commit into
dotnet:release/10.0from
janvorli:port-fix-gc-lowest-address-updating

Conversation

@janvorli

@janvorli janvorli commented Jul 27, 2026

Copy link
Copy Markdown
Member

Backport of #131324 to release/10.0

Customer Impact

There is a rare issue that occurs when virtual memory blocks allocated by GC end up getting addresses that trigger a code path where the GC address space range maintained by GC in g_gc_lowest_address .. g_gc_highest_address is expanded down and the g_gc_lowest_address is exactly 2/3 of the g_gc_highest_address. We end up setting the g_gc_lowest_address to 0

This leads to crashes during GC because it starts considering NULL references as valid references being part of the GC heap.

Regression

  • Yes
  • No

Testing

Regular coreclr / libraries tests.

Risk

Low. The change just makes single condition correct for the edge case causing the issue.

@janvorli janvorli added this to the 10.0.x milestone Jul 27, 2026
@janvorli
janvorli requested a review from kkokosa July 27, 2026 17:51
@janvorli janvorli self-assigned this Jul 27, 2026
Copilot AI review requested due to automatic review settings July 27, 2026 17:51
@janvorli janvorli added Servicing-consider Issue for next servicing release review area-GC-coreclr labels Jul 27, 2026
@janvorli
janvorli temporarily deployed to copilot-pat-pool July 27, 2026 17:52 — with GitHub Actions Inactive
@janvorli
janvorli temporarily deployed to copilot-pat-pool July 27, 2026 17:52 — with GitHub Actions Inactive
@azure-pipelines

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.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @anicka-net, @dotnet/gc
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.

Pull request overview

This PR backports a CoreCLR GC fix to release/10.0 to prevent g_gc_lowest_address from being incorrectly updated to 0 in a rare address-space edge case, which could cause GC to treat NULL references as heap references and crash.

Changes:

  • Fixes an edge-condition comparison (>>=) when expanding the GC address range downward so the lowest address is clamped to OS_PAGE_SIZE instead of becoming 0.

@JulieLeeMSFT JulieLeeMSFT added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jul 27, 2026
@JulieLeeMSFT

Copy link
Copy Markdown
Member

@janvorli, it's approved. Please get code review and check test results after CI done.

@JulieLeeMSFT

Copy link
Copy Markdown
Member

@kkokosa, please do code review. I need a sign-off to merge a servicing PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-GC-coreclr Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants