locked
Unified + 64-bit device + Rx v2.2.5 => "Disposable has already been assigned" RRS feed

  • Question

  • User16203 posted

    My Unified Xamarin Forms app runs fine on an iPod 5 and on the simulator but on an iPhone 6 it throws an exception "Disposable has already been assigned". This is using Reactive Extensions version 2.2.5.

    Is anyone else seeing issues with Unified + 64-bit device + Rx? or have a workaround?

    System.InvalidOperationException: Disposable has already been assigned.
      at System.Reactive.Disposables.SingleAssignmentDisposable.set_Disposable (IDisposable value) [0x00000] in <filename unknown>:0
      at System.Reactive.Producer`1+State[XXXX].Assign (IDisposable s) [0x00000] in <filename unknown>:0
      at System.Reactive.Concurrency.ObserveOn`1[XXXX].Run (IObserver`1 observer, IDisposable cancel, System.Action`1 setSink) [0x00000] in <filename unknown>:0
      at System.Reactive.Producer`1[XXXX].Run (IScheduler _, State x) [0x00000] in <filename unknown>:0
      at at (wrapper unknown) object:gsharedvt_out ()
      at System.Reactive.Concurrency.ScheduledItem`2[System.TimeSpan,System.Reactive.Producer`1+State[XXXX]].InvokeCore () [0x00000] in <filename unknown>:0
      at System.Reactive.Concurrency.ScheduledItem`1[System.TimeSpan].Invoke () [0x00000] in <filename unknown>:0
      at System.Reactive.Concurrency.CurrentThreadScheduler+Trampoline.Run (System.Reactive.Concurrency.SchedulerQueue`1 queue) [0x00000] in <filename unknown>:0
      at System.Reactive.Concurrency.CurrentThreadScheduler.Schedule[State] (State state, TimeSpan dueTime, System.Func`3 action) [0x00000] in <filename unknown>:0
      at at (wrapper unknown) object:gsharedvt_in ()
      at at (wrapper unknown) object:gsharedvt_out ()
      at System.Reactive.Concurrency.LocalScheduler.Schedule[State] (State state, System.Func`3 action) [0x00000] in <filename unknown>:0
      at at (wrapper unknown) object:gsharedvt_in ()
      at System.Reactive.Producer`1[XXXX].SubscribeRaw (IObserver`1 observer, Boolean enableSafeguard) [0x00000] in <filename unknown>:0
      at System.Reactive.Producer`1[XXXX].Subscribe (IObserver`1 observer) [0x00000] in <filename unknown>:0
      at System.ObservableExtensions.Subscribe[XXX] (IObservable`1 source, System.Action`1 onNext) [0x00000] in <filename unknown>:0
      at XXXX+<OnAppearing>c__async0.MoveNext () [0x00417] in ....
    

    The calling code looks like this:-

    this.subscription = Observable.Interval (TimeSpan.FromHours (1)).StartWith (0)
                .Delay (shift)
                .Select(async x => {
                    ...
                    var f = await Poll (this.cancelSource.Token, now, settings.Position);
                    await cache.Save(f);
                    return f;
                })
                .Select( x => x.Result)
                .ObserveOn(System.Threading.SynchronizationContext.Current)
                .Subscribe(async (f) => {
                    await this.Update(f);
                });
    
    Friday, January 16, 2015 1:15 AM

All replies

  • User39 posted

    If something only happens on a 64-bit device, it's most likely a bug in our code, in which case the best course of action is to file a bug (http://bugzilla.xamarin.com) with a solution we can use to reproduce the issue.

    Friday, January 16, 2015 7:24 AM
  • User100520 posted

    Filed it under https://bugzilla.xamarin.com/show_bug.cgi?id=26184 and attached a C# project that repros the issue.

    Tuesday, January 20, 2015 3:58 AM
  • User7157 posted

    Same issue here!

    Tuesday, January 20, 2015 5:38 PM
  • User16203 posted

    Fixed in Xamarin.iOS 8.6.1.18 according to Bugzilla. How soon will that make its way to at least the alpha channel?

    Monday, January 26, 2015 12:48 AM
  • User94953 posted

    Can we expect this fix in stable updates channel for Indie license in nearest days?

    Wednesday, January 28, 2015 3:05 PM
  • User26121 posted

    Up, I need this one to be fixed fast, I have to publish an app tomorrow :S

    Wednesday, February 4, 2015 1:42 PM
  • User68518 posted

    Got same issue.

    Thursday, February 19, 2015 4:16 AM