Bug 36848 - Frequent crash with XS master (roslyn enabled)
Summary: Frequent crash with XS master (roslyn enabled)
Alias: None
Product: Runtime
Classification: Mono
Component: Remoting ()
Version: 4.2.0 (C6)
Hardware: PC Mac OS
: Normal major
Target Milestone: ---
Assignee: Andi McClure
Depends on:
Reported: 2015-12-10 19:26 UTC by Jérémie Laval
Modified: 2015-12-15 22:41 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Crash on tip of Mono 4.3.1 (97.67 KB, text/plain)
2015-12-11 14:41 UTC, Jérémie Laval

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:

Description Jérémie Laval 2015-12-10 19:26:23 UTC
Assertion at object.c:2189, condition 'vt' not met` (source line has a comment that says it needs to be fixed).

Full log/stacktrace: https://gist.github.com/garuma/164e025c549a80696e25

Mono JIT compiler version 4.2.1 (explicit/3ddba85 Mon Dec  7 17:52:50 EST 2015)
Comment 2 Andi McClure 2015-12-10 21:58:22 UTC
Manually built a 3ddba85, so far not able to reproduce. Still trying to figure out if my build options were the same.
Comment 3 Andi McClure 2015-12-10 22:28:09 UTC
Also not reproducing for me yet with the tarball Jérémie is running.
Comment 4 Jérémie Laval 2015-12-11 14:41:49 UTC
Created attachment 14249 [details]
Crash on tip of Mono 4.3.1
Comment 5 Andi McClure 2015-12-15 16:02:26 UTC
The problem here is ves_icall_Remoting_RealProxy_GetTransparentProxy . mono_remote_class_vtable expects the MonoRemoteClass it receives to be valid, and in particular, mono_class_proxy_vtable which it calls will assert if exception_type is set on the MonoRemoteClass's 'proxy_class' field. However ves_icall_Remoting_RealProxy_GetTransparentProxy can, with specific incorrect inputs, construct a MonoRemoteClass object with a bad proxy_class. I expect that either Xamarin Studio is passing in bad inputs of this type, or something is messed up with DLLs on Jeremie's computer.

The fix is for the icall to check before calling mono_remote_class_vtable if proxy_class failed and throw a nice managed exception. (This means things will still be failing on Jeremie's computer, but we will know why.)

(Note there is some question about whether we are handling this in the right place: there is a very old comment 'properly handle failure' on the mono_class_proxy_vtable assert, and Rodrigo was initially uncertain whether something in the icall should have been catching on the failure earlier.)
Comment 7 Andi McClure 2015-12-15 22:41:22 UTC
Pushed a commit to master and 4.3.1 that causes this failure to emit an exception instead of an assert crash.