Bug 26961 - System.NullReferenceException when using Rx with ARM64 and the Unified API
Summary: System.NullReferenceException when using Rx with ARM64 and the Unified API
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: XI 8.6.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Zoltan Varga
Depends on:
Reported: 2015-02-11 14:44 UTC by John Miller [MSFT]
Modified: 2015-02-19 06:13 UTC (History)
6 users (show)

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

Test Case (23.22 KB, application/zip)
2015-02-11 14:44 UTC, John Miller [MSFT]
Crash Log (9.67 KB, text/plain)
2015-02-11 14:44 UTC, John Miller [MSFT]

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 John Miller [MSFT] 2015-02-11 14:44:13 UTC
Created attachment 9772 [details]
Test Case


   After updating to the Unified API, using Reactive Extensions on an ARM64 device causes a System.NullReferenceException. 

**Steps to Reproduce:**

   1. Run the attached sample on a 64 bit iOS device

**Actual Results:**

  >2015-02-11 14:38:12.587 Rx64bitBug[2512:1438443] Unhandled managed exception: Object reference not set to an instance of an object (System.NullReferenceException)
  >at System.Collections.Generic.Dictionary`2+Enumerator[System.Object,System.Reactive.Joins.IJoinObserver].VerifyState () [0x00000] in <filename unknown>:0 
  >at System.Collections.Generic.Dictionary`2+Enumerator[System.Object,System.Reactive.Joins.IJoinObserver].MoveNext () [0x00000] in <filename unknown>:0 
  >at System.Collections.Generic.Dictionary`2+ValueCollection+Enumerator[System.Object,System.Reactive.Joins.IJoinObserver].MoveNext () [0x00000] in <filename unknown>:0 
  >at (wrapper unknown) object:gsharedvt_out ()
  >at System.Reactive.Linq.QueryLanguage+<When>c__AnonStorey2`1[System.Int32].<>m__0 (IObserver`1 observer) [0x00000] in <filename unknown>:0 
  >at System.Reactive.AnonymousObservable`1[System.Int32].SubscribeCore (IObserver`1 observer) [0x00000] in <filename unknown>:0 
  >at System.Reactive.ObservableBase`1[System.Int32].ScheduledSubscribe (IScheduler _, System.Reactive.AutoDetachObserver`1 autoDetachObserver) [0x00000] in <filename unknown>:0 

**Expected Results:**

   No exception.

**Build Date & Platform:**

   XI 8.6.1
   Unified API

**Additional Information:**

   Attached the crash log from the above stack trace
   Tried the NuGet RX package and had similar results (2.2.5)
Comment 1 John Miller [MSFT] 2015-02-11 14:44:53 UTC
Created attachment 9773 [details]
Crash Log
Comment 2 Naqeeb 2015-02-12 05:24:26 UTC
I have checked this issue and able to reproduce this successfully. To reproduce this issue i have followed below steps:

1. Open test Attached test case in bug in XS.
2. Run the app on the iOS device (iPhone 5S iOS 8.1.2).
3. Click on button 'Test' and got the issue. 

Please refer screencast : http://www.screencast.com/t/XZyRMGwE

Exception Details: https://gist.github.com/Mohit-Kheterpal/87de98c852925c8dbb06
Ide log: https://gist.github.com/Mohit-Kheterpal/9841a44506dd030558c8
iOS Device log: https://gist.github.com/Mohit-Kheterpal/c7ec209465d8229ce657

Environment info:

=== Xamarin Studio ===

Version 5.7.1 (build 17)
Installation UUID: 3dbf10c4-ed30-4e55-8a8b-1704777c7b5f
 Mono 3.12.0 ((detached/de2f33f)
 GTK+ 2.24.23 (Raleigh theme)

 Package version: 312000076

=== Apple Developer Tools ===

Xcode 5.1.1 (5085)
Build 5B1008

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: 98ee412
Build date: 2015-02-11 04:37:05-0500

=== Build Information ===

Release ID: 507010017
Git revision: 0bc7d3550b6b088ac25b08dcf7bbe73bcc8658b3
Build date: 2015-02-03 19:43:29-05
Xamarin addins: f7b7d34419c9ec24501bfa7c658e80a6305613e0

=== Operating System ===

Mac OS X 10.8.5
Darwin localhost 12.5.0 Darwin Kernel Version 12.5.0
    Sun Sep 29 13:33:47 PDT 2013
    root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64
Comment 3 Rolf Bjarne Kvinge [MSFT] 2015-02-12 06:13:51 UTC
Zoltan, looks like an ARM64 bug (and I can reproduce this with maccore/master).
Comment 4 Zoltan Varga 2015-02-13 13:39:29 UTC
Fixed in mono-extensions e561a511201f30c0a314b611381faa5e5cbbefdb.
Comment 5 Udham Singh 2015-02-18 07:43:11 UTC
To verify his issue efficiently first I have tried to reproduce this and able to reproduce it successfully with Xamarin.iOS Version: And when I tried to verify this with Xamarin.iOS (latest from master branch) I observed application got crashed when I clicked on button 'Test'.

Screencast : http://www.screencast.com/t/TvGKlfU2
Crash Log (Xcode) : https://gist.github.com/Udham1/f53b08ae2b6f365284f3
iOS Device Log (Xcode) : https://gist.github.com/Udham1/282d109766d08aee6610
Application Output : https://gist.github.com/Udham1/94a92ef44952bece01f4
Ide Logs : https://gist.github.com/Udham1/562b234d2b836b9a8618

As of now I am reopening this issue. Please let me know with which build should I verify this issue.

=== Xamarin Studio ===

Version 5.7.2 (build 1)
Installation UUID: ce927b2a-2c07-44c5-b186-09cfdafba6dc
	Mono 3.12.0 ((detached/de2f33f)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000076

=== Apple Developer Tools ===

Xcode 6.1.1 (6611)
Build 6A2008a

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: d7d470e
Branch: master
Build date: 2015-02-12 00:28:19-0500

=== Build Information ===

Release ID: 507020001
Git revision: 103486e2547553077836a5ba20a973487b983830
Build date: 2015-02-13 11:56:36-05
Xamarin addins: 8dd5b934e86ef0595c022dd3930fd40e3376ab4c

=== Operating System ===

Mac OS X 10.9.5
Darwin Xamarin76s-Mac-mini.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Comment 6 Sebastien Pouliot 2015-02-18 08:25:38 UTC
@Udam right now there are several branches (tracking different mono) that can produce the same build number. Can you provide the thelink where the builds you use comes from (for any 8.9.x version) ?

I updated the card with a specific build (that tracks mono/master) with which you can verify the issue is fixed.
Comment 7 Udham Singh 2015-02-18 08:31:33 UTC
I got this build in folder 'Xamarin.iOS Master' under folder 'master' in dropbox.
Comment 8 Udham Singh 2015-02-18 09:03:34 UTC
I have checked this issue with following builds 

Environment Info :

Xamarin Studio 5.7.2 (build 1)
Mono 3.12.0 ((detached/de2f33f)
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Android (Business Edition)
Xcode 6.1.1 (6611)
Xamarin.iOS (Business Edition)

Now this issue has been fixed, Hence closing this issue.
Screencast : http://www.screencast.com/t/kfJVKdzdVQ
Comment 9 Sebastien Pouliot 2015-02-18 09:29:55 UTC
Backported for SR2 in 5805b0b6b899551f174ed5d7d327fa0079f2cfc2
Comment 10 Udham Singh 2015-02-19 06:13:14 UTC
I have checked this issue with Xamarin.iOS and this issue has been fixed Xamarin.iOS Hence I am closing this issue. Screencast : http://www.screencast.com/t/I7bOEPjHY