maui icon indicating copy to clipboard operation
maui copied to clipboard

[WinUI] Silent crash when updating binding at runtime while thumb scrolling

Open RanjithkumarSyncfusion opened this issue 3 years ago • 14 comments

Description

Application getting crashed without any exception while thumb scrolling(Dragging thumb).

Steps to Reproduce

  1. Create a sample with MainPage ->ScrollView -> StackLayout- > N number of labels till scrollviewer becomes scrollable.
  2. Create a ViewModel class with string Property.
  3. Set the ViewModel as BindingContext of MainPage or StackLayout.
  4. Bind the ViewModel string property to three or more label Text property.
  5. Subscribe ScrollView.Scrolled event, Inside the body update BindingContext of the MainPage or StackLayout.
  6. 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'.

RanjithkumarSyncfusion avatar Jun 22 '22 17:06 RanjithkumarSyncfusion

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

kristinx0211 avatar Jun 23 '22 02:06 kristinx0211

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 avatar Jun 23 '22 03:06 RanjithkumarSyncfusion

@RanjithkumarSyncfusion ok, thanks for your info, I can repro as you say. image

kristinx0211 avatar Jun 23 '22 05:06 kristinx0211

Cannot reproduce the issue. Is dragging the thumb? issue-8247

jsuarezruiz avatar Jun 24 '22 08:06 jsuarezruiz

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.

ghost avatar Jun 24 '22 08:06 ghost

Hi @jsuarezruiz Sometimes issue ain't occurring with less binding. please try increasing binding Name to more labels.

RanjithkumarSyncfusion avatar Jun 24 '22 09:06 RanjithkumarSyncfusion

Hi Team Any update on this?

RanjithkumarSyncfusion avatar Jun 28 '22 17:06 RanjithkumarSyncfusion

Tried with 100 bindings and still cannot reproduce it. issue-8247

@rachelkang Could you try to reproduce it?

jsuarezruiz avatar Jun 29 '22 13:06 jsuarezruiz

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.

ghost avatar Jun 29 '22 14:06 ghost

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.

rachelkang avatar Jun 30 '22 19:06 rachelkang

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.

ghost avatar Aug 30 '22 14:08 ghost

I've been working with a customer who is also seeing this issue.

BenBtg avatar Sep 08 '22 15:09 BenBtg

This is causing a crash and is easily reproducible on WinUI. Should we be including the fatal flag and treating this as higher priority?

BenBtg avatar Sep 08 '22 15:09 BenBtg

@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.

breenbob avatar Sep 22 '22 11:09 breenbob

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?

jsuarezruiz avatar May 08 '23 12:05 jsuarezruiz

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?

rachelkang avatar May 26 '23 21:05 rachelkang

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.

ghost avatar Jun 15 '23 15:06 ghost

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.

ghost avatar Jun 15 '23 15:06 ghost

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.

ghost avatar Jun 19 '23 16:06 ghost

@rachelkang Yes, the problem has been fixed!

RanjithkumarSyncfusion avatar Jun 21 '23 05:06 RanjithkumarSyncfusion