Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] NullReferenceException in the Shell on UWP #12652

Closed
holecekp opened this issue Oct 29, 2020 · 4 comments · Fixed by #12713
Closed

[Bug] NullReferenceException in the Shell on UWP #12652

holecekp opened this issue Oct 29, 2020 · 4 comments · Fixed by #12713
Assignees
Labels
a/shell 🐚 blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. t/bug 🐛
Milestone

Comments

@holecekp
Copy link

Description

I am experiencing random crashes in my Xamarin.Forms application on UWP. This specific crash occurred when I clicked on a flyout item in the shell menu to navigate to another page.

System.NullReferenceException: Object reference not set to an instance of an object.
Stack trace (from AppCenter):
NRE_in_shell
NRE_in_shell2

OS: WINDOWS 10.0.18363
Crashed after: 18m 51s

Steps to Reproduce

  1. This issue occurs randomly so there are no steps to reproduce it. I have selected the same flyout item multiple times before and it did not crash.

Expected Behavior

The application is stable and does not crash.

Actual Behavior

The debug version is stable but the release version downloaded from Microsoft Store crashes on some occasions.

Basic Information

  • Version with issue: 4.8.0.1560
  • Last known good version: ?
  • IDE: VS 2019
  • Platform Target Frameworks: 10.0.18362.0 (TargetPlatformVersion from csproj file)
    • UWP:
  • Nuget Packages:
    Microsoft.AppCenter.Crashes (3.4.3)
    Microsoft.NETCore.UniversalWindowsPlatform (6.2.10)
    Xamarin.Essentials (1.5.3.2)
    Xamarin.Forms (4.8.0.1560)

Reproduction Link

This issue occurs randomly so it is not possible to create a project for reproducing it.

Workaround

No workaround

@holecekp holecekp added s/unverified New report that has yet to be verified t/bug 🐛 labels Oct 29, 2020
@samhouts samhouts added this to New in Triage Oct 29, 2020
@PureWeen
Copy link
Contributor

@holecekp can you test on 5.0.0 pre3 and let me know if you see the same exception?

@PureWeen PureWeen added s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. labels Oct 29, 2020
@PureWeen PureWeen moved this from New to Needs Info in Triage Oct 29, 2020
@holecekp
Copy link
Author

@PureWeen Yes, after about 30 minutes of trying, I was able to reproduce this crash also in 5.0.0 pre 3.

@PureWeen
Copy link
Contributor

@holecekp do you have a repro I can play with?

@holecekp
Copy link
Author

holecekp commented Oct 31, 2020

@PureWeen I have created a repro and I was able to reproduce the NRE for 4 times in it.
UwpShellTestProject.zip

Steps:
This bug is very hard to reproduce. It requires a lot of patience. I took me 3 - 20 minutes of random clicking to crash the application. There are some steps that I did randomly.

  • Selecting different flyout items in the shell menu.
  • There are two tabs in one of the flyout items (Morse Codes and Q-Codes List). I have also browsed between them.
  • There is a button on the About that is used for navigating to another page that is not accessible directly from the shell menu. I have used the button and returned back to the About page.
  • I was changing windows size. By the way, this demonstrates another Xamarin.Forms bug on UWP. When you select another page from shell menu, resize the window, and return to the previous page, the layout is broken (it corresponds to the previous window size).
  • On the settings page, there are various controls. I have scrolled on the page, clicked on the controls and clicked on the space between them (this again shows another bug, the ScrollView position is reseted on UWP in these cases).
  • I was switching between light and dark theme in Windows settings.
  • I was clicking randomly on various controls on the pages.

After some time, when I click on a flyout item in the shell menu, the application crashed. It was different flyout item every time. It seems that there is a great deal of randomness.

I am including screen shots. This time I got only message without a stack trace. I have subscribed App.UnhandledException event in the UWP project but it did not helped (still no stack trace). I have enabled debugging also in native code and tried to load required symbols but I only got message that required symbols could not be loaded (again, screenshot is included).

I have used another computer so I can rule out the case that this would be a problem only of a single specific computer (corrupted system libraries, configuration, etc.).

I have included also Android version for comparison, but you can ignore it as only UWP version crashes.

Screenshots:
XF UWP shell NRE
XF UWP shell NRE debug native code

@PureWeen PureWeen self-assigned this Nov 2, 2020
@PureWeen PureWeen added a/shell 🐚 and removed s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. labels Nov 2, 2020
@PureWeen PureWeen moved this from Needs Info to Ready For Work in Triage Nov 2, 2020
@PureWeen PureWeen removed the s/unverified New report that has yet to be verified label Nov 2, 2020
@PureWeen PureWeen added this to the 5.0.0 milestone Nov 2, 2020
@PureWeen PureWeen added this to To do in vNext+1 (5.0.0) via automation Nov 2, 2020
@samhouts samhouts removed this from the 5.0.0 milestone Nov 2, 2020
@PureWeen PureWeen moved this from To do to In Progress in vNext+1 (5.0.0) Nov 2, 2020
@PureWeen PureWeen added this to the 5.0.0 milestone Nov 2, 2020
@PureWeen PureWeen added the blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. label Nov 2, 2020
@Redth Redth moved this from Ready For Work to Needs Estimate in Triage Nov 6, 2020
Triage automation moved this from Needs Estimate to Closed Nov 10, 2020
vNext+1 (5.0.0) automation moved this from In Progress to Done Nov 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/shell 🐚 blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. t/bug 🐛
Projects
Triage
  
Closed
Development

Successfully merging a pull request may close this issue.

3 participants