Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access Violation in WinUI 3 #7695

Closed
1 of 2 tasks
hez2010 opened this issue Sep 7, 2022 · 8 comments
Closed
1 of 2 tasks

Access Violation in WinUI 3 #7695

hez2010 opened this issue Sep 7, 2022 · 8 comments
Labels
bug Something isn't working closed-NotRepro Described behavior could not be reproduced. needs-repro product-winui3 WinUI 3 issues team-Rendering Issue for the Rendering team

Comments

@hez2010
Copy link

hez2010 commented Sep 7, 2022

Describe the bug

We encountered access violation while developing a WinUI 3 app. It happens in the PropertyChanged event for our ColumnsViewModel (we use this ViewModel to provide column properties for ListView).
Given that the failure happens in unmanaged code with 0xC0000005, we think this might be a bug of WinUI 3.

Steps to reproduce the bug

App dump: https://1drv.ms/u/s!ApWNk8G_rszRgooFZijjJphwT7b17g?e=1UowSc

Expected behavior

No crashing is expected.

Screenshots

image

image

NuGet package version

WASDK 1.2-preview1

Windows app type

  • UWP
  • Win32

Device form factor

Desktop

Windows version

Windows Insider Build (25193)

@hez2010 hez2010 added the bug Something isn't working label Sep 7, 2022
@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Sep 7, 2022
@lukedukeus
Copy link

I hit this issue when binding to a property on an interface or abstract class with a treeview

@yaira2
Copy link
Contributor

yaira2 commented Oct 9, 2022

This issue is blocking us from adopting WinUI 3. @gabbybilka

@MikeHillberg
Copy link
Contributor

Agree it looks like a bug in WinUI3. Thanks for providing the debug info. In response to the property change notification, it's trying to reach back and get the new value, and it looks like the pointer it has to the internal ICustomProperty reflection object is bad.

In the interest of getting unblocked, maybe you could switch this binding to an {x:Bind}, or otherwise add some code to replace it. If it's happening for all of the bindings on this object, then that would be interesting to know too.

@bpulliam bpulliam added product-winui3 WinUI 3 issues team-Rendering Issue for the Rendering team and removed needs-triage Issue needs to be triaged by the area owners labels Oct 11, 2022
@hez2010
Copy link
Author

hez2010 commented Nov 7, 2022

We already use x:Bind where possible but seems that it is still crashing. It's weird that the crash only happens on ListView, if we use a GridView then the crash just disappeared.
This issue has been a release blocker for us (we recently migrated Files from UWP to WinUI 3, and this issue causes random crashes during folder navigation).

@hez2010
Copy link
Author

hez2010 commented Nov 11, 2022

We workarounded the issue by not replacing the whole viewModel but instead changing the properties of the viewModel.
See files-community/Files#10447.

@github-actions
Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@hez2010
Copy link
Author

hez2010 commented Jul 29, 2023

To recap this issue, it may happen when you are replacing the existing ViewModel with a new instance of ViewModel and then notify the changes using the PropertyChanged event.

class ParentViewModel : INotifyPropertyChanged
{
    private ChildViewModel _children;
    public ChildViewModel Children
    {
        get => ...
        set
        {
            _children = value;
            PropertyChanged?.Invoke(this, new(nameof(ChildViewModel)));
        }
    }
}

Then bind your page to ParentViewModel and the column definitations of a ListView to Children. You may reproduce it if the Children being replaced frequently.

@llongley llongley closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2023
@llongley llongley added closed-NotRepro Described behavior could not be reproduced. needs-review ?? and removed needs-review 👀 labels Aug 30, 2023
@yaira2
Copy link
Contributor

yaira2 commented Aug 30, 2023

@llongley as someone who manages a large repo, I understand the challenge of trying to manage issues and I appreciate everything that's being done to close old issues. Having said that, it's disappointing when issues get closed without having a discussion with the author who took the time to report the issue and keep it active. This doesn't reflect well on WinUI and I hope you reconsider the processes being used to close issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working closed-NotRepro Described behavior could not be reproduced. needs-repro product-winui3 WinUI 3 issues team-Rendering Issue for the Rendering team
Projects
None yet
Development

No branches or pull requests

8 participants