Skip to content

backport 111408 #114932

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

Open
wants to merge 4 commits into
base: release/9.0-staging
Choose a base branch
from

Conversation

thaystg
Copy link
Member

@thaystg thaystg commented Apr 22, 2025

No description provided.

@Copilot Copilot AI review requested due to automatic review settings April 22, 2025 21:29
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR backports changes to support special user mode APC handling in thread suspension and debugging paths.

  • Introduces new thread state flags (TS_SSToExitApcCall and TS_SSToExitApcCallDone) and helper methods to manage APC-related thread suspension.
  • Adds an overload for HandleSuspensionForInterruptedThread and updates debugger and controller logic to handle single-stepping out of APC calls.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

File Description
src/coreclr/vm/threadsuspend.cpp Added APC handling in thread suspension, new method MarkForSuspensionAndWait, and overload for HandleSuspensionForInterruptedThread.
src/coreclr/vm/threads.h Updated thread state flags, friend declarations, and protected member methods.
src/coreclr/vm/dbginterface.h, debugger.h, debugger.cpp Introduced SingleStepToExitApcCall support for APC callbacks during debugging.
src/coreclr/debug/ee/controller.cpp Modified exception dispatch to manage APC exit using the new thread state flags.
Comments suppressed due to low confidence (1)

src/coreclr/vm/threadsuspend.cpp:4241

  • Ensure that the new FEATURE_SPECIAL_USER_MODE_APC code paths, including the APC exit handling, are adequately covered by regression tests to verify both normal and debugger-assisted scenarios.
#ifdef FEATURE_SPECIAL_USER_MODE_APC

return FALSE;
}
pCurThread->SetThreadState(Thread::TS_SSToExitApcCallDone);
pCurThread->ResetThreadState(Thread::TS_SSToExitApcCall);
Copy link
Preview

Copilot AI Apr 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verify that the ordering of state flag updates in the APC exit block is consistent with expected behavior and that resetting TS_SSToExitApcCall occurs only after setting TS_SSToExitApcCallDone.

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Copy link
Contributor

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

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.

1 participant