Skip to content

[release/10.0] Fix AV in gc_heap::init_heap_segment - #136254

Merged
ViveliDuCh merged 1 commit into
dotnet:release/10.0from
janvorli:backport-131947-release-10.0
Nov 14, 2026
Merged

ViveliDuCh merged 1 commit into
dotnet:release/10.0from
janvorli:backport-131947-release-10.0

Conversation

@janvorli

Copy link
Copy Markdown
Member

Backport of #131947 to release/10.0

Customer Impact

Applications can crash with an access violation in gc_heap::init_heap_segment when concurrent GC is disabled. The customer reproduced this on .NET 10.0.11 and 10.0.13 with workstation GC and a small heap hard limit, causing process termination instead of a catchable OutOfMemoryException. Incorrect card-table layout alignment can leave the last page of the segment mapping table uncommitted.

Regression

Yes, introduced in .NET 7 in #52402

Testing

coreclr tests with and without GC stress and the new targeted test

Risk

Low. The fix removes the size check that skipped alignment for zero-sized card-table elements, ensuring the preceding element's final page is committed even when the mark array is absent. The backport applies the equivalent change in gc.cpp and includes the upstream regression test.

Backport of dotnet#131947 to release/10.0

## Customer Impact

- [x] Customer reported - dotnet#136222
- [ ] Found internally

Applications can crash with an access violation in gc_heap::init_heap_segment when concurrent GC is disabled. The customer reproduced this on .NET 10.0.11 and 10.0.13 with workstation GC and a small heap hard limit, causing process termination instead of a catchable OutOfMemoryException. Incorrect card-table layout alignment can leave the last page of the segment mapping table uncommitted.

## Regression

The issue is present in release/10.0; the release in which it was introduced has not been established.

## Testing

coreclr tests with and without GC stress and the new targeted test

## Risk

Low. The fix removes the size check that skipped alignment for zero-sized card-table elements, ensuring the preceding element's final page is committed even when the mark array is absent. The backport applies the equivalent change in gc.cpp and includes the upstream regression test and Mono exclusion.

(cherry picked from commit be210a7)

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 92975e9c-9fd5-445c-b89e-6a4b04ce7996
Copilot-Session: a18e7bad-d903-4617-be1b-28a671a711d0
@janvorli janvorli added this to the 10.0.x milestone Oct 21, 2026
@janvorli
janvorli requested a review from kkokosa October 21, 2026 23:01
@janvorli janvorli self-assigned this Oct 21, 2026
@janvorli janvorli added Servicing-consider Issue for next servicing release review area-GC-coreclr labels Oct 21, 2026
@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.

@janvorli janvorli changed the title [release/10.0] Fix AV in gc_heap::init_heap_segment (#131947) [release/10.0] Fix AV in gc_heap::init_heap_segment Oct 21, 2026
@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.

@steveisok steveisok added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Oct 26, 2026
@rbhanda rbhanda modified the milestones: 10.0.x, 10.0.16 Nov 2, 2026
@ViveliDuCh
ViveliDuCh merged commit e5616d3 into dotnet:release/10.0 Nov 14, 2026
135 of 140 checks passed
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.

5 participants