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

Null Reference Exception in ABI.Microsoft.UI.Xaml.Data.ICustomProperty #840

Closed
JanRajnoha opened this issue May 8, 2021 · 16 comments
Closed
Assignees
Labels
bug Something isn't working fixed Issue has been fixed in an upcoming or existing release
Milestone

Comments

@JanRajnoha
Copy link

Describe the bug
First think, I'm not sure, it should be here, but I don't know about better place.

In my app I get Null Reference exception, when I'm trying to Notify Property Change. Null exception but throw after some time, with no specific time or user flow through app, it is random. Problem is probably in function Do_Abi_GetValue_2, but i'm not sure. Here is stack trace of exception:
image

Exception has no other useful information (I think), no keys or values related to exception. I tried to find, what was null, but without success.

Steps to reproduce the bug
Steps to reproduce the behavior:
Repo link - This is copy of real repo, but with changed DB info

  1. Start app packaged
  2. Sign as User
  3. Do some sells and payments
  4. Tables
  5. Click on T1
  6. Do sell by click on some product
  7. Pay by Pay button
  8. Do payment (you could split table, transfer items, ...)
  9. After a few steps between tables view, table and payment you will get Null Reference Exception

Expected behavior
No exception, property changed notification should work okay.

Version Info
Windows 10 Insider, tested on multiple versions including 21364.1

NuGet package version:
[WinUI 3 - Project Reunion 0.5: 0.5.6]

Windows 10 version Saw the problem?
Insider Build (21364.1) Yes
May 2020 Update (19041) Not tested
November 2019 Update (18363) Not tested
May 2019 Update (18362) Not tested
October 2018 Update (17763) Not tested

Additional context

@JanRajnoha JanRajnoha added the bug Something isn't working label May 8, 2021
@angelazhangmsft angelazhangmsft added this to the Release 1.2.8 milestone May 11, 2021
@Marv51
Copy link

Marv51 commented May 27, 2021

Hi @angelazhangmsft and @Scottj1s

Can you give an update on this issue? For me with WinUI 3 this is a blocker. The app crashes randomly when PropertyChanged events occur. We can not get through a 10 minute demo of our app without this crash occurring.

Any guidance or tips how to find a workaround?

@Marv51
Copy link

Marv51 commented May 27, 2021

BTW this is tracked at WinUI as microsoft/microsoft-ui-xaml#4926

@Scottj1s
Copy link
Member

Scottj1s commented Jun 7, 2021

Thanks @JanRajnoha and @Marv51 - we can repro this issue and are currently investigating

@Scottj1s
Copy link
Member

Scottj1s commented Jun 7, 2021

@JanRajnoha can you provide more repro steps? I tried both slns in your repo, with multiple combinations of build config and startup project. The farthest I got with the CloudCash.Package was a crash at launch:
'Windows.Graphics.Display: GetForCurrentView must be called on a thread that is associated with a CoreWindow.'.

@Scottj1s
Copy link
Member

Scottj1s commented Jun 7, 2021

@JanRajnoha - never mind, it looks like @manodasanW has found workable repro steps:

  1. Adding the Windows Community toolkit preview feed
  2. Changing the configuration to debug
  3. Set the main project as packaging project

@JanRajnoha
Copy link
Author

Hi @angelazhangmsft, this bug makes development process of our app for client much slower, and it is becoming critical to fulfill release plan. Could you please provide any release date for this bug fix?

@manodasanW
Copy link
Member

@JanRajnoha I am actively investigating this issue. Since I didn't have a root cause before the deadline for this milestone / release, it had to be moved to the next. This issue is being a bit tricky to root cause given the number of custom properties being created and I hadn't been able to create a much smaller isolated repro that hits the issue so that I can build with the test projections from our repo. But I have been able to reduce the pages involved in your repo app while still hitting the issue and I am hoping I can use that to root cause it.

@JanRajnoha
Copy link
Author

@manodasanW thank you for your answer. It is weird feel, when you just see your bug report moving from milestone to milestone without any proper explaining, what is happening. I believe, it is hard to understand core of the bug and given repo by me is not simple app :) So thank you for your explaining, what happened.

@JanRajnoha
Copy link
Author

@manodasanW According to newer issue, you have problem with packages, but preview package of community toolkit is working fine with Reunion 0.8.0 preview, on my PCs of course, but i have many different stations, with different configurations, OS versions,... :/ Sometimes could app throw another exception related to resources, because app is using resources for localization, but I haven't posted it yet, cause I can't find something useful for you, but other exceptions shouldn't be there.

@manodasanW
Copy link
Member

@JanRajnoha no worries, I was already able to get unblocked with the steps I had given you in the other issue. Also to note there has been progress on this issue. The fix we have for #842 does seem to resolve the issue in your repro. But we are working through some test regressions from that fix and hope to have it checked in soon.

@JanRajnoha
Copy link
Author

@manodasanW this is great news, I hope it will work fine now and dev process could work on 100%. Also thank you for inform about current status.

@JanRajnoha
Copy link
Author

@Scottj1s Hi Scott, I saw community call and thank you for your information about this bug.

@angelazhangmsft
Copy link
Contributor

@JanRajnoha this bug is still being investigated - I believe the bugfix mentioned during the community call was #842.

@manodasanW
Copy link
Member

@JanRajnoha Thanks for your patience with this issue. With the help of the WinUI and .NET team, we have been able to root cause the crash and identify an issue in the .NET runtime related to when WinUI gets notified by the .NET runtime of RCWs being garbage collected.

PR here: dotnet/runtime#58412

@JanRajnoha
Copy link
Author

@manodasanW hi, you can't imagine, how i am happy i could work again :D thank you for your work and i hope, it will be okay. Can't wait for update. thank you and take care.

@manodasanW
Copy link
Member

Looks like the .NET 5 PR for servicing was merged. Based on the PR, it is scheduled to be in the .NET runtime 5.0.11 update.

@angelazhangmsft angelazhangmsft added the fixed Issue has been fixed in an upcoming or existing release label Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed Issue has been fixed in an upcoming or existing release
Projects
None yet
Development

No branches or pull requests

5 participants