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.
I am hitting a crash with a recent master based branch debugging Unity embedded Mono with Visual Studio Tools for Unity.
1. During domain unload the debugger agent processes a `EVENT_KIND_ASSEMBLY_UNLOAD` event for an assembly being unloaded (was only in the unloaded domain). Note at this point the domain is already unloaded, most importantly the domain vtable cache on each MonoClass has been cleared for this domain.
2. The debugger agent thread gets a `CMD_ASSEMBLY_GET_OBJECT` command from VSTU. This calls `mono_assembly_get_object_checked` which attempts to construct an object for the assembly, including creating a new vtable from the already unloaded domain using the domain allocator.
3. We create this vtable and cache it in the MonoClass based on the unloaded domain’s id.
4. Domain unloads, domain allocator memory freed, new domain is created with *same id*
5. Attempt to create another assembly object and get a corrupt vtable
I can try to create a repro case independent of Unity/VSTU, but am have not done so currently.
Fixed in master/4.8, we now return an ERR_UNLOADED error in this case when GetAssemblyObject () is called after receiving an AssemblyUnload event.