Bug 35855 - Attempting to JIT compile method '(wrapper unknown) System.Collections.ObjectModel.ObservableCollection`1<tryfsharpforms.DoubleDoubleDataPoint>[]:Get (int)' while running with --aot-only.
Summary: Attempting to JIT compile method '(wrapper unknown) System.Collections.Object...
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Mono runtime / AOT compiler (show other bugs)
Version: XI 9.2
Hardware: Macintosh Mac OS
: --- critical
Target Milestone: Untriaged
Assignee: Zoltan Varga
URL:
Depends on:
Blocks:
 
Reported: 2015-11-13 20:50 UTC by Ian Leatherbury
Modified: 2015-11-21 06:55 UTC (History)
3 users (show)

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


Attachments

Description Ian Leatherbury 2015-11-13 20:50:59 UTC
# Steps to reproduce
Download this project: https://github.com/ianleatherbury/tryfsharpforms
1. Deploy to a iPhone
2. Click Pricing European Options > Click "Calculate!" button
3. App will crash

# Expected behavior
A page is pushed and a graph is produced.

# Actual behavior
The app crashes

# Supplemental info (logs, images, videos)
This is Xamarin.Forms project where the C# PCL is referencing an F# PCL for data analysis calculations. Both are on PCL Profile 7. The app runs fine on Simulator. I'm not sure that it is due to the F# PCL, because while debugging I am able to return a IEnumerable<IEnumerable<Tuple<double, double>>>, and populate my public property ObservableCollection<DoubleDoubleDataPoint>[] DataArray { get; set;} in BlackScholesViewModel.cs.

Message: Exception has been thrown by the target of an invocation.

Source: mscorlib

Inner Exception: 
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ExecutionEngineException: Attempting to JIT compile method '(wrapper unknown) System.Collections.ObjectModel.ObservableCollection`1<tryfsharpforms.DoubleDoubleDataPoint>[]:Get (int)' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information.

  at at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /Users/builder/data/lanes/2356/3c0ec355/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:295
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00050] in /Users/builder/data/lanes/2356/3c0ec355/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:303
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /Users/builder/data/lanes/2356/3c0ec355/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/reflection/methodbase.cs:277
  at Xamarin.Forms.BindingExpression+BindingExpressionPart.TryGetValue (System.Object source, System.Object& value) [0x0001e] in <filename unknown>:0
  at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, Boolean fromTarget) [0x0017e] in <filename unknown>:0
  at Xamarin.Forms.BindingExpression.Apply (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property) [0x00079] in <filename unknown>:0
  at Xamarin.Forms.Binding.Apply (System.Object newContext, Xamarin.Forms.BindableObject bindObj, Xamarin.Forms.BindableProperty targetProperty) [0x00055] in <filename unknown>:0
  at Xamarin.Forms.BindableObject.ApplyBindings (System.Object oldContext) [0x0002e] in <filename unknown>:0
  at Xamarin.Forms.BindableObject.BindingContextPropertyBindingPropertyChanged (Xamarin.Forms.BindableObject bindable, System.Object oldvalue, System.Object newvalue) [0x0000e] in <filename unknown>:0
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindablePropertyContext context, System.Object value, Boolean currentlyApplying, SetValueFlags attributes, Boolean silent) [0x00112] in <filename unknown>:0
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes) [0x001f3] in <filename unknown>:0
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, Boolean fromStyle, Boolean checkAccess) [0x00061] in <filename unknown>:0
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in <filename unknown>:0
  at Xamarin.Forms.BindableObject.set_BindingContext (System.Object value) [0x00000] in <filename unknown>:0
  at Syncfusion.SfChart.XForms.SfChart.OnBindingContextChanged () [0x0001c] in <filename unknown>:0
  at Xamarin.Forms.BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) [0x00066] in <filename unknown>:0
  at Xamarin.Forms.Element.OnBindingContextChanged () [0x00018] in <filename unknown>:0
  at Xamarin.Forms.Page.OnBindingContextChanged () [0x00000] in <filename unknown>:0
  at Xamarin.Forms.BindableObject.BindingContextPropertyBindingPropertyChanged (Xamarin.Forms.BindableObject bindable, System.Object oldvalue, System.Object newvalue) [0x0001a] in <filename unknown>:0
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindablePropertyContext context, System.Object value, Boolean currentlyApplying, SetValueFlags attributes, Boolean silent) [0x00112] in <filename unknown>:0
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes) [0x001f3] in <filename unknown>:0
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, Boolean fromStyle, Boolean checkAccess) [0x00061] in <filename unknown>:0
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in <filename unknown>:0
  at Xamarin.Forms.BindableObject.set_BindingContext (System.Object value) [0x00000] in <filename unknown>:0
  at tryfsharpforms.BlackScholesChartPage..ctor (IEnumerable`1 list) [0x0001f] in /Users/ianl/Projects/tryfsharpforms/tryfsharpforms/PricingFinancialOptionsPages/ChartPages/BlackScholesChartPage.xaml.cs:17
  at tryfsharpforms.PricingEuropeanOptionsPage.CalcBsMsft_Clicked (System.Object sender, System.EventArgs e) [0x00015] in /Users/ianl/Projects/tryfsharpforms/tryfsharpforms/PricingFinancialOptionsPages/PricingEuropeanOptionsPage.xaml.cs:48
  at Xamarin.Forms.Button.Xamarin.Forms.IButtonController.SendClicked () [0x00020] in <filename unknown>:0
  at Xamarin.Forms.Platform.iOS.ButtonRenderer.OnButtonTouchUpInside (System.Object sender, System.EventArgs eventArgs) [0x0000e] in <filename unknown>:0
  at UIKit.UIControlEventProxy.Activated () [0x00007] in /Users/builder/data/lanes/2356/3c0ec355/source/maccore/src/UIKit/UIControl.cs:37
  at at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00005] in /Users/builder/data/lanes/2356/3c0ec355/source/maccore/src/UIKit/UIApplication.cs:77
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0001c] in /Users/builder/data/lanes/2356/3c0ec355/source/maccore/src/UIKit/UIApplication.cs:60
  at tryfsharpforms.iOS.Application.Main (System.String[] args) [0x00008] in /Users/ianl/Projects/tryfsharpforms/iOS/Main.cs:17

StackTrace:
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00050] in /Users/builder/data/lanes/2356/3c0ec355/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:303 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /Users/builder/data/lanes/2356/3c0ec355/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/reflection/methodbase.cs:277 
  at Xamarin.Forms.BindingExpression+BindingExpressionPart.TryGetValue (System.Object source, System.Object& value) [0x0001e] in <filename unknown>:0 
  at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, Boolean fromTarget) [0x0017e] in <filename unknown>:0 
  at Xamarin.Forms.BindingExpression.Apply (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property) [0x00079] in <filename unknown>:0 
  at Xamarin.Forms.Binding.Apply (System.Object newContext, Xamarin.Forms.BindableObject bindObj, Xamarin.Forms.BindableProperty targetProperty) [0x00055] in <filename unknown>:0 
  at Xamarin.Forms.BindableObject.ApplyBindings (System.Object oldContext) [0x0002e] in <filename unknown>:0 
  at Xamarin.Forms.BindableObject.BindingContextPropertyBindingPropertyChanged (Xamarin.Forms.BindableObject bindable, System.Object oldvalue, System.Object newvalue) [0x0000e] in <filename unknown>:0 
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindablePropertyContext context, System.Object value, Boolean currentlyApplying, SetValueFlags attributes, Boolean silent) [0x00112] in <filename unknown>:0 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes) [0x001f3] in <filename unknown>:0 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, Boolean fromStyle, Boolean checkAccess) [0x00061] in <filename unknown>:0 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in <filename unknown>:0 
  at Xamarin.Forms.BindableObject.set_BindingContext (System.Object value) [0x00000] in <filename unknown>:0 
  at Syncfusion.SfChart.XForms.SfChart.OnBindingContextChanged () [0x0001c] in <filename unknown>:0 
  at Xamarin.Forms.BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) [0x00066] in <filename unknown>:0 
  at Xamarin.Forms.Element.OnBindingContextChanged () [0x00018] in <filename unknown>:0 
  at Xamarin.Forms.Page.OnBindingContextChanged () [0x00000] in <filename unknown>:0 
  at Xamarin.Forms.BindableObject.BindingContextPropertyBindingPropertyChanged (Xamarin.Forms.BindableObject bindable, System.Object oldvalue, System.Object newvalue) [0x0001a] in <filename unknown>:0 
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindablePropertyContext context, System.Object value, Boolean currentlyApplying, SetValueFlags attributes, Boolean silent) [0x00112] in <filename unknown>:0 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes) [0x001f3] in <filename unknown>:0 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, Boolean fromStyle, Boolean checkAccess) [0x00061] in <filename unknown>:0 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in <filename unknown>:0 
  at Xamarin.Forms.BindableObject.set_BindingContext (System.Object value) [0x00000] in <filename unknown>:0 
  at tryfsharpforms.BlackScholesChartPage..ctor (IEnumerable`1 list) [0x0001f] in /Users/ianl/Projects/tryfsharpforms/tryfsharpforms/PricingFinancialOptionsPages/ChartPages/BlackScholesChartPage.xaml.cs:17 
  at tryfsharpforms.PricingEuropeanOptionsPage.CalcBsMsft_Clicked (System.Object sender, System.EventArgs e) [0x00015] in /Users/ianl/Projects/tryfsharpforms/tryfsharpforms/PricingFinancialOptionsPages/PricingEuropeanOptionsPage.xaml.cs:48 
  at Xamarin.Forms.Button.Xamarin.Forms.IButtonController.SendClicked () [0x00020] in <filename unknown>:0 
  at Xamarin.Forms.Platform.iOS.ButtonRenderer.OnButtonTouchUpInside (System.Object sender, System.EventArgs eventArgs) [0x0000e] in <filename unknown>:0 
  at UIKit.UIControlEventProxy.Activated () [0x00007] in /Users/builder/data/lanes/2356/3c0ec355/source/maccore/src/UIKit/UIControl.cs:37 
  at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00005] in /Users/builder/data/lanes/2356/3c0ec355/source/maccore/src/UIKit/UIApplication.cs:77 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0001c] in /Users/builder/data/lanes/2356/3c0ec355/source/maccore/src/UIKit/UIApplication.cs:60 
  at tryfsharpforms.iOS.Application.Main (System.String[] args) [0x00008] in /Users/ianl/Projects/tryfsharpforms/iOS/Main.cs:17 

# Test environment (full version information)
=== Xamarin Studio ===

Version 6.0 (build 1752)
Installation UUID: a94920a1-f856-4824-bfd3-9fdd755e5783
Runtime:
	Mono 4.2.1 (explicit/6dd2d0d)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 402010102

=== Xamarin.Profiler ===

Version: 0.20.0.0
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Xamarin.Android ===

Version: 6.0.0.33 (Enterprise Edition)
Android SDK: /Users/ianl/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
		5.1   (API level 22)

SDK Tools Version: 24.3.4
SDK Platform Tools Version: 23
SDK Build Tools Version: 23.0.0

Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin Android Player ===

Not Installed

=== Apple Developer Tools ===

Xcode 7.1.1 (9081)
Build 7B1005

=== Xamarin.Mac ===

Version: 2.4.0.109 (Enterprise Edition)

=== Xamarin.iOS ===

Version: 9.2.1.51 (Enterprise Edition)
Hash: 3c0ec35
Branch: master
Build date: 2015-11-12 13:05:39-0500

=== Build Information ===

Release ID: 600001752
Git revision: 82f4627b45b35ff833ffd6fe8dcd8601b595b0a2
Build date: 2015-11-04 11:57:18-05
Xamarin addins: 22dfcd8727ec2315920dc0c22d77470698c2b839
Build lane: monodevelop-lion-roslyn

=== Operating System ===

Mac OS X 10.11.1
Darwin ianl-mac-old-2.local 15.0.0 Darwin Kernel Version 15.0.0
    Sat Sep 19 15:53:46 PDT 2015
    root:xnu-3247.10.11~1/RELEASE_X86_64 x86_64
Comment 1 Zoltan Varga 2015-11-20 09:45:03 UTC
Simple testcase:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
		var arr = Array.CreateInstance (typeof (ObservableCollection<string>), 1);
		Console.WriteLine (arr.GetType ().GetMethod ("Get").Invoke (arr, new object [] { 0 }));
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Comment 2 Zoltan Varga 2015-11-21 06:55:33 UTC
Fixed in mono master 29b72e83295fbf668660413843119c67245d462f. maccore master 51807536fa1f3229518dc60b69d3ce6df390dbed contains a mono bump which picks up the fix.

Note You need to log in before you can comment on or make changes to this bug.