This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 55745 - [iOS] NRE in ListView with HasUnevenRows=true after changing content and rebinding
Summary: [iOS] NRE in ListView with HasUnevenRows=true after changing content and rebi...
Status: VERIFIED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS (show other bugs)
Version: 2.3.5
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jimmy
URL:
Depends on:
Blocks:
 
Reported: 2017-04-28 19:39 UTC by otyq08
Modified: 2017-06-29 12:00 UTC (History)
6 users (show)

See Also:
Tags: ios crash listview labelrenderer ac
Is this bug a regression?: Yes
Last known good build: Forms 2.3.4


Attachments
Simple project for reproduction. (296.04 KB, application/x-zip-compressed)
2017-04-28 19:39 UTC, otyq08
Details

Description otyq08 2017-04-28 19:39:48 UTC
Created attachment 21893 [details]
Simple project for reproduction.

Overview:
-------------- 
NullReferenceException occurs after two simple operations in the ListView. First clear the list and add a item. Then clear and bind to a new ObservableCollection with previous content.

 	0x51 in UIKit.UIApplication.UIApplicationMain	C#
 	0xB in UIKit.UIApplication.Main at /Users/builder/data/lanes/4466/a04678c2/source/xamarin-macios/src/UIKit/UIApplication.cs:79,4	C#
 	0x3B in UIKit.UIApplication.Main at /Users/builder/data/lanes/4466/a04678c2/source/xamarin-macios/src/UIKit/UIApplication.cs:63,4	C#
>	0x8 in iOSNullRef.iOS.Application.Main at C:\Xamarin\iOSNullRef\iOSNullRef\iOSNullRef.iOS\Main.cs:17,4	C#

Does not happen with HasUnevenRows=false

Steps to Reproduce:
---------------------------
Press Toggle Button twice in attached simple example.

Actual Results: 
-------------------
The application crashes.

Expected Results: 
--------------------
The ListView should show the new content.

Build Date & Hardware: 
------------------------------
Occurs on Forms 2.3.5.235-pre2 and pre1 with iOS Simulator iOS 10.3
Does not occur on Android or UWP. 
Does not occur on Forms 2.3.4
Comment 1 Jimmy 2017-04-28 22:18:38 UTC
I am able to reproduce this issue using the attached project and repro steps. I can confirm that this is a regression in 2.3.5.

As mentioned, the crash does _not_ occur if HasUnevenRows = false.

Complete stacktrace: https://gist.github.com/jimmgarrido/ff552aef31497910099e78746792c0db


### Regression test
2.3.5-pre2  BAD
2.3.4.231   GOOD
2.3.3.193   GOOD
Comment 2 Samantha Houts 2017-05-02 19:54:12 UTC
https://github.com/xamarin/Xamarin.Forms/pull/894
Comment 3 Samantha Houts 2017-05-10 18:05:14 UTC
Should be fixed in 2.3.5-pre3. Thank you!
Comment 4 Saurabh Paunikar 2017-06-29 12:00:38 UTC
Fixed verified on 
Xamarin.Forms version 2.3.5.255-pre5

Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Enterprise

Xamarin   4.6.0.279 (de55d19)
Xamarin.Android   7.4.0.13 (f6289cd)
Xamarin.iOS   10.12.0.12 (494fcbc)

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