Bug 1637 - The vm is not suspended
Summary: The vm is not suspended
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Debugger ()
Version: 5.9
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
: 1421 ()
Depends on:
Reported: 2011-10-21 11:41 UTC by Marek Safar
Modified: 2017-01-13 15:24 UTC (History)
5 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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 or GitHub 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.

Related Links:

Description Marek Safar 2011-10-21 11:41:05 UTC
using System;
using System.Threading.Tasks;
using System.Threading;
using System.Collections.Generic;

class MyContext
	public static void Main ()
		var l = new List<int> { 3, 6, 7 };
		var mre = new ManualResetEvent (false);
		ThreadPool.QueueUserWorkItem (delegate {
			mre.WaitOne ();
		mre.WaitOne ();

1. Run the program with F5 then break (it should be stuck on one of WaitOne)
2. Navigate back to main thread (otherwise MD does not see l)
3. watch l variable, MD says The vm is not suspended

Same happens for all complex variables, you can try to dig into mre
Comment 1 Zoltan Varga 2011-10-23 09:44:55 UTC
The problem here is that md tries to run a method invoke on the main thread which is executing native code, and that is not supported by sdb. No idea what the solution should be.
Comment 2 Marek Safar 2011-10-23 13:16:09 UTC
*** Bug 1421 has been marked as a duplicate of this bug. ***
Comment 3 Marek Safar 2011-11-07 11:26:38 UTC
Is this MD bug then?

As it stands it makes debugging of deadlocks not possible
Comment 4 Zoltan Varga 2011-11-07 11:36:53 UTC
When you 'suspend' or 'break', only the execution of managed code is stopped, the thread which execute native code keep running, like this thread which is waiting for something in the runtime code. Since those threads are not suspended, you can't invoke managed code on them, so you can't do property evaluation.
Comment 5 Jeremy Kolb 2013-06-04 16:09:01 UTC
I'm constantly hitting this in VS 2012.  It makes debugging impossible.
Comment 6 Zoltan Varga 2015-04-28 19:06:01 UTC
This still happens. XS needs to catch the error, and display the normal value of the variable i.e. List<int> or something.

-> XS.
Comment 7 Jeremy Kolb 2015-04-29 00:12:37 UTC
This isn't just XS.  It happens in VS as well.
Comment 8 Greg Munn 2016-12-16 17:08:37 UTC
Still reproducible.
Comment 9 xamarin-release-manager 2017-01-13 15:24:42 UTC
Fixed in version (master)

Author: Artem Bukhonov
Commit: 04c85adf3ea7a0ea910ed4bca614fc971d51fe13 (mono/debugger-libs)
Included in Commit: cf3a4f2735f4af840d249315ef7df633b4739c70 (mono/monodevelop)