Skip to content

Remove concurrent verify_soh_segment_list call in background_sweep#129873

Open
janvorli wants to merge 1 commit into
dotnet:mainfrom
janvorli:fix-verify-soh-segment-list
Open

Remove concurrent verify_soh_segment_list call in background_sweep#129873
janvorli wants to merge 1 commit into
dotnet:mainfrom
janvorli:fix-verify-soh-segment-list

Conversation

@janvorli

Copy link
Copy Markdown
Member

The removed call site runs inside the concurrent background sweep loop, after restart_EE(), when allocations and SOH segment-list mutations can run on other threads. verify_soh_segment_list assumes stable list topology while it walks generation links, so calling it in this window can observe in-flight updates and report false verification failures. We keep verification at synchronized GC phase boundaries and remove only this racy in-loop invocation.

Close #129723

The removed call site runs inside the concurrent background sweep loop,
after restart_EE(), when allocations and SOH segment-list mutations can
run on other threads. verify_soh_segment_list assumes stable list
topology while it walks generation links, so calling it in this window
can observe in-flight updates and report false verification failures. We
keep verification at synchronized GC phase boundaries and remove only
this racy in-loop invocation.
@janvorli janvorli added this to the 11.0.0 milestone Jun 26, 2026
@janvorli janvorli requested a review from kkokosa June 26, 2026 00:05
@janvorli janvorli self-assigned this Jun 26, 2026
Copilot AI review requested due to automatic review settings June 26, 2026 00:05
@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 removes an in-loop call to verify_soh_segment_list() from gc_heap::background_sweep() to avoid racy heap verification while the EE is restarted and concurrent allocations may be mutating the SOH segment list.

Changes:

  • Removed verify_soh_segment_list() invocation from the concurrent background sweep loop (segment-to-segment progression).

Comment thread src/coreclr/gc/background.cpp
@mangod9

mangod9 commented Jun 26, 2026

Copy link
Copy Markdown
Member

is this a regression from 10?

@janvorli

Copy link
Copy Markdown
Member Author

@mangod9 I don't know, I haven't checked if it was failing before.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants