Skip to content
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

Fix to allow entering cooperative GC mode when the thread is in a forbid-suspend-for-debugger region #42587

Merged
merged 1 commit into from
Sep 23, 2020

Conversation

kouvel
Copy link
Member

@kouvel kouvel commented Sep 22, 2020

  • Followup to Don't suspend for debugger while holding the slot backpatching lock #40060
  • In short timing windows if a thread is placed in a pending-suspend-for-debugger state while in a forbid-suspend-for-debugger region, from the above PR it would not suspend for the debugger but it was missed that it can also get stuck in a perpetual spin-wait while entering cooperative GC mode. This causes the thread to not suspend for the debugger (VS times out after waiting) and the thread can only progress by unmarking it for debugger suspension.
  • Fixed to break the spin-wait by checking whether the thread is in the forbid region

Fix for #42375 in master

…bid-suspend-for-debugger region

- Followup to dotnet#40060
- In short timing windows if a thread is placed in a pending-suspend-for-debugger state while in a forbid-suspend-for-debugger region, from the above PR it would not suspend for the debugger but it was missed that it can also get stuck in a perpetual spin-wait while entering cooperative GC mode. This causes the thread to not suspend for the debugger (VS times out after waiting) and the thread can only progress by unmarking it for debugger suspension.
- Fixed to break the spin-wait by checking whether the thread is in the forbid region

Fix for dotnet#42375 in master
@kouvel kouvel added this to the 6.0.0 milestone Sep 22, 2020
@kouvel kouvel requested review from noahfalk and janvorli September 22, 2020 16:45
@kouvel kouvel self-assigned this Sep 22, 2020
kouvel added a commit to kouvel/runtime that referenced this pull request Sep 22, 2020
… a forbid-suspend-for-debugger region

- Port of dotnet#42587 to 5.0
- Followup to dotnet#40060
- In short timing windows if a thread is placed in a pending-suspend-for-debugger state while in a forbid-suspend-for-debugger region, from the above PR it would not suspend for the debugger but it was missed that it can also get stuck in a perpetual spin-wait while entering cooperative GC mode. This causes the thread to not suspend for the debugger (VS times out after waiting) and the thread can only progress by unmarking it for debugger suspension.
- Fixed to break the spin-wait by checking whether the thread is in the forbid region

Fixes dotnet#42375
Copy link
Member

@janvorli janvorli left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

kouvel added a commit to kouvel/runtime that referenced this pull request Sep 23, 2020
…s in a forbid-suspend-for-debugger region

- Port of dotnet#42587 to 5.0 RC2
- Followup to dotnet#40060
- In short timing windows if a thread is placed in a pending-suspend-for-debugger state while in a forbid-suspend-for-debugger region, from the above PR it would not suspend for the debugger but it was missed that it can also get stuck in a perpetual spin-wait while entering cooperative GC mode. This causes the thread to not suspend for the debugger (VS times out after waiting) and the thread can only progress by unmarking it for debugger suspension.
- Fixed to break the spin-wait by checking whether the thread is in the forbid region

Fix for dotnet#42375
@kouvel kouvel merged commit cef5dea into dotnet:master Sep 23, 2020
@kouvel kouvel deleted the CoopFix branch September 23, 2020 17:08
kouvel added a commit that referenced this pull request Sep 23, 2020
…s in a forbid-suspend-for-debugger region (#42630)

- Port of #42587 to 5.0 RC2
- Followup to #40060
- In short timing windows if a thread is placed in a pending-suspend-for-debugger state while in a forbid-suspend-for-debugger region, from the above PR it would not suspend for the debugger but it was missed that it can also get stuck in a perpetual spin-wait while entering cooperative GC mode. This causes the thread to not suspend for the debugger (VS times out after waiting) and the thread can only progress by unmarking it for debugger suspension.
- Fixed to break the spin-wait by checking whether the thread is in the forbid region

Fix for #42375
@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants