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.85k stars 1.37k forks source link

Eyedropper crash the app #4028

Open mixturify opened 3 years ago

mixturify commented 3 years ago

Describe the bug

Eyedropper make the app crash.

Steps to Reproduce

It's not possible to reproduce the crash at least on my devices and environments but at lot of users encountered it.

Crash log:

System.Exception: Exception from HRESULT: 0x802B0020

ComCallHelpers.Call (__ComObject, RuntimeTypeHandle, Int32, Color, Void*)
__Interop.ForwardComStubs.Stub_65[TThis, TResult](__ComObject, Color, Int32) + 0x45
Microsoft.Toolkit.Uwp.UI.Controls Eyedropper.UpdatePreview (Int32, Int32)
Microsoft.Toolkit.Uwp.UI.Controls Eyedropper.UpdateEyedropper (Point)
Microsoft.Toolkit.Uwp.UI.Controls Eyedropper.TargetGrid_PointerMoved (Object, PointerRoutedEventArgs)
System.Xml.XmlTextReaderImpl OnDefaultAttributeUseDelegate.Invoke (IDtdDefaultAttributeInfo, XmlTextReaderImpl)
__Interop Intrinsics.HasThisCall__24[TArg0] (Object, IntPtr, Object, TArg0)

Environment


NuGet Package(s): 
6.1.1

Windows 10 Build Number:
- May 2020 Update (19041)

App min and target version:
- May 2019 Update (18362)

Device form factor:
- Desktop

Visual Studio 
- 2019 (latest)
ghost commented 3 years ago

Hello mixturify, 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 🙌

Kyaa-dost commented 3 years ago

@mixturify Can you please provide more details on this? The steps you took? What app this was used in? etc..

mixturify commented 3 years ago

@Kyaa-dost Hi, the color picker is used on Inkodo app and error was reported into my App Center. This had my attention because every month there are at least 1K reports in the dashboard.

Maybe the issue not really made the app crash, it's just displayed under the crash tab on the dashboard but for sure, I struggling know what trigger this.

Anyway, I just use the ColorChanged event and inside there is an try catch just in case but nothing fancy.

Kyaa-dost commented 3 years ago

@mixturify Thanks for providing a background.

@robloo have you ever seen this error mentioned in the repro above? ⬆️

robloo commented 3 years ago

@Kyaa-dost I´m not sure this is related to the ColorPicker at all. The issue description and crashes appear to be related to the Eyedropper control. The comments "the color picker is used on..." are probably just referring to the usage of the Eyedropper to pick a color from on screen.

mixturify commented 3 years ago

@Kyaa-dost I´m not sure this is related to the ColorPicker at all. The issue description and crashes appear to be related to the Eyedropper control. The comments "the color picker is used on..." are probably just referring to the usage of the Eyedropper to pick a color from on screen.

Yes, my bad, the crash it's indeed the from the component EyeDropper which is added at the bottom of the ColorPicker used for picking and applying the color.

Kyaa-dost commented 3 years ago

@robloo That makes sense and thanks for the clarification.

@HHChaos any insight on this error ⬆️

michael-hawker commented 3 years ago

This is the function that seems to be in the call stack, it's pretty long, so not sure if it's easy to determine where the issue might be stemming from:

https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/2b124ff5e7ebc2061f64a3dff7953f1c1f548807/Microsoft.Toolkit.Uwp.UI.Controls.Media/Eyedropper/Eyedropper.Logic.cs#L71-L108

Outside of updating some dependencies, I don't think this control has changed much between 6.1.1 and 7.0.0. It'd be helpful to get a bit more info if someone can find reproduction steps.