We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

[bug] Assigning same data to series wrapped in different container crashes

Hi,

When assigning the same chart data points to a series, if those data points are wrapped in a distinct container to the already-assigned points, a crash occurs (stack trace at end of post). There was one point where I could even reproduce with the degenerative case:

var series = ...;

// ok
series.ItemsSource = new List<ChartDataPoint>();

// crash
series.ItemsSource = new List<ChartDataPoint>();

Now the degenerative case isn't crashing for me, but we're still seeing the crash in question in production. This is despite the fact I'm doing everything reasonable (and unreasonable) to ensure I don't assign the same data set twice. I literally do a SequenceEqual using a custom IEqualityComparer<ChartDataPoint> to make sure there is at least some difference between the old data and the new.

And yet still the crash occasionally slips through.

Can this be fixed please? Let me know if you need more info.

Thanks


Stack trace:

NullReferenceException: Object reference not set to an instance of an object]

     at Syncfusion.SfChart.XForms.iOS.ChartDataSource.OnSeriesPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) <0x101d76380 + 0x00404> in <0d1615a5f9b544bbb071b0833fff2831#85fc748fdbf8cf215a14e84c3c8919bc>

     at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) <0x10185c6a0 + 0x0005f> in <7b0368eb3d0f405da776a09e3171532a#85fc748fdbf8cf215a14e84c3c8919bc>

     at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.BindableObject+SetValueFlags attributes, System.Boolean silent) <0x10185dd80 + 0x00223> in <7b0368eb3d0f405da776a09e3171532a#85fc748fdbf8cf215a14e84c3c8919bc>

     at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.BindableObject+SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) <0x10185d170 + 0x002fb> in <7b0368eb3d0f405da776a09e3171532a#85fc748fdbf8cf215a14e84c3c8919bc>

     at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) <0x10185dc00 + 0x000c3> in <7b0368eb3d0f405da776a09e3171532a#85fc748fdbf8cf215a14e84c3c8919bc>

     at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) <0x10185c4a0 + 0x0002b> in <7b0368eb3d0f405da776a09e3171532a#85fc748fdbf8cf215a14e84c3c8919bc>

     at Syncfusion.SfChart.XForms.ChartSeries.set_ItemsSource (System.Collections.IEnumerable value) <0x101c786f0 + 0x0002b> in <cd22c66ff18a46088d995a8ee99f8ef0#85fc748fdbf8cf215a14e84c3c8919bc>

     at Redacted.GraphView.<GraphView>m__3 (System.Collections.Generic.List`1[T] chartData) <0x100fa3c10 + 0x00027> in <2f264a1a4aff4e4797de18b272b8119a#85fc748fdbf8cf215a14e84c3c8919bc>


2 Replies

KB Kent Boogaart September 23, 2016 02:44 AM UTC

OK, I've been able to reliably reproduce this crash in my own project, but am struggling to create a standalone repro.

Here's what I have:

1. A Page hosting one of two possible child views (one child contains a graph and the other a gauge)
2. Dialogs that can appear in the app in response to some event (the contents of which are of no consequence)

Here's the sequence that triggers the bug:

1. The user chooses to view the graph
2. A dialog pops up and is subsequently dismissed
3. The dismissal of the dialog was causing the graph view to be recreated even though it was already visible
4. Subsequent assignment of data to ItemsSource causes the crash

I've been able to work around the problem by ensuring step 3 does not occur. That is, the graph is already the visible view, don't re-display it. I am super under the pump now trying to get this app ready for release, so doubt I'll find the time to flesh out the standalone repro so that it also crashes.


JC Jaikrishna Chandrasekar Syncfusion Team September 23, 2016 07:12 AM UTC

Hi Kent, 
 
Thank you for contacting Syncfusion support. 
 
We have created an incident under your Direct Trac account. So, we request to follow the incident for further details. 
 
Our Direct Trac support system can be accessed from the following link: 
 
 
Regards, 
Jaikrishna C 


Loader.
Live Chat Icon For mobile
Up arrow icon