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.
break code generation when using static fields in a class with attribute StructLayout(LayoutKind.Explicit).
Attached is a test program that crashes in the .cctor when trying to set up the static field.
Created attachment 13208 [details]
Does this only happen on Windows? I can't repro on Linux (amd64) with Mono master.
It does not seem to crash in Linux, but it's not working correctly either. If you add a
in the test program, it will print a bogus value.
It seems that the static field is being treated as a special (thread/context) static in the Mono code, despite not being one.
seems to be turning every static field in a StructLayout(LayoutKind.Explicit) struct into a special static (-1 offset).
I have checked this issue on Mac and windows machine and not able to reproduce this issue.
Steps I have folowed to reproduce this issue:
1.Create a Console App in XS.
2.Implement the mentioned code in https://bugzilla.xamarin.com/attachment.cgi?id=13208
Please let me know If I missed anything to reproduce this issue and could you please provide us the build info on which this issue is occuring
This one is more obvious:
I have checked this issue with latest master build and able to reproduce this issue with the help of comment 6
Terminal output: https://gist.github.com/Arpit360/51f7074fabf80d5de224
I have also checked this issue with Cycle 6 latest build but I am not observing the issue:
Terminal output: https://gist.github.com/Arpit360/3a06cd0df9c20d885100
An update to comment 7:
OSX : 10.10.5 (14F27)
I reverted 0686c213583a70bde97c8d04e0748e47416bfaf9/d2efa789ac432bbcc92483d8f6e0b17c3b23efff
until this is fixed, since it also seems to break Xamarin.Android.
This was reverted on master and it does affect 4.0 / 4.2.
Alexp, please update this bug once the proper fix lands on master.
Since this was just a small optimization and I have more important stuff on my plate, let's just leave it reverted for now. I might get back to it at some point.
The commits were never pushed to 4.2, so it won't affect it.
This bug is caused by the commit in comment #9 which was reverted, so it should be fixed.
Sorry my mistake. Do we want to use this bug to track the pending work/optimization mentioned in Comment #10 and Comment #11? Or is something else tracking that?
I think we should just close it.
Resolving as fixed as per comment #13 and #15, this was reopened by mistake.