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 #4926

Closed
JanRajnoha opened this issue Apr 28, 2021 · 10 comments
Closed
Labels

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

@andrewleader
Copy link

Transferring to the WinUI repo for them to take a first investigation. Thanks for reporting this Jan!

@andrewleader andrewleader transferred this issue from microsoft/WindowsAppSDK Apr 29, 2021
@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Apr 29, 2021
@JanRajnoha
Copy link
Author

@andrewleader thanks for response.

@StephenLPeters
Copy link
Contributor

@Scottj1s is this stack cswinrt code?

@StephenLPeters StephenLPeters added area-C#/WinRT product-winui3 WinUI 3 issues and removed needs-triage Issue needs to be triaged by the area owners labels Apr 30, 2021
@JanRajnoha
Copy link
Author

Hi @Scottj1s, could you confirm that stack trace is from WinRT?

@Marv51
Copy link
Contributor

Marv51 commented May 12, 2021

I'm also hitting this seemingly randomly, every once in a while, PropertyChanged throws exactly this NullReferenceException with the StackTrace above.

System.NullReferenceException: Object reference not set to an instance of an object.
   at ABI.Microsoft.UI.Xaml.Data.ICustomProperty.Vftbl.Do_Abi_GetValue_2(IntPtr thisPtr, IntPtr target, IntPtr* result)
--- End of stack trace from previous location ---
   at WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32 hr)
   at ABI.System.ComponentModel.PropertyChangedEventHandler.NativeDelegateWrapper.Invoke(Object sender, PropertyChangedEventArgs e)
   at MyApp.ZoneArea.set_Origin(Vector2 value)

Is there any additional information we can provide to aid in debugging this?

Not knowing when and how often this crash will occur in production makes me quite nervous to deploying our app.

@anawishnoff could you look into prioritizing this?

For me this occurs on Windows 10 20H2 (19042).

@JanRajnoha
Copy link
Author

@Marv51 bug is reported in CsWinRt and is planned for release 1.2.8 for June 15

@Marv51
Copy link
Contributor

Marv51 commented May 27, 2021

Is there any kind of workaround to work with WinUI 3 and PropertyChanged notifications more reliably? My app crashes from this after maximum 10 minutes of use, is that the experience that everyone is having?
@anawishnoff or @SavoySchuler?

@Marv51
Copy link
Contributor

Marv51 commented May 31, 2021

I can confirm that this still reproduces in 0.8.0-preview

@JanRajnoha
Copy link
Author

@Marv51 I think it is not related to WinUI (as bug location), so reunion 0.8 won't affect it.

@akilarajesh1313
Copy link

Closing this issue as it seems to have been resolved, see thread: microsoft/CsWinRT#840

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants