You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DAC fails to enumerate heap objects on .NET 7+ due to GC Regions #96568
During heap object walking via ICorDebugHeapEnum::Next, DacHeapWalker::MoveToNextObject() fails to properly get the current segment / generation, causing it to skip calling GetSegmentAndAllocRange() for gen0 objects, so if it ends up in a dead area, it won't get itself back out and will fail to return objects to the enumerator.
SOS says the object under inspection is gen0, but when stopped on the access violation from DacHeapWalker::GetSize the check isGen0 in MoveToNextObject claims it's gen2, causing it not to call GetSegmentAndAllocRange()
Reproduction Steps
Known repros on clr versions 7.0.1423.51910, 8.0.23.53103. Setting DOTNET_GCRegionSize to a small value should increase the likelihood that even a template app can trigger the issue.
Expected behavior
Objects are returned via the enumerator.
Actual behavior
Enumerator gets stuck, and no further progress can be made.
Regression?
Seems to be only the latest versions of the runtime, heap walking has not had this issue before.
Known Workarounds
No response
Configuration
No response
Other information
DacHeapWalker::MoveToNextObject()
Activity
ghost added
needs-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners
Activity
asundheim commentedon Jan 5, 2024
@leculver
tommcdon commentedon Jan 7, 2024
@hoyosjs @cshung @mikem8361
cshung commentedon Jan 8, 2024
@asundheim, it looks like you have gone through some debugging and have already found out the root cause, would you mind helping us to get it fixed?
asundheim commentedon Jan 8, 2024
I'd be happy to help, or at the very least test out a fix, but I'm at a loss for what has actually changed to cause this.