[debugger] Fix crash during Async Break when APC and CET are enabled#111408
Merged
thaystg merged 13 commits intodotnet:mainfrom Apr 4, 2025
Merged
[debugger] Fix crash during Async Break when APC and CET are enabled#111408thaystg merged 13 commits intodotnet:mainfrom
thaystg merged 13 commits intodotnet:mainfrom
Conversation
janvorli
reviewed
Jan 14, 2025
This was referenced Jan 14, 2025
janvorli
reviewed
Jan 15, 2025
src/coreclr/pal/inc/pal.h
Outdated
| FlushProcessWriteBuffers(); | ||
|
|
||
| typedef void (*PAL_ActivationFunction)(CONTEXT *context); | ||
| typedef void (*PAL_ActivationFunction)(CONTEXT *context, bool fromDebugger); |
Member
There was a problem hiding this comment.
A nit - can you please keep this function pointer unchanged and add the following function instead?
void HandleSuspensionForInterruptedThread(CONTEXT *interruptedContext)
{
HandleSuspensionForInterruptedThread(interruptedContext, false);
}
noahfalk
reviewed
Jan 15, 2025
tommcdon
approved these changes
Apr 4, 2025
This was referenced Apr 4, 2025
This was referenced Apr 4, 2025
Member
Author
|
/backport to release/9.0-staging |
Contributor
|
Started backporting to release/9.0-staging: https://github.com/dotnet/runtime/actions/runs/14604017925 |
Contributor
|
@thaystg backporting to "release/9.0-staging" failed, the patch most likely resulted in conflicts: $ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: Trying to fix crash while funceval after an async break
Applying: Fix call func eval after an async break
error: sha1 information is lacking or useless (src/coreclr/pal/src/exception/signal.cpp).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0002 Fix call func eval after an async break
Error: The process '/usr/bin/git' failed with exit code 128Please backport manually! |
4 tasks
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
When we are running an APC Callback we are not allowed to SetIP because when APC Callback is resuming it will check if the IP is not changed if CET is enabled.
To avoid this problem we use the APC to suspend the thread, but then we enable the single step and continue the thread execution, this will exit the apc callback and pause in the single step, so we are allowed to SetIP to FuncEvalHijack to run FuncEvals.
Fixes #110552