maui
maui copied to clipboard
[WinUI] Silent crash when updating binding at runtime while thumb scrolling
Description
Application getting crashed without any exception while thumb scrolling(Dragging thumb).
Steps to Reproduce
- Create a sample with MainPage ->ScrollView -> StackLayout- > N number of labels till scrollviewer becomes scrollable.
- Create a ViewModel class with string Property.
- Set the ViewModel as BindingContext of MainPage or StackLayout.
- Bind the ViewModel string property to three or more label Text property.
- Subscribe ScrollView.Scrolled event, Inside the body update BindingContext of the MainPage or StackLayout.
- Now deploy the sample and scroll using thumb, application will get crashed without any exception.
Note
Try binding ViewModel.string property to more label if crashing not occurs.
Code snippet
MainPage.Xaml
<ScrollView Scrolled="ScrollView_Scrolled">
<StackLayout x:Name="Stack">
<Label Text="{Binding Name}"/>
<Label Text="Hello"/>
<Label Text="Hello"/>
<Label Text="Hello"/>
<Label Text="{Binding Name}"/>
<Label Text="{Binding Name}"/>
<Label Text="{Binding Name}"/>
<Label Text="{Binding Name}"/>
<Label Text="{Binding Name}"/>
<Label Text="{Binding Name}"/>
<Label Text="{Binding Name}"/>
<Label Text="Hello"/>
<Label Text="Hello"/>
<Label Text="Hello"/>
....
....
<Label Text="Hello"/>
</StackLayout>
</ScrollView>
ViewModel:
public class NumberViewModel : INotifyPropertyChanged
{
private string name = "hello";
public string Name
{
get { return name; }
set { name = value; this.RaisePropertyChanged(nameof(Name)); }
}
public event PropertyChangedEventHandler PropertyChanged;
public void RaisePropertyChanged(string propName)
{
if (this.PropertyChanged != null)
{
this.PropertyChanged(this, new PropertyChangedEventArgs(propName));
}
}
}
MainPage.Xaml.cs
public MainPage()
{
InitializeComponent();
this.BindingContext = new NumberViewModel();
}
private void ScrollView_Scrolled(object sender, ScrolledEventArgs e)
{
this.BindingContext = new NumberViewModel() { Name = "Updated" };
}
Video: https://user-images.githubusercontent.com/59435340/175104231-a8c8f96e-d093-42ec-99b3-65c140668af2.mp4
Version with bug
6.0.400 (current)
Last version that worked well
6.0 Release Candidate 3
Affected platforms
Windows
Affected platform versions
10.0.17763.0
Did you find any workaround?
When setting ScrollViewer(platform view) scrollbar visibility to Visible exception not occurring.
Relevant log output
The program '[32648] SampleApp.exe' has exited with code 3221225477 (0xc0000005) 'Access violation'.
not repro on windows with vs 17.3.0 Preview 3.0 [32621.293.main]. project:MauiApp6.zip https://user-images.githubusercontent.com/99457000/175191547-ec9fdd73-cbdf-47c4-a45f-f8436281bce3.mp4
Hi @kristinx0211 Can you please scroll using thumb in the scrollbar. Since the crashing occurs only while scrolling with thumb. https://user-images.githubusercontent.com/59435340/175205977-1c44302d-8a59-4682-b040-0f92533fd4e3.mp4
@RanjithkumarSyncfusion ok, thanks for your info, I can repro as you say.

Cannot reproduce the issue. Is dragging the thumb?

Hi @RanjithkumarSyncfusion. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
Hi @jsuarezruiz Sometimes issue ain't occurring with less binding. please try increasing binding Name to more labels.
Hi Team Any update on this?
Tried with 100 bindings and still cannot reproduce it.

@rachelkang Could you try to reproduce it?
Hi @RanjithkumarSyncfusion. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
Yep, I'm able to reproduce this issue. It happens if you try scrolling via thumb scrolling as soon as the app starts up. If you scroll without using the thumb scrolling / try anything else before thumb scrolling, then the issue isn't reproducible.
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
I've been working with a customer who is also seeing this issue.
This is causing a crash and is easily reproducible on WinUI. Should we be including the fatal flag and treating this as higher priority?
@RanjithkumarSyncfusion is the Syncfusion ListView built on-top of the .Net Maui ListView control? I ask because we could not reproduce this with the Maui ListView, only the SfListView. I created a sample Maui app to see if I could repro the issue we are having with our Grouped SfListView in a plain .Net Maui Grouped ListView, and I've used more data and more bindings in the layouts than we have in our SfListView scenario in our "real" app, yet could not reproduce the issue in the Maui ListView... You can see my attempt here.
Yep, I'm able to reproduce this issue. It happens if you try scrolling via thumb scrolling as soon as the app starts up. If you scroll without using the thumb scrolling / try anything else before thumb scrolling, then the issue isn't reproducible.
Could you share more details?, did you reproduce it on Windows 11?
yes, it was on windows 11. but I just created a new project on the latest version of both .NET 7 and .NET 8, and can no longer reproduce it! perhaps this has since been fixed?
@RanjithkumarSyncfusion @BenBtg is this still an issue on the latest versions?
Hi @RanjithkumarSyncfusion. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
Hi @RanjithkumarSyncfusion. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.
You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.
@rachelkang Yes, the problem has been fixed!