dotnet / wpf

WPF is a .NET Core UI framework for building Windows desktop applications.
MIT License
7.08k stars 1.17k forks source link

Multiple inputs in quick succession cause an FatalExecutionEngineError exception with Korean IME #9805

Open vsfeedback opened 1 month ago

vsfeedback commented 1 month ago

This issue has been moved from a ticket on Developer Community.


[severity:It's more difficult to complete my work] When I quickly enter Korean characters in WPF Program(DataGrid, etc...), the program suddenly quits This phenomenon mainly occurs in Windows 11. The test environment is Windows 11, 23H2.

IDE : Visual Studio 2022 Framework : .Net Framework 4.81 Platform : WPF

To aid understanding, source code, video, and call stack are attached.


Original Comments

Feedback Bot on 9/5/2024, 10:57 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

miloush commented 1 month ago

Can the repro project and steps be attached here?

Sotatek-TuanDo commented 1 month ago

I encountered a similar issue when inputting Japanese. still no solution to resolve.

indigoray commented 1 month ago

I have the same problem. The exception FatalExecutionEngineError always occurs when typing in Korean very quickly and pressing Enter in succession in the GridView.

indigoray commented 1 month ago

https://github.com/user-attachments/assets/2ae41bf6-db28-4adf-bf2c-552a37ee50e9

indigoray commented 1 month ago

this is the call stack of the exception.

[External Code] 

TextInputFramework.dll!CACPWrap::RequestLock(unsigned long,long ) Unknown TextInputFramework.dll!SafeRequestLock(struct ITextStoreAnchor ,unsigned long,long ) Unknown TextInputFramework.dll!CInputContext::_OnSelectionChangeInternal(int) Unknown TextInputFramework.dll!CInputContext::OnSelectionChange(void) Unknown TextInputFramework.dll!CACPWrap::OnSelectionChange(void) Unknown [External Code] TextInputFramework.dll!CDocumentInputManager::OnTransitoryExtensionUpdated(struct ITfContext ,unsigned long,struct ITfRange ,struct ITfRange ,int ) Unknown msctf.dll!CTransitoryExtension::CallUpdatedSink(unsigned long) Unknown msctf.dll!CTransitoryExtension::OnEndEdit(struct ITfContext ,unsigned long,struct ITfEditRecord ) Unknown TextInputFramework.dll!CInputContext::_NotifyEndEdit(void) Unknown TextInputFramework.dll!CInputContext::_PseudoSyncEditSessionQiCallback(class CInputContext ,struct _TS_QUEUE_ITEM ,enum QiCallbackCode) Unknown TextInputFramework.dll!CInputContext::_DispatchQueueItem(struct _TS_QUEUE_ITEM ) Unknown TextInputFramework.dll!CInputContext::_EmptyLockQueue(unsigned long,int) Unknown TextInputFramework.dll!CInputContext::OnLockGranted(unsigned long) Unknown TextInputFramework.dll!CACPWrap::OnLockGranted(unsigned long) Unknown msctf.dll!CTextStoreImpl::RequestLock() Unknown TextInputFramework.dll!CACPWrap::RequestLock(unsigned long,long ) Unknown TextInputFramework.dll!SafeRequestLock(struct ITextStoreAnchor ,unsigned long,long ) Unknown TextInputFramework.dll!CInputContext::_QueueItem(struct _TS_QUEUE_ITEM ,int,long ) Unknown TextInputFramework.dll!CInputContext::TerminateComposition(struct ITfCompositionView ) Unknown TextInputFramework.dll!CInputContext::FinalizeComposition(unsigned long) Unknown msctf.dll!CThreadInputMgr::_SetFocus(struct IDocumentInputManagerPrivate ,int) Unknown msctf.dll!CThreadInputMgr::SetFocus(struct ITfDocumentMgr ) Unknown [External Code] user32.dll!InternalCallWinProc@20() Unknown user32.dll!UserCallWinProcCheckWow(struct _ACTIVATION_CONTEXT ,void ,struct HWND ,enum _WM_VALUE,unsigned int,long,void ,int) Unknown user32.dll!_DispatchMessageWorker@8() Unknown user32.dll!_DispatchMessageW@4() Unknown WindowsBase.ni.dll!6b5f5e21() Unknown [External Code] [Frames below may be incorrect and/or missing, native debugger attempting to walk managed call stack]

indigoray commented 1 month ago

The last reason the exception occurs...

private void VerifyTextStoreConsistency() { if (_netCharCount != TextContainer.IMECharCount) { Invariant.Assert(condition: false, "TextContainer/TextStore have inconsistent char counts!"); } }

indigoray commented 1 month ago

Similar Issue

https://github.com/dotnet/wpf/pull/4985

lindexi commented 1 month ago

this is the call stack of the exception.

[External Code]   

TextInputFramework.dll!CACPWrap::RequestLock(unsigned long,long ) Unknown TextInputFramework.dll!SafeRequestLock(struct ITextStoreAnchor ,unsigned long,long ) Unknown TextInputFramework.dll!CInputContext::_OnSelectionChangeInternal(int) Unknown TextInputFramework.dll!CInputContext::OnSelectionChange(void) Unknown TextInputFramework.dll!CACPWrap::OnSelectionChange(void) Unknown [External Code] TextInputFramework.dll!CDocumentInputManager::OnTransitoryExtensionUpdated(struct ITfContext ,unsigned long,struct ITfRange ,struct ITfRange ,int ) Unknown msctf.dll!CTransitoryExtension::CallUpdatedSink(unsigned long) Unknown msctf.dll!CTransitoryExtension::OnEndEdit(struct ITfContext ,unsigned long,struct ITfEditRecord ) Unknown TextInputFramework.dll!CInputContext::_NotifyEndEdit(void) Unknown TextInputFramework.dll!CInputContext::_PseudoSyncEditSessionQiCallback(class CInputContext ,struct _TS_QUEUE_ITEM ,enum QiCallbackCode) Unknown TextInputFramework.dll!CInputContext::_DispatchQueueItem(struct _TS_QUEUE_ITEM ) Unknown TextInputFramework.dll!CInputContext::_EmptyLockQueue(unsigned long,int) Unknown TextInputFramework.dll!CInputContext::OnLockGranted(unsigned long) Unknown TextInputFramework.dll!CACPWrap::OnLockGranted(unsigned long) Unknown msctf.dll!CTextStoreImpl::RequestLock() Unknown TextInputFramework.dll!CACPWrap::RequestLock(unsigned long,long ) Unknown TextInputFramework.dll!SafeRequestLock(struct ITextStoreAnchor ,unsigned long,long ) Unknown TextInputFramework.dll!CInputContext::_QueueItem(struct _TS_QUEUE_ITEM ,int,long ) Unknown TextInputFramework.dll!CInputContext::TerminateComposition(struct ITfCompositionView ) Unknown TextInputFramework.dll!CInputContext::FinalizeComposition(unsigned long) Unknown msctf.dll!CThreadInputMgr::_SetFocus(struct IDocumentInputManagerPrivate ,int) Unknown msctf.dll!CThreadInputMgr::SetFocus(struct ITfDocumentMgr ) Unknown [External Code] user32.dll!InternalCallWinProc@20() Unknown user32.dll!UserCallWinProcCheckWow(struct _ACTIVATION_CONTEXT ,void ,struct HWND ,enum _WM_VALUE,unsigned int,long,void ,int) Unknown user32.dll!_DispatchMessageWorker@8() Unknown user32.dll!_DispatchMessageW@4() Unknown WindowsBase.ni.dll!6b5f5e21() Unknown [External Code] [Frames below may be incorrect and/or missing, native debugger attempting to walk managed call stack]

This call stack can be find in stackoverflow: https://stackoverflow.com/questions/30252722/wpf-application-hang-on-main-thread-without-obvious-locks

lindexi commented 1 month ago

The last reason the exception occurs...

private void VerifyTextStoreConsistency() { if (_netCharCount != TextContainer.IMECharCount) { Invariant.Assert(condition: false, "TextContainer/TextStore have inconsistent char counts!"); } }

Reference: https://github.com/dotnet/wpf/issues/3315 and https://github.com/dotnet/wpf/issues/4984