Skip to content

Fix DBI CopyContext size check for XSTATE contexts - #137233

Merged
janvorli merged 2 commits into
dotnet:mainfrom
am11:fix/dbi-copycontext-xstate
Nov 10, 2026
Merged

janvorli merged 2 commits into
dotnet:mainfrom
am11:fix/dbi-copycontext-xstate

Conversation

@am11

@am11 am11 commented Nov 10, 2026

Copy link
Copy Markdown
Member

CopyContext validated DT_CONTEXT buffers with ContextSizeForFlags, which sizes T_CONTEXT and requires the XSTATE area when CONTEXT_XSTATE is set. The runtime reports thread contexts with CONTEXT_XSTATE on Unix, so CordbStackWalk::GetContext failed with E_INVALIDARG and debuggers did not stop at Debugger.Break or breakpoints. Size these buffers by DT_CONTEXT instead. Regressed in #130367.

CopyContext validated DT_CONTEXT buffers with ContextSizeForFlags, which sizes T_CONTEXT and requires the XSTATE area when CONTEXT_XSTATE is set. The runtime reports thread contexts with CONTEXT_XSTATE on Unix, so CordbStackWalk::GetContext failed with E_INVALIDARG and debuggers did not stop at Debugger.Break or breakpoints. Size these buffers by DT_CONTEXT instead. Regressed in dotnet#130367.

Co-authored-by: Cursor <[email protected]>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 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.

@janvorli
janvorli merged commit 1a496fe into dotnet:main Nov 10, 2026
101 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants