Repository navigation
Open
Labels
Milestone
Description
- .NET Core Version: 3.0.100-preview5-011568
- Windows version: 1903 18362.145
- Does the bug reproduce also in WPF for .NET Framework 4.8?: Find in 4.7
Problem description:
The application crash.
We find many customs will break the application when he touch the application. I catch the AppDomain.CurrentDomain.UnhandledException and find the WispLogic.CoalesceAndQueueStylusEvent may be break the application.
And Bruno V tell me that it fix in .NET 4.7.1, but it seems not fix in dotnet core.
I can not debug it, because 200 users found the crash among 300,000 users.
- .NET 4.7: 200 users found the crash among 300,000 users.
- .NET Core 3.0: 2 users found the crash among 600 users.
Actual behavior:
exceptions
ExceptionType: System.IndexOutOfRangeException
callstack for crashes
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Windows.Input.StylusWisp.WispLogic.CoalesceAndQueueStylusEvent(RawStylusInputReport inputReport)
at System.Windows.Input.StylusWisp.WispLogic.ProcessInputReport(RawStylusInputReport inputReport)
at System.Windows.Input.PenContext.FirePackets(Int32 stylusPointerId, Int32[] data, Int32 timestamp)
at System.Windows.Input.PenThreadWorker.FlushCache(Boolean goingOutOfRange)
at System.Windows.Input.PenThreadWorker.FireEvent(PenContext penContext, Int32 evt, Int32 stylusPointerId, Int32 cPackets, Int32 cbPacket, IntPtr pPackets)
at System.Windows.Input.PenThreadWorker.ThreadProc()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Expected behavior:
The application can run.
Minimal repro:
An empty WPF application and run in touch device.
Reacted by Dino Chan, walterlv and Shaojun Li
Activity
lindexi commentedon Jun 13, 2019
My friend @kkwpsv find the code in .NET 4.7 for Windows 10 Creators Update have not add lock in WispLogic.CoalesceAndQueueStylusEvent. So it seems that it only can find in .NET 4.7 for Windows 10 Creators Update and it fix in dotnet core.
lindexi commentedon Jun 13, 2019
Why it break in .NET Framework 4.7 for Windows10 Creators Update?
My friend @kkwpsv download the source code from https://referencesource.microsoft.com and find the .NET 4.7 for Windows 10 Creators Update have not add lock to
WispLogic.CoalesceAndQueueStylusEventand the other add the lock.So it only break in .NET Framework 4.7 for Windows10 Creators Update. And .NET Framework 4.7 RTM add the lock to
WispLogic.CoalesceAndQueueStylusEventand fix it.Which version add lock?
Which version remove lock?
The funny thing is .NET 4.7 RTM add the lock to
WispLogic.CoalesceAndQueueStylusEventand the .NET 4.7.1 Downlevel remove it.The .NET 4.7.2 for Windows 10 April 2018 Creators Update is the frist version to add lock and it seems fix in .NET 4.7.2 not fix in .NET 4.7.1
See https://stackoverflow.com/a/56575786/6116637
c# - WPF applications stop responding to touches after adding or removing tablet devices - Stack Overflow
weltkante commentedon Jun 13, 2019
Last time I checked not all downloads at referencesource were correctly labeled. Be careful how you associate them with the actual .NET version, they may actually be another version than the zip file name says.
lindexi commentedon Jun 13, 2019
@weltkante Could you tell me which it is incorrectly? I want to fix it.
weltkante commentedon Jun 13, 2019
@lindexi If you downloaded within the last month then
DotNet472RS4.zipis actually the same as 4.7 RTM and does not contain 4.7.2 source code. I think that was the only mistake left after I've sent them feedback. If you downloaded before last month then there were more files mixed up, I don't have a complete list, but at leastdotnet462RTM.zip,DotNet47RS2.zipandDotNet47RTM.zipdownloads were all wrong at some point in the past, but have been corrected since. (Also I do not know what the 'ZDP' release is, so I cannot tell if its wrong or not.)kkwpsv commentedon Jun 13, 2019
I download them from "https://referencesource.microsoft.com/" today. I follow the version that it says.
weltkante commentedon Jun 13, 2019
Just checked,
DotNet472RS4.zipstill contains 4.7 RTM and not 4.7.2lindexi commentedon Feb 7, 2022
The
WispLogic.CoalesceAndQueueStylusEventcode in .NET 4.7 for Windows 10 Creators Update, DotNet47RS2.zip:The code in dotnet 6.0.1:
wpf/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/Stylus/Wisp/WispLogic.cs
Lines 162 to 264 in 0350d04