-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Allow suspending the runtime while suspension for the debugger is pending in some cases #44539
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
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.
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.
This is adding complexity to preserve data breakpoints in VS versions without our pending fix. However for these versions the deadlock would still exist.
I wonder if the right fix is to simply never allow
EnableGCNotification(true)
. We could do that by returning an error when when this is set to true. (Or by removing the interface)The benefit would be that the deadlock would be fixed completely (at the sake of broken data breakpoints on non-updated VS versions). I guess to me that feels like a better solution. I would prefer a hard failure on data breakpoints, than a intermittent deadlock.
@chuckries @gregg-miskelly opinions? ramifications?
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.
@sdmaclea @gregg-miskelly I don't have a problem with deprecating EnableGCNotifications entirely, however there is a problem in VS: It appears we never actually check the HRESULT from
EnableGCNotificationEvents(...)
. This means that for existing version of VS, a failed return won't actually fail the data bp code path, and the thread contexts will still get updated to set the hardware data bp. Without the GC events actually enabled, these data bp's would be enabled across GC's and almost certainly cause major issues.Data BP's could be "gracefully" disabled by failing the QI for ICorDebugProcess10. This would make VS think that the target runtime simply doesn't support data bp's. It appears that
EnableGCNotificationEvents(...)
is the only API available on ICorDebugProcess10, so I think this might be a valid approach.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.
The deadlock introduced by #40060 in adding the forbid-suspend-for-debugger region is only applicable to .NET 5, for 3.1 a different solution was used and that deadlock is not applicable there. So after this change, that deadlock could still occur in .NET 5 (but not 3.1) when using a VS version that uses GC events.
Not sure I followed the above completely. If the target runtime supports data BPs, is there a suggestion for a change?
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.
I can draft the change. See #44549