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 20219 [details]
A smallest possible test case for reproducing the bug.
Compiled application crashes during run-time if source code contains setting an overwritten get-only property in constructor while inside of curly brackets (please see the attachment).
Steps to reproduce:
1. Compile the attached file (test.cs) with mcs, no arguments (mcs test.cs).
2. Run it with mono, no arguments (mono test.exe).
Application crashes with an unhandled exception:
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidProgramException: Invalid IL code in Test.Child:.ctor (): IL_0018: stfld 0x04000003
Application should not crash and should output "success" to the console.
Build Date & Hardware:
Build 2017-03-08 on Arch Linux with a patched Linux kernel (18.104.22.168-ck).
Additional Builds and Platforms:
Does not occur on Build 2017-03-08 on Windows 10 when compiled using csc (Visual C# Compiler version 22.214.171.124621).
Crash occurs when both setting the property during array initialization (test.cs) and initializing a field during a new object initialization (see the next comment), hence "inside of curly brackets".
Created attachment 20220 [details]
Another smallest possible test case reproducing the bug
This test case produces the same output, but instead of setting a property while initializing an array it is set during field initialization of another class.
— applications do not crash if the "override" keyword is replaced with "new";
— setting the property outside of curly brackets and then passing it also does not result in a crash.
Fixed in master