[release/8.0-staging] [GC] Fix freelist crash - don't modify during check-only operation#104992
Merged
markples merged 1 commit intorelease/8.0-stagingfrom Jul 25, 2024
Merged
Conversation
Contributor
|
Tagging subscribers to this area: @dotnet/gc |
jeffschwMSFT
approved these changes
Jul 16, 2024
Member
jeffschwMSFT
left a comment
There was a problem hiding this comment.
lgtm. we will take for consideration in 8.0.x
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 #104876 to release/8.0-staging
/cc @markples
Customer Impact
GC can crash in region code if GC.RegisterForFullGCNotification is used.
Regression
Regression is part of general move to regions, but specific code was introduced in #48691
Testing
The behavior is very difficult to repro and likely hadn't occurred before because it relies on a race condition, a region allocation failing, and GC.RegisterForFullGCNotification be used. I built a custom GC that always triggers the region allocation failure path and was able to repro and verify the fix in GCPerfSim.
Risk
Low: only impacts GC.RegisterForFullGCNotification path; only impacts notifications; may cause a notification for a full GC to be skipped, but only in a case where no other reasons for full gc occur -and- the code would be subject to the race condition and crash