Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 23243 [details]
Image showing the UI call stack when blocked
When stopping the debugger with a breakpoint set, the debugger can "deadlock" (not really a deadlock because it can be relieved by disconnecting the debuggee) waiting for a response from the debuggee.
This doesn't happen normally if the debuggee responds as expected.
I don't see any reason why stopping the debugger should block the UI. This work should be done on a background thread so that if you do get a bad debug connection, it won't lock the IDE.
If the work must absolutely be done on the UI thread, then timeouts should be used on these blocking operations.
1. Start Debugging
2. Pause on a breakpoint
3. Hit Stop
4. Note that get_Breakpoints, which waits on a lock, is executing on the main thread.
Under normal circumstances: everything is fine and the debuggeee responded immediately freeing the UI thread
Under other circumstances: the UI thread can block indefinitely waiting for a response from the debuggee
The contention seems to be over the `slock` field of DebuggerSession. The `TargetExited` event is sent while also trying to remove breakpoints. However, because the target has exited it cannot release breakpoints (it's exited). This locks the actions needed by the TargetExited event waiting for a response about the breakpoints.
I have attached an image of the stack trace of the UI thread when one of these deadlocks occurs.