Skip to content

Fix setting of DacpHeapSegmentData::highAllocMark on DAC side. - #69670

Merged
PeterSolMS merged 4 commits into
dotnet:mainfrom
PeterSolMS:Fix_Dac_highAllocMark_for_regions
May 30, 2022
Merged

PeterSolMS merged 4 commits into
dotnet:mainfrom
PeterSolMS:Fix_Dac_highAllocMark_for_regions

Conversation

@PeterSolMS

Copy link
Copy Markdown
Contributor

Fix setting of DacpHeapSegmentData::highAllocMark on DAC side. Keep some logic for backward compat in dacprivate.h, the copy here and the one in the Diagnostics repo, so that a new SOS can work correctly with an older DAC.

The PR in the diagnostics repo is this: dotnet/diagnostics#3062

@ghost

ghost commented May 23, 2022

Copy link
Copy Markdown

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

Issue Details

Fix setting of DacpHeapSegmentData::highAllocMark on DAC side. Keep some logic for backward compat in dacprivate.h, the copy here and the one in the Diagnostics repo, so that a new SOS can work correctly with an older DAC.

The PR in the diagnostics repo is this: dotnet/diagnostics#3062

Author: PeterSolMS
Assignees: PeterSolMS
Labels:

area-Diagnostics-coreclr

Milestone: -

Comment thread src/coreclr/debug/daccess/request.cpp Outdated

heapSegment->highAllocMark = heapSegment->allocated;

if (heapSegment->next == NULL)

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.

In the NoGCRegion case, I chained some additional regions after the allocating region, so it is possible for this check to miss the allocating region.

I think all these can be simplified to just check if heapSegment == ephemeral_heap_segment, that check should also work for regions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you are right on both counts - thanks for pointing it out!

// if this is the start segment, set highAllocMark too.
if (SUCCEEDED(hr))
// if this is the start segment, and the Dac hasn't set highAllocMark, set it here.
if (SUCCEEDED(hr) && this->highAllocMark == 0)

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.

We probably want to update the copy on the diagnostics repo as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'll do that.

@PeterSolMS
PeterSolMS merged commit b8acc97 into dotnet:main May 30, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jun 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants