Repository navigation
Remove invalid live-target assert in cDAC DacEnumerableHash - #130629
Merged
max-charlamb merged 3 commits intoJul 13, 2026
Merged
max-charlamb merged 3 commits into
max-charlamb merged 3 commits into
Conversation
Debug.Assert(Count == entries.Count) is only valid for a quiescent table (the frozen-dump case the native DAC walker assumes). The cDAC stress harness reads this hash from a LIVE process where the runtime may be growing the table (new bucket array chained via SLOT_NEXT with entries migrating), so the stored Count legitimately diverges from a single-snapshot bucket walk. This only affects Debug/Checked cDAC builds. Co-authored-by: Copilot <[email protected]> Copilot-Session: 3508d1b8-e4de-4d3e-981f-79fe92c12f2c
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
Co-authored-by: Copilot <[email protected]> Copilot-Session: 3508d1b8-e4de-4d3e-981f-79fe92c12f2c
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes a Debug.Assert(Count == entries.Count) from the managed cDAC DacEnumerableHash reader and replaces it with a comment explaining why that invariant doesn’t hold when reading from a non-quiescent (live) target. This aligns the managed reader’s expectations with the underlying native DacEnumerableHashTable design, which supports concurrent growth and migration via SLOT_NEXT.
Changes:
- Removed the
System.Diagnosticsdependency by deleting theDebug.Assert(Count == entries.Count)invariant check. - Added an explanatory comment documenting why
Countcan legitimately diverge from a single-pass bucket walk on live targets.
Co-authored-by: Copilot <[email protected]> Copilot-Session: 3508d1b8-e4de-4d3e-981f-79fe92c12f2c
rcj1
approved these changes
Jul 13, 2026
eiriktsarpalis
pushed a commit
that referenced
this pull request
Jul 15, 2026
## Summary Removes an invalid `Debug.Assert(Count == entries.Count)` in the cDAC `DacEnumerableHash` reader. One of a cluster of cDAC GC stress-test robustness fixes split out of #130447. ## The bug `Count` and the bucket chains are only guaranteed consistent for a **quiescent** table -- the frozen-dump case the native DAC walker assumes. The cDAC stress harness reads this hash from a **live** process where the runtime may be concurrently inserting entries or growing the table (allocating a new bucket array chained via `SLOT_NEXT` and migrating entries), so the stored `Count` legitimately diverges from what a single-snapshot bucket walk observes. This only affects Debug/Checked cDAC builds (the stress harness itself runs a Release cDAC). The assert is replaced with an explanatory comment. > [!NOTE] > This PR description and the changes were produced with the assistance of GitHub Copilot. --------- Co-authored-by: Max Charlamb <[email protected]> Co-authored-by: Copilot <[email protected]>
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.
Summary
Removes an invalid
Debug.Assert(Count == entries.Count)in the cDACDacEnumerableHashreader. One of a cluster of cDAC GC stress-test robustness fixes split out of #130447.The bug
Countand the bucket chains are only guaranteed consistent for a quiescent table -- the frozen-dump case the native DAC walker assumes. The cDAC stress harness reads this hash from a live process where the runtime may be concurrently inserting entries or growing the table (allocating a new bucket array chained viaSLOT_NEXTand migrating entries), so the storedCountlegitimately diverges from what a single-snapshot bucket walk observes.This only affects Debug/Checked cDAC builds (the stress harness itself runs a Release cDAC). The assert is replaced with an explanatory comment.
Note
This PR description and the changes were produced with the assistance of GitHub Copilot.