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
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.
Created attachment 16513 [details]
Example solution causing the crash, including the Build Output log
Using Xamarin Studio 6.0.1 (build 9), up to date from the Stable channel, we were unable to build due to this error:
/Library/Frameworks/Mono.framework/Versions/4.4.1/lib/mono/4.5/Microsoft.CSharp.targets: error : Compiler crashed with code: 1.
The problem turned out to be caused by this code pattern:
Data += await GetHello () + "!\n" + 123.ToString () + "...";
For this to crash the compiler, Data must be a property, 123.ToString() cannot be a string literal, and both the string literals must be there in that pattern. Code following this pattern built fine in Visual Studio.
Here is the exception from the build output (where line 16 is the beginning of the function containing that code pattern):
Mono.CSharp.InternalErrorException: Program.cs(16,9): CompilerCrash.MainClass.<Demo>c__async0.MoveNext() ---> Mono.CSharp.InternalErrorException: (1,1): ---> Mono.CSharp.InternalErrorException: Await yields with non-empty stack in `CompilerCrash.MainClass.<Demo>c__async0.MoveNext()
at Mono.CSharp.EmitContext.AssertEmptyStack () <0x24e0350 + 0x000cc> in <filename unknown>:0
Program.cs and BuiltOutput.log are attached, providing a full example.
I verified this happens in both Xamarin.iOS and Console projects.
Fixed in master and Mono 4.6