wpf icon indicating copy to clipboard operation
wpf copied to clipboard

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

Open vsfeedback opened this issue 1 year ago • 9 comments

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.

vsfeedback avatar Sep 18 '24 09:09 vsfeedback

Can the repro project and steps be attached here?

miloush avatar Sep 18 '24 11:09 miloush

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

Sotatek-TuanDo avatar Sep 19 '24 06:09 Sotatek-TuanDo

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 avatar Sep 24 '24 03:09 indigoray

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

indigoray avatar Sep 24 '24 03:09 indigoray

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 avatar Sep 25 '24 02:09 indigoray

The last reason the exception occurs...

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

indigoray avatar Sep 25 '24 03:09 indigoray

Similar Issue

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

indigoray avatar Sep 25 '24 04:09 indigoray

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 avatar Sep 26 '24 00:09 lindexi

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

lindexi avatar Sep 26 '24 00:09 lindexi