Repository navigation
Fix profiler GC heap enumeration on external threads - #132644
Merged
Merged
Conversation
|
Azure Pipelines: 16 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Copilot
AI
changed the title
[WIP] Fix gcheapenumeration.cmd test failure in CI
Fix profiler GC heap enumeration on external threads
Aug 21, 2026
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
|
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. |
noahfalk
enabled auto-merge (squash)
August 22, 2026 03:41
noahfalk
approved these changes
Aug 22, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a correctness bug in CoreCLR’s profiler heap enumeration path where an external (non-managed) profiler thread could be incorrectly treated as the runtime suspension owner when both thread pointers were nullptr, causing EnumerateGCHeapObjects to spuriously return CORPROF_E_SUSPENSION_IN_PROGRESS.
Changes:
- Capture
GetThreadNULLOk()into a local and require it to be non-null before considering the current thread the suspension owner. - Prevent the
nullptr == nullptrcomparison from triggering the “suspension owner” fast-fail path.
steveisok
approved these changes
Aug 22, 2026
Co-authored-by: noahfalk <[email protected]>
noahfalk
force-pushed
the
copilot/fix-gcheapenumeration-test-failure
branch
from
August 22, 2026 20:41
f416e96 to
5899072
Compare
steveisok
approved these changes
Aug 22, 2026
mdh1418
approved these changes
Aug 24, 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 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.
main PR
Description
EnumerateGCHeapObjectsmisidentified an external profiler thread as the suspension thread when both thread pointers were null, returningCORPROF_E_SUSPENSION_IN_PROGRESS.Customer Impact
Profiler heap enumeration during server GC can fail spuriously.
Regression
Unknown.
Testing
Existing gcheapenumeration coverage exercises the competing runtime-suspension path.
Risk
Low. The change only distinguishes two null thread pointers from actual suspension ownership.
Package authoring no longer needed in .NET 9
IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.