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
Developer Community or GitHub 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 24483 [details]
Clone the Acquaint sample app: https://github.com/xamarinhq/app-acquaint
Build it and then double click on any of the XAML files to launch the Forms previewer.
Result: Mono Android crashes and the Forms previewer doesn't work on any of the XAML pages.
I repro'ed this both on VS Mac (current GA version, with Xamarin.Android 188.8.131.52) and VS Windows (15.4 preview 1, Xamarin.Android 184.108.40.206).
The VS4Mac log files are attached.
Here's a snippet of the crashing thread:
Stack: [0x000070000f74c000,0x000070000f84c000], sp=0x000070000f84ac50, free space=1019k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libmonosgen-2.0.dylib+0x20bc9c] mono_property_set_value+0xc
C [libmono-android.debug.dylib+0x154fe] monodroid_property_set+0xbe
C [libmono-android.debug.dylib+0x15268] monodroid_create_appdomain+0x248
C [libmono-android.debug.dylib+0xf159] create_domain+0x149
C [libmono-android.debug.dylib+0xe439] create_and_initialize_domain+0x69
C [libmono-android.debug.dylib+0xe89d] Java_mono_android_Runtime_createNewContext+0x7d
The Acquaint app is our de facto standard Forms sample app, which many customers may try out first. That, plus the fact it's a mono crash, points to this being a priority issue.
Created attachment 24484 [details]
JVM hs_err crash
I was able to generate a core dump and get more info from it.
The crash is caused by shadow_copy_dirs_prop being NULL is this code here:
monodroid_create_appdomain (struct DylibMono *mono, MonoDomain *parent_domain, const char *friendly_name, int shadow_copy, const char *shadow_directories)
MonoClass *appdomain_setup_klass = monodroid_get_class_from_name (mono, parent_domain, "mscorlib", "System", "AppDomainSetup");
MonoClass *appdomain_klass = monodroid_get_class_from_name (mono, parent_domain, "mscorlib", "System", "AppDomain");
MonoMethod *create_domain = mono->mono_class_get_method_from_name (appdomain_klass, "CreateDomain", 3);
MonoProperty *shadow_copy_prop = mono->mono_class_get_property_from_name (appdomain_setup_klass, "ShadowCopyFiles");
MonoProperty *shadow_copy_dirs_prop = mono->mono_class_get_property_from_name (appdomain_setup_klass, "ShadowCopyDirectories");
shadow_copy_prop is set OK, but is shadow_copy_dirs_prop is NULL, causing a crash in code below that attempts to use it to set a property.
How could the ShadowCopyDirectories property not exist on the AppDomainSetup class, from mscorlib, here?
Here's the problem & fix for it: https://github.com/xamarin/xamarin-android/pull/803
Fixed, by Xamarin.Android PR above.
I'll tag this as something we should put under CI