Open
Integrating GetFrameType and SetContext into cDAC#131608
Conversation
|
Azure Pipelines: Successfully started running 4 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
…nd SetContext in cDAC Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
rcj1
force-pushed
the
copilot/implement-ixclrdatastackwalk
branch
from
July 30, 2026 20:37
524701a to
a123193
Compare
rcj1
marked this pull request as ready for review
July 30, 2026 20:43
|
Azure Pipelines: Successfully started running 5 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Copilot's findings
Comments suppressed due to low confidence (2)
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ClrDataStackWalk.cs:67
- Reseed disposes the current enumerator before creating the replacement. If CreateStackWalk/GetEnumerator throws (e.g., invalid context buffer), the stack walk is left with a disposed _dataFrames enumerator, so subsequent calls can start failing even though SetContext returned an HRESULT. Construct the new enumerator first, then swap and dispose the old one after success (transactional update).
private void Reseed(byte[] context, bool isFirst)
{
_dataFrames.Dispose();
_dataFrames = _target.Contracts.StackWalk.CreateStackWalk(_threadData, context, isFirst).GetEnumerator();
_currentFrameIsValid = MoveNextLegacyVisible();
}
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/ClrDataStackWalk.cs:306
- SetContext always forwards to _legacyImpl.SetContext even when the cDAC SetContext path fails (e.g., invalid context buffer). That can desynchronize the legacy stack walk from the cDAC walk for subsequent GetFrame()/Next() calls (and can mutate legacy state even though SetContext returned failure). Only update the legacy stack walk when this method returns S_OK.
if (_legacyImpl is not null)
{
int hrLocal = _legacyImpl.SetContext(contextSize, context);
#if DEBUG
Debug.ValidateHResult(hr, hrLocal);
- Files reviewed: 5/5 changed files
- Comments generated: 1
Comment on lines
231
to
235
| int hr = HResults.S_OK; | ||
| try | ||
| { | ||
| if (inBufferSize != 0 || inBuffer != null) | ||
| throw new ArgumentException("Invalid input buffer parameters"); | ||
| switch (reqCode) | ||
| { |
Contributor
|
Fixes #112275 |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Uh oh!
There was an error while loading. Please reload this page.