Repository navigation
[release/10.0] Don't crash when walking callstack roots in the debugger - #136161
Open
github-actions[bot] wants to merge 1 commit into
Open
github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
Changeset 1fa1745 introduced a stack walking regression where we will crash trying to unwind/report registers. The real fix here is in cgenamd64.cpp/excep.cpp, which will point the context to a local copy before we try to use it. I've also added some changes in gcinfodecoder.cpp that aren't strictly necessary but would have avoided the problem to begin with. Fixes #124401.
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 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: @agocke |
This branch has not been deployed
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.
Backport of #124402 to release/10.0
Fixes #135590
/cc @max-charlamb @leculver
Customer Impact
Reported in #135590 on .NET 10.0.12. Debugger and diagnostics tools crash with a native SIGSEGV inside
libmscordaccorewhen the DAC walks stack roots. Examples are ClrMDEnumerateStackRoots()on a live process, anddotnet-dumpclrstack -gc/gcrooton Linux amd64 dumps. Expected: stack roots are enumerated. Actual: the tool process crashes. This affects any tool built on the DAC stack-root enumeration (dotnet-dump, ClrMD-based tools, and memory/heap analysis in debuggers).Regression
Introduced by #108480 ("Improve software exception handling performance", 1fa1745), which has been in release/10.0 since 10.0.0-preview.1. A partial fix (1a5af14) handled x86 only. This change covers the remaining architectures.
Testing
Verified locally on Linux x64 Release, using an unmodified 10.0.12 runtime and swapping only
libmscordaccore.so. The repro is the one from #135590 (live ClrMDEnumerateStackRoots()under load):GetStackSlot(GC_FRAMEREG_REL) dereferencingpCurrentContextPointers->Rbp, an unmapped target-process address, while the local context copy was valid.Risk
Low. The change only affects
DACCESS_COMPILEcode (SoftwareExceptionFrame/FaultingExceptionFrameUpdateRegDisplay). It makes the DAC register pointers refer to the localpRD->pCurrentContextcopy instead of target memory. The runtime (non-DAC) paths are unchanged. It is the same diff that has been on main since #124402.IMPORTANT: This backport targets
release/10.0(no-stagingsuffix), as required for .NET 10+.