-
Notifications
You must be signed in to change notification settings - Fork 5k
[debugger] Fix crash during Async Break when APC and CET are enabled #111408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/coreclr/pal/inc/pal.h
Outdated
@@ -3722,7 +3722,7 @@ VOID | |||
PALAPI | |||
FlushProcessWriteBuffers(); | |||
|
|||
typedef void (*PAL_ActivationFunction)(CONTEXT *context); | |||
typedef void (*PAL_ActivationFunction)(CONTEXT *context, bool fromDebugger); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A nit - can you please keep this function pointer unchanged and add the following function instead?
void HandleSuspensionForInterruptedThread(CONTEXT *interruptedContext)
{
HandleSuspensionForInterruptedThread(interruptedContext, false);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
/backport to release/9.0-staging |
Started backporting to release/9.0-staging: https://github.com/dotnet/runtime/actions/runs/14604017925 |
@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 128 Please backport manually! |
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