CommunityToolkit / WindowsCommunityToolkit

The Windows Community Toolkit is a collection of helpers, extensions, and custom controls. It simplifies and demonstrates common developer tasks building .NET apps with UWP and the Windows App SDK / WinUI 3 for Windows 10 and Windows 11. The toolkit is part of the .NET Foundation.
https://docs.microsoft.com/windows/communitytoolkit/
Other
5.84k stars 1.37k forks source link

InfiniteCanvas Crashing #4583

Open phandrieu opened 2 years ago

phandrieu commented 2 years ago

Describe the bug

InfiniteCanvas is crashing after a few lines drawn, and the Event Observer captures the following error :

Seems like #3178

Nom de l’application défaillante UniversalWhiteboard.exe, version : 1.0.0.0, horodatage : 0x61628bc9 Nom du module défaillant : ntdll.dll, version : 10.0.22000.708, horodatage : 0x71bf5f26 Code d’exception : 0xc0000374 Décalage d’erreur : 0x000ea619 ID du processus défaillant : 0xd94 Heure de début de l’application défaillante : 0x01d8879a906ab568 Chemin d’accès de l’application défaillante : C:\Users\Paul-Henri\source\repos\UniversalWhiteboard\UniversalWhiteboard\bin\x86\Debug\AppX\UniversalWhiteboard.exe Chemin d’accès du module défaillant: C:\Windows\SYSTEM32\ntdll.dll ID de rapport : 34ba5d41-9c5f-4a40-881e-82b4cec0cbc9 Nom complet du package défaillant : e9863d32-e11e-4dfb-ace0-047da93a5c5f_1.0.4.0_x86__0feck2cac0zqp ID de l’application relative au package défaillant : App

Regression

No response

Reproducible in sample app?

Steps to reproduce

1. With an InfiniteCanvas implemented in the app
2. Write a few lines on the board
3. The app will crash while you're writing

Expected behavior

Everything works fine for a while, and then after some kinda random amount of lines written on the canvas, the app crashes.

Screenshots

No response

Windows Build Number

Other Windows Build number

No response

App minimum and target SDK version

Other SDK version

No response

Visual Studio Version

2022

Visual Studio Build Number

VS 17.2.4

Device form factor

Desktop

Nuget packages

Microsoft.Toolkit.UWP 7.1.2 Microsoft.Toolkit.UWP.UI 7.1.2 Microsoft.Toolkit.UWP.UI.Controls 7.1.2 Microsoft.NETCore.UniversalWindowsPlatform 6.2.13

Additional context

No response

Help us help you

Yes, but only if others can assist.

ghost commented 2 years ago

Hello phandrieu, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌

michael-hawker commented 2 years ago

Thanks @phandrieu were you able to reproduce on your machine with our sample app or in a file new project? That'd at least help us narrow down where the issue may be coming from and reproduce it to try and get under a debugger.

phandrieu commented 2 years ago

Hi, Thanks for your awnser. I was not able to reproduce the issue in your sample app, nor in a file new project. Even though, my codebase is very small, and running it with a debugger doesn't give any further information as the debugger is not able to handle the error... Do you have any idea ? PS : I tried on another machine (a Surface Pro 2017 m3 4Gb running Windows 11 as well) and the same error occured, so at least my windows install isn't broken or something...

michael-hawker commented 2 years ago

Hmm, @phandrieu ntdll.dll is a system dll. Have you tried turning on mixed debugging (native and managed)? That usually tends to catch some of these native type exceptions and provide a better stack trace (as well as turning all exceptions on to catch the earliest exception).

Since we're an OSS project and source link should be enabled. You could try and browse through the source using F12 on the InfiniteCanvas and find the method related to text entry or whatever type of input you're providing for your repro steps (a video could help to visualize what you're seeing too).

Then you may be able to at least pinpoint what's being run in the toolkit code before you see the crash? That could be another way to help diagnose where the issue is in the component.

phandrieu commented 2 years ago

@michael-hawker I've tried to enable mixed debugging, but havent't had any further relevant information. Though, I found out that the following "Information" was reported in the event observer of windows right after the app crashed :

Détecteur d'erreurs 1942354950714111180, type 5
Nom d’événement : FaultTolerantHeap
Réponse : Non disponible
ID de CAB : 0

Signature du problème : 
P1 : UniversalWhiteboard.exe
P2 : 1.0.0.0
P3 : 62EA8AC5
P4 : ffffbaad
P5 : 
P6 : 
P7 : 
P8 : 
P9 : 
P10 : 

It really starts to seem like it's the same problem as #3178, but my nuget packages are updated... Kinda strange 👀👀 In any case thanks for your help :)

phandrieu commented 2 years ago

Update @michael-hawker I tried to create a new application, with only an InfiniteCanvas and I get the exact same problem :

Nom de l’application défaillante TestWB.exe, version : 1.0.0.0, horodatage : 0x61628bc9
Nom du module défaillant : ntdll.dll, version : 10.0.22000.778, horodatage : 0x09c67c09
Code d’exception : 0xc0000374
Décalage d’erreur : 0x000ea829
ID du processus défaillant : 0x2f9c
Heure de début de l’application défaillante : 0x01d8a74d08ca95cc
Chemin d’accès de l’application défaillante : C:\Users\Paul-Henri\source\repos\UniversalWhiteboard\TestWB\bin\x86\Debug\AppX\TestWB.exe
Chemin d’accès du module défaillant: C:\Windows\SYSTEM32\ntdll.dll
ID de rapport : 894d4127-a7ed-455e-be4b-9868755a87f5
Nom complet du package défaillant : 41e45cae-132b-4fac-9b91-f9ef99fef6f4_1.0.0.0_x86__4a9as015g09ne
ID de l’application relative au package défaillant : App
michael-hawker commented 2 years ago

@phandrieu thanks, can you share that minimal project with the bin/obj folders removed and attach here? Does it crash as soon as the app loads, do you interact with the canvas in a specific way?

phandrieu commented 2 years ago

TestWB.zip @michael-hawker Here it is, it crashes randomly while I'm writing on the canvas, it may take from 10 seconds to 10 minutes of writing, depending on an unknown factor... Hope it'll help 🤞 Thanks :)

michael-hawker commented 2 years ago

Thanks @phandrieu, @Arlodotexe you want to see if you can reproduce on your machine?

phandrieu commented 2 years ago

@michael-hawker Just in case I recorded a video of the small app crashing, but as I said in my previous posts, the number of lines needed to make the app crash is random from one time to the other... Also, I sent the AppX file to my gf and it also crashes on her Surface Pro, so it doesn't seems to be caused by my specific device.

Video link

minesworld commented 1 year ago

The Windows CommunityToolkit Sample App from the MicrosoftStore crashes too with the same heap corruption. Tested that as my projects crashed too and was unsure if this was due to my VS setup etc.

Just drawed something until it crashes. Attached is the content of Windows EventViewer Report.wer

Report.txt