Repository navigation
[release/10.0] Fix AV in gc_heap::init_heap_segment - #136254
Merged
ViveliDuCh merged 1 commit intoNov 14, 2026
Merged
Conversation
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
|
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 |
kkokosa
approved these changes
Oct 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 #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.