Bug 26060 - ReactiveUI in Xamarin Forms 1.3.1 Unified API Crashing on Device only
Summary: ReactiveUI in Xamarin Forms 1.3.1 Unified API Crashing on Device only
Status: RESOLVED ANSWERED
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: XI 8.6.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-01-15 07:16 UTC by Michael Dimoudis
Modified: 2015-01-23 03:28 UTC (History)
8 users (show)

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

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:
Status:
RESOLVED ANSWERED

Description Michael Dimoudis 2015-01-15 07:16:48 UTC
Xamarin folk can you please please have a look at this.

This worked perfectly in 1.3.0 non unified API. After updating to Xamarin Unified API it works fine in the iOS Simulator, however deploying to an iPhone it always crashes in AppDelegate on RxApp.SuspensionHost.SetupDefaultSuspendResume();

I tried everything to no avail. Any ideas? I believe this must be a Xamarin bug? 1.3.0 non unified worked a treat.

The error is below:

System.ExecutionEngineException: Attempting to JIT compile method 'System.Reactive.Linq.QueryLanguage:Switch (System.IObservable1<System.IObservable1>)' while running with --aot-only. See http://docs.xamarin.com/ios/about/limitations for more information.

I have full testable source code up on GitHub. https://github.com/michaeldimoudis/RxFormsTest

Thank you.
Comment 1 narayanp 2015-01-15 09:20:00 UTC
I have tried to reproduce this issue and getting the same exception mentioned in bug description on deploying the attached sample on device. However it deploys successfully on Simulator without any exception.

Screencast: http://www.screencast.com/t/yjzj3jXv
Exception: https://gist.github.com/AkhileshKumar01/473935456c59e3f9427e
Application Output: https://gist.github.com/AkhileshKumar01/cc2af2dcea198f20ea3d
Build Output: https://gist.github.com/AkhileshKumar01/e278cdd6375079fe9d66
Device log: https://gist.github.com/AkhileshKumar01/9ab863dbf991256f42b3
IDE Log: https://gist.github.com/AkhileshKumar01/3ea47cf07488195b5ae1

Environment info: 
Device iPhone 5S iOS 7.1
Xamarin.Forms 1.3.1.6296

=== Xamarin Studio ===

Version 5.7 (build 661)
Installation UUID: ff0c16c6-3c75-46d8-ac56-56c3b56e2c76
Runtime:
	Mono 3.12.0 ((detached/a813491)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000068

=== Apple Developer Tools ===

Xcode 6.1.1 (6611)
Build 6A2008a

=== Xamarin.Android ===

Version: 4.20.0.28 (Business Edition)
Android SDK: /Users/360_macmini/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Xamarin.iOS ===

Version: 8.6.0.52 (Business Edition)
Hash: 7c4c2c5
Branch: 
Build date: 2015-01-08 22:29:16-0500

=== Xamarin.Mac ===

Version: 1.12.0.4 (Business Edition)

=== Build Information ===

Release ID: 507000661
Git revision: b70bab61da996da29045ea8ee8aed1a6faedbe78
Build date: 2015-01-05 16:31:31-05
Xamarin addins: 82f6c71490562d6cd125a09287f441902fdac3d7

=== Operating System ===

Mac OS X 10.10.1
Darwin Apples-iMac.local 14.0.0 Darwin Kernel Version 14.0.0
    Fri Sep 19 00:26:44 PDT 2014
    root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
Comment 2 Jason Smith [MSFT] 2015-01-18 04:44:41 UTC
This is an issue with ReactiveUI attempting to JIT in the iOS environment which will not work correctly. This is unfortunately not something that Xamarin.Forms can resolve (as its not related to forms other than it is also in the App).
Comment 3 Michael Dimoudis 2015-01-21 17:56:14 UTC
Hi

This is a class of issues that people are seeing with Rx. The identical code works on 32-bit on-device, so something has changed on Xamarin's end moving to 64-bit.

Since this is an iOS runtime bug, I've changed the product category from Forms to iOS.

Please have a look as a matter of urgency, as this will render Xamarin unified 64-bit API useless to people using Rx, and possibly more once people realise these issues will keep cropping up.

Thanks
Comment 4 Rolf Bjarne Kvinge [MSFT] 2015-01-22 04:48:47 UTC
You must enable generic value type sharing (in the project's iOS Build options - Advanced page):

https://github.com/michaeldimoudis/RxFormsTest/blob/master/iOS/RxFormsApp.iOS.csproj#L62

Disabling generic value type sharing is not a supported scenario.

You'll however run into a another issue (bug #26184), which will prevent the test case from working until the next service release.
Comment 5 Michael Dimoudis 2015-01-22 16:48:04 UTC
Thanks Rolf

My error is different now consistent with bug #26184.

Do you have an ETA when Xamarin.iOS 8.6.1.16 will be out? Any possibilities getting an early copy of this build so I can test my repro and my app?
Comment 6 Rolf Bjarne Kvinge [MSFT] 2015-01-23 03:28:25 UTC
@Michael, the current plan is to release to stable in about two weeks, which means there will be alphas/betas before that, probably next week.