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.
A test case that can reproduce this is found at https://github.com/Unarmed/mono-invalidprogram
Building the supplied code on mono and then running it on Windows 8.1 x64 causes a crash. Exception details below.
To reproduce do:
and reproduce crash with
If this is instead run with mono (as in "mono Program.exe") then the program will print the expected output "If you see this then everything is OK!" and exit cleanly. It will do so on all platforms as far as I can tell.
If I instead run the exe without mono (as in just "Program.exe") then at least on my Windows 8.1 x64 I instead see:
Unhandled Exception: System.InvalidProgramException: Common Language Runtime detected an invalid program.
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
at invalid_program.Program.Main(String args)
I have tried building with mono 184.108.40.206 on windows and from the mono:220.127.116.11 docker image, both with the same results.
I have not attempted to reproduce crash on more windows platforms.
I have .Net 4, 4.5 and 4.6 installed on the machine where the crash was found.
Rebuilding through Visual Studio 2015 produces an exe that can be run both with mono and without it.
Fixed in master