Bug 10236 - Mono crashes with async/await
Summary: Mono crashes with async/await
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: General ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-02-12 06:44 UTC by Sergey Zhukov
Modified: 2013-05-30 13:44 UTC (History)
4 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 FIXED

Description Sergey Zhukov 2013-02-12 06:44:57 UTC
Mono 3.0.4 crashes when I try to run following code
----------------
using System;
using System.Threading.Tasks;

namespace AsyncTest
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			Console.WriteLine ("Hello World!");

			Test ();

		}

		public static async void Test()
		{
			int x=0;
			await Task.Run(() =>
			               {
				for(int i=0;i<1000;i++)
				{
					x++;
				}
			}
			);
			Console.WriteLine("x={0}",x);

		}
	}
}
---------------------------
sergey@ubuntu:~/AsyncTest/AsyncTest$ mono-sgen ./Main.exe
Hello World!
* Assertion at mono-threads-posix.c:96, condition `ret' not met


Native stacktrace:

	mono-sgen() [0x80f0d59]
	[0xb774e40c]
	[0xb774e424]
	/lib/i386-linux-gnu/libc.so.6(gsignal+0x4f) [0xb75671df]
	/lib/i386-linux-gnu/libc.so.6(abort+0x175) [0xb756a825]
	mono-sgen() [0x82734bd]
	mono-sgen() [0x8273543]
	mono-sgen() [0x826edfe]
	[0xb774e40c]
	[0xb774e424]
	/lib/i386-linux-gnu/libpthread.so.0(sem_post+0x36) [0xb76eff16]
	mono-sgen(mono_sem_post+0x2a) [0x826a84a]
	mono-sgen() [0x826ee3e]
	/lib/i386-linux-gnu/libpthread.so.0(+0x6d4c) [0xb76e9d4c]
	/lib/i386-linux-gnu/libc.so.6(clone+0x5e) [0xb7627d3e]

mono --version
Mono JIT compiler version 3.0.4 (master/0e6393e Mon Feb  4 14:03:01 PST 2013)

OS: ubuntu 12.04
Comment 1 Sergey Zhukov 2013-03-15 15:23:51 UTC
fixed in mono 3.0.6, please close the bug
Comment 2 Zoltan Varga 2013-03-15 16:08:55 UTC
-> FIXED.