microsoft / microsoft/microsoft-ui-xaml
[Bug] [Crash] [InputStatemanager.dll] WinUI3 Apps have a chance to throw a uncatchable fail-fast exception every time they are touched
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### Describe the bug
Note: Please see pecrow's first comment on this thread for a good writeup of a possible solution that can help speed along work!
Applications made using WinUI3 have a chance to crash due to an uncatchable fail-fast exception thrown from Microsoft.InputStateManager.dll (source obtained from Windows Event Viewer) whenever the screen is tapped (not clicked). This can be observed on a completely blank brand new WinUI3 application. It does not matter *what* was tapped on the screen, the fact that a input was registered at all appears to be the trigger.
The frequency of crashing appears to depend on the computer. Faster computers see this issue occur far left often than slower ones. Microsoft Surface Pro tablets appear to have this issue happen disproportionately more than desktops or other Windows tablets. This bug is observable on more than one Windows build version, and is observable on both Windows 10 and Windows 11.
This issue is confirmed on WinUI3 applications using Windows SDK 1.6.2, 1.7.x and 1.8.x
However, using Windows SDK 1.6.2 reduces the frequency. 1.7.x and 1.8.x both appear to be similar.
### Why is this important?
My users need to be able to use my application without frequent crashes throughout the day, and should not be required to buy high-end tablet computers to run a relatively simple application.
This issue has been occurring for a long period of time and is disruptive to the operations of my users and is embarrassing for us as we do not have a solution available for this issue as it is outside of our control.
If this is never resolved we are going to have to entirely remake our product using something that works properly, which is going to be an enormous resource sink.
### Steps to reproduce the bug
Create a WinUI3 application from Visual Studio
Launch it
TAP (do not click -- tap) with at least 4 fingers (6 preferred) as quickly as you can.
For the sake of your wrists, use the worst quality hardware you can while testing this. My work machine can take me up to a few minutes to crash, whereas older model Microsoft Surface Pro tablets can experience this crash within seconds and do not need multiple fingers.
### Actual behavior
Eventually the application will crash.
### Expected behavior
The application does not crash
### Screenshots
Here is a screenshot of the event viewer entry for a blank WinUI app
And here is a video of receiving this crash from a blank dotnet maui application using WinUI
https://github.com/user-attachments/assets/fd0093e8-f3de-44e9-83c0-a89ba5e20888
### NuGet package version
None
### Windows version
_No response_
### Additional context
Here is some info we have been able to discern from dmp files etc. from these crashes. Hopefully this will be helpful
ExceptionCode: 0xC0000409 (Security check failure or stack buffer overrun)
ExceptionAddress: Microsoft_InputStateManager!InProcInputHandler::PopulateContactInFrame+0x5a4
Subcode: 0x7 FAST_FAIL_FATAL_APP_EXIT
WinDbg Analysis of .dmp:
!gle
LastErrorValue: 0x12a (298) - Too many posts were made to a semaphore.
!error 0x80070578 → Invalid window handle
Contributor guide
Research direction
Start by reproducing the crash in a blank WinUI3 application with rapid multi-touch, then inspect the Event Viewer entry and dump details around Microsoft_InputStateManager!InProcInputHandler::PopulateContactInFrame using WinDbg. Determine whether the failure is actionable in this repository or belongs to the Windows platform; done means the stated touch test no longer crashes or the issue has a confirmed platform-level disposition.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100