Bug 37540 - System.ExecutionEngineException when debugging on device
Summary: System.ExecutionEngineException when debugging on device
Alias: None
Product: iOS
Classification: Xamarin
Component: Mono runtime / AOT compiler ()
Version: XI 9.8 (tvOS / C7)
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: (C7)
Assignee: Zoltan Varga
Depends on:
Reported: 2016-01-09 00:23 UTC by Brian
Modified: 2016-05-17 17:42 UTC (History)
4 users (show)

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

Demo project (21.31 KB, application/zip)
2016-01-13 23:38 UTC, Brian

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 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.

Related Links:

Description Brian 2016-01-09 00:23:17 UTC
After installing Preview #4 (monotouch- when trying to debug the app on an iPhone 6s running iOS 9.1, `System.ExecutionEngineException` gets thrown when my app is launched.


Attempting to JIT compile method '(wrapper delegate-invoke) System.Func`3<System.Reactive.Concurrency.IScheduler, System.Reactive.Concurrency.Scheduler/Pair`2<System.Reactive.Linq.ObservableImpl.ToObservable`1/_/State<MYAPP.MYCLASS>, System.Action`2<System.Reactive.Linq.ObservableImpl.ToObservable`1/_/State<MYAPP.MYCLASS>, System.Action`1<System.Reactive.Linq.ObservableImpl.ToObservable`1/_/State<MYAPP.MYCLASS>>>>, System.IDisposable>:invoke_TResult_T1_T2 (System.Reactive.Concurrency.IScheduler,System.Reactive.Concurrency.Scheduler/Pair`2<System.Reactive.Linq.ObservableImpl.ToObservable`1/_/State<MYAPP.MYCLASS>, System.Action`2<System.Reactive.Linq.ObservableImpl.ToObservable`1/_/State<MYAPP.MYCLASS>, System.Action`1<System.Reactive.Linq.ObservableImpl.ToObservable`1/_/State<MYAPP.MYCLASS>>>>)' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information.


  at (wrapper unknown) System.Object:gsharedvt_out ()
  at System.Reactive.Concurrency.ImmediateScheduler.Schedule[TState] (System.Reactive.Concurrency.TState state, System.Func`3 action) [0x00014] in <filename unknown>:0 
  at (wrapper unknown) System.Object:gsharedvt_in ()
  at System.Reactive.Concurrency.Scheduler.Schedule[TState] (IScheduler scheduler, System.Reactive.Concurrency.TState state, System.Action`2 action) [0x00042] in <filename unknown>:0 
  at System.Reactive.Linq.ObservableImpl.ToObservable`1+_[TSource].Run () [0x0007f] in <filename unknown>:0 
  at System.Reactive.Linq.ObservableImpl.ToObservable`1[TSource].Run (IObserver`1 observer, IDisposable cancel, System.Action`1 setSink) [0x00010] in <filename unknown>:0 
  at System.Reactive.Producer`1[TSource].SubscribeRaw (IObserver`1 observer, Boolean enableSafeguard) [0x00083] in <filename unknown>:0 
  at System.ObservableExtensions.SubscribeSafe[T] (IObservable`1 source, IObserver`1 observer) [0x00036] in <filename unknown>:0 
  at System.Reactive.TailRecursiveSink`1[TSource].MoveNext () [0x00197] in <filename unknown>:0 
  at System.Reactive.Concurrency.AsyncLock.Wait (System.Action action) [0x000a2] in <filename unknown>:0 


The simulator did not crash, as well, the app did not crash on an iPhone 5s running iOS 8.3. When I switched to the alpha channel (Xamarin.iOS the app does not crash on the iPhone 6s anymore. It also does not crash on the current stable channel (Xamarin.iOS

I also installed the older preview (monotouch- and the app was crashing in all environments, but with a different exception:
Type: ObjCRuntime.RuntimeException
Message: `Unable to locate the block to delegate conversion method for the method Foundation.NSUrlSessionDataDelegate.DidReceiveResponse's parameter #4. Please file a bug at http://bugzilla.xamarin.com.
Comment 1 Rolf Bjarne Kvinge [MSFT] 2016-01-11 09:55:33 UTC
Can you share your project with us so that we can reproduce this ourselves (or create a complete test project we can use)?
Comment 2 Brian 2016-01-13 23:38:04 UTC
Created attachment 14577 [details]
Demo project

I attached a demo project that shows the same crash I am experiencing in my actual project. I started with something closer to my actual project, and tried removing as much as possible. See AppDelegate.cs for some notes. Also, packages need to be restored.

Here is my environment:

Xamarin Studio
Version 5.10.1 (build 6)
	Mono 4.2.1 (explicit/6dd2d0d)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 402010102

Apple Developer Tools
Xcode 7.2 (9548)
Build 7C68

Version: (Indie Edition)
Hash: f5270a6
Branch: master
Build date: 2015-12-16 12:41:25-0500

Build Information
Release ID: 510010006
Git revision: 0b60eecdb531933734519c13257d16a780274aab
Build date: 2015-12-04 20:28:20-05
Xamarin addins: 9876fd7c9837977178411ec7375b4352c0a0d6af
Build lane: monodevelop-lion-cycle6-baseline

Operating System
Mac OS X 10.10.5
Comment 3 Zoltan Varga 2016-01-18 00:07:27 UTC
-> reopen.
Comment 4 Zoltan Varga 2016-01-18 15:26:14 UTC
I cannot reproduce this with:
mtouch (master: 6a2d587)
Comment 5 Sebastien Pouliot 2016-03-09 20:33:12 UTC
Just like Zoltan I cannot reproduce this (with the 9.8.x alpha release).

Closing so QA can validate before shipping to stable.
Comment 6 Naqeeb 2016-05-17 17:42:28 UTC
I have checked this issue with sample project given in comment 2 with latest C7 builds and observed that it is working fine. I am not getting any exception. Here is the screencast for the same: http://www.screencast.com/t/JwwR9ADzX9lO

Hence closing this issue.

Environment info: https://gist.github.com/anonymous/8c73202387c7bcf21a62cb63759b6be6