Bug 4531 - Task evaluation always timeouts
Summary: Task evaluation always timeouts
Status: RESOLVED FEATURE
Alias: None
Product: Runtime
Classification: Mono
Component: Debugger ()
Version: unspecified
Hardware: PC Linux
: High enhancement
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-04-19 14:05 UTC by Marek Safar
Modified: 2017-07-11 23:04 UTC (History)
7 users (show)

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

Related Links:
Status:
RESOLVED FEATURE

Description Marek Safar 2012-04-19 14:05:20 UTC
using System;
using System.Threading.Tasks;

class C
{
    public static void Main()
    {
		var t = new Task<int> (() => { return 4; });
		bool b = t != null; // Set a breakpoint here and add t.Result to watch window
		return;
    }
}

Value always says: Timed out.
Comment 1 Jeffrey Stedfast 2012-04-19 19:12:41 UTC
I've been hitting the timeout a lot lately myself and it's pretty frustrating that it takes so long.

not sure if it's a problem in MonoDevelop or the runtime or both.

Zoltan: any ideas?
Comment 2 Zoltan Varga 2012-05-04 06:30:20 UTC
Properties are evaluated in single-threaded mode, i.e. only the thread which executes the get_Result method is active. That method probably waits for another suspended thread to finish the task, hence the timeout.
Comment 3 Mikayla Hutchinson [MSFT] 2012-05-04 11:38:29 UTC
Maybe we should special-case task.Result, and avoid evaluating it if the task has not completed. We could instead print a "Task not finished" message in the evaluator.
Comment 4 Rodrigo Kumpera 2013-09-08 18:53:12 UTC
We need to add TPL/async support in SDB so the IDEs can better handle those situations.

I rather see us spend more time and come up with a good list of issues & solutions than dive into a series of one off workarounds.

Figuring out what kind of functionality VS has on this area is a good start.
Comment 5 Marek Safar 2013-09-09 02:56:29 UTC
Not sure how this is enhancement when we announced async support in XS
Comment 6 Rodrigo Kumpera 2017-07-11 23:04:46 UTC
This is how the runtime debugger work. Fixing this is up to the IDEs, including budgeting any runtime work needed.