dotnet / dotnet/wpf

Throw IndexOutOfRangeException in WispLogic.CoalesceAndQueueStylusEvent

Open
#935 8 comments 3 reactions 0 assignees View on GitHub
area-Touch Bug
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

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.

See: https://stackoverflow.com/questions/46049673/wpf-touch-application-partially-freezes-on-net-framework-4-7

And [Bruno V](https://stackoverflow.com/users/3357566/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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.