Terminal often crashes when typing in a text box using Google Japanese IME
Windows Terminal version
1.22.11141.0
Windows build number
10.0.26100.4061
Other Software
Google Japanese IME v2.30.5620.0
Steps to reproduce
- Navigate to a text box in the Settings page.
- Clear its contents.
- Type random characters, Terminal will crash shortly after.
Expected Behavior
Not crash
Actual Behavior
Crash
Does it also crash in Windows Terminal Preview? Store link: https://aka.ms/terminal-preview
Just gave Windows Terminal Preview a try, and yes, I can reproduce the crash with Windows Terminal Preview as well.
FYI, I could reproduce this (or at least something similar) using just the default Microsoft Japanese IME. I was running a local build of Windows Terminal within the Visual Studio debugger, so I was able to capture the following exception details:
Unhandled exception at 0x00007FFA3EA441C2 (KernelBase.dll) in WindowsTerminal.exe: 0xC000027B: An application-internal exception has occurred (parameters: 0x000001F4EAB077F0, 0x0000000000000001).
Stack trace
KernelBase.dll!RaiseFailFastException()
combase.dll!RoFailFastWithErrorContextInternal2(HRESULT hrError, unsigned long cStowedExceptions, _STOWED_EXCEPTION_INFORMATION_V2 * * aStowedExceptionPointers) Line 1455
at onecore\com\combase\winrt\error\error.cpp(1455)
Windows.UI.Xaml.dll!CCoreServices::NWDrawTree(HWWalk * pHWWalk, CWindowRenderTarget * pRenderTarget, VisualTree * pVisualTree, unsigned int forceRedraw, XRECT_WH * prcDirtyRect) Line 6566
at onecoreuap\windows\dxaml\xcp\core\dll\xcpcore.cpp(6566)
Windows.UI.Xaml.dll!CCoreServices::NWDrawMainTree(CWindowRenderTarget * pIRenderTarget, bool fForceRedraw, XRECT_WH * prcDirtyRect) Line 6084
at onecoreuap\windows\dxaml\xcp\core\dll\xcpcore.cpp(6084)
Windows.UI.Xaml.dll!CWindowRenderTarget::Draw(CCoreServices * fForceRedraw, unsigned int prcDirtyRect, XRECT_WH *) Line 136
at onecoreuap\windows\dxaml\xcp\core\compositor\windowrendertarget.cpp(136)
Windows.UI.Xaml.dll!CXcpBrowserHost::OnTick() Line 545
at onecoreuap\windows\dxaml\xcp\host\win\browserdesktop\winbrowserhost.cpp(545)
Windows.UI.Xaml.dll!CXcpDispatcher::Tick() Line 1449
at onecoreuap\windows\dxaml\xcp\win\shared\xcpwindow.cpp(1449)
Windows.UI.Xaml.dll!CXcpDispatcher::OnReentrancyProtectedWindowMessage(HWND__ * msg, unsigned int lParam, unsigned __int64) Line 1041
at onecoreuap\windows\dxaml\xcp\win\shared\xcpwindow.cpp(1041)
[Inline Frame] Windows.UI.Xaml.dll!CXcpDispatcher::ProcessMessage(HWND__ *) Line 890
at onecoreuap\windows\dxaml\xcp\win\shared\xcpwindow.cpp(890)
Windows.UI.Xaml.dll!CXcpDispatcher::WindowProc(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 839
at onecoreuap\windows\dxaml\xcp\win\shared\xcpwindow.cpp(839)
Windows.UI.Xaml.dll!CDeferredInvoke::DispatchQueuedMessage(bool * dispatchedWork, bool * hasMoreWork) Line 301
at onecoreuap\windows\dxaml\xcp\win\shared\xcpwindow.cpp(301)
[Inline Frame] Windows.UI.Xaml.dll!CXcpDispatcher::MessageTimerCallback() Line 1534
at onecoreuap\windows\dxaml\xcp\win\shared\xcpwindow.cpp(1534)
Windows.UI.Xaml.dll!CXcpDispatcher::MessageTimerCallbackStatic(void * myUserData) Line 1526
at onecoreuap\windows\dxaml\xcp\win\shared\xcpwindow.cpp(1526)
CoreMessaging.dll!Microsoft__CoreUI__Dispatch__TimeoutHandler$CallbackThunk(class System::Delegate *)
CoreMessaging.dll!Microsoft::CoreUI::Dispatch::TimeoutManager::Callback_OnDispatch()
CoreMessaging.dll!Microsoft::CoreUI::Dispatch::EventLoop::Callback_RunCoreLoop(struct Microsoft::CoreUI::Dispatch::RunMode,bool,bool &)
CoreMessaging.dll!Microsoft::CoreUI::Dispatch::UserAdapter::OnUserDispatch()
CoreMessaging.dll!Microsoft::CoreUI::Dispatch::UserAdapter_DoWork()
CoreMessaging.dll!Microsoft::CoreUI::Dispatch::UserAdapter_WindowProc(struct HWND__ *,unsigned int,unsigned __int64,__int64)
user32.dll!UserCallWinProcCheckWow(struct _ACTIVATION_CONTEXT *,__int64 (*)(struct tagWND *,unsigned int,unsigned __int64,__int64),struct HWND__ *,enum _WM_VALUE,unsigned __int64,__int64,void *,int)
user32.dll!DispatchClientMessage()
user32.dll!__fnDWORD()
ntdll.dll!KiUserCallbackDispatcherContinue()
win32u.dll!NtUserPeekMessage()
user32.dll!_PeekMessage()
user32.dll!PeekMessageW()
combase.dll!CCliModalLoop::MyPeekMessage(tagMSG * pMsg, HWND__ * hwnd, unsigned int min, unsigned int max, unsigned short wFlag) Line 2925
at onecore\com\combase\dcomrem\callctrl.cxx(2925)
combase.dll!CCliModalLoop::PeekRPCAndDDEMessage() Line 2607
at onecore\com\combase\dcomrem\callctrl.cxx(2607)
combase.dll!CCliModalLoop::BlockFn(void * * ahEvent, unsigned long cEvents, unsigned long * lpdwSignaled) Line 2103
at onecore\com\combase\dcomrem\callctrl.cxx(2103)
combase.dll!ModalLoop(CSyncClientCall * pClientCall) Line 166
at onecore\com\combase\dcomrem\chancont.cxx(166)
combase.dll!ClassicSTAThreadDispatchCrossApartmentCall(tagRPCOLEMESSAGE * pMessage, OXIDEntry * pOXIDEntry, CSyncClientCall * pClientCall) Line 319
at onecore\com\combase\dcomrem\chancont.cxx(319)
[Inline Frame] combase.dll!CSyncClientCall::SwitchAptAndDispatchCall(tagRPCOLEMESSAGE * pMessage) Line 5856
at onecore\com\combase\dcomrem\channelb.cxx(5856)
combase.dll!CSyncClientCall::SendReceive2(tagRPCOLEMESSAGE * pMessage, unsigned long * pstatus) Line 5459
at onecore\com\combase\dcomrem\channelb.cxx(5459)
[Inline Frame] combase.dll!SyncClientCallRetryContext::SendReceiveWithRetry(tagRPCOLEMESSAGE *) Line 1542
at onecore\com\combase\dcomrem\callctrl.cxx(1542)
[Inline Frame] combase.dll!CSyncClientCall::SendReceiveInRetryContext(SyncClientCallRetryContext *) Line 565
at onecore\com\combase\dcomrem\callctrl.cxx(565)
combase.dll!ClassicSTAThreadSendReceive(CSyncClientCall * pClientCall, tagRPCOLEMESSAGE * pMsg, unsigned long * pulStatus) Line 547
at onecore\com\combase\dcomrem\callctrl.cxx(547)
combase.dll!CSyncClientCall::SendReceive(tagRPCOLEMESSAGE * pMessage, unsigned long * pulStatus) Line 783
at onecore\com\combase\dcomrem\ctxchnl.cxx(783)
combase.dll!CClientChannel::SendReceive(tagRPCOLEMESSAGE * pMessage, unsigned long * pulStatus) Line 655
at onecore\com\combase\dcomrem\ctxchnl.cxx(655)
combase.dll!NdrExtpProxySendReceive(void * pThis, _MIDL_STUB_MESSAGE * pStubMsg) Line 2002
at onecore\com\combase\ndr\ndrole\proxy.cxx(2002)
rpcrt4.dll!NdrpClientCall3()
combase.dll!ObjectStublessClient(void * ParamAddress, __int64 * FloatRegisters, long Method) Line 369
at onecore\com\combase\ndr\ndrole\amd64\stblsclt.cxx(369)
combase.dll!ObjectStubless() Line 176
at onecore\com\combase\ndr\ndrole\amd64\stubless.asm(176)
msftedit.dll!CSpellerGlobalState::ForegroundSpellCheck(struct ISpellChecker *,unsigned short *,bool)
msftedit.dll!CSpellerGlobalState::SpellCheck(struct ISpellChecker *,unsigned short *,bool,bool,unsigned long,bool)
msftedit.dll!CSpellCheckerEngine::CheckRangeWithCtx(struct ISpellEnginePosition *,struct ISpellEnginePosition *,struct ISpellEnginePosition *,bool)
msftedit.dll!CSpellCheckerEngine::SpellCheckAndAutocorrect(bool *,unsigned long,bool)
msftedit.dll!CSpellChecker::Spellcheck(void)
msftedit.dll!CSpellChecker::ScanAndUpdate(void)
msftedit.dll!CGenUndoBuilder::Done()
msftedit.dll!CTxtRange::SetText2()
msftedit.dll!CTSF30Base::OnTextUpdatingWorker()
msftedit.dll!Microsoft::WRL::Details::DelegateArgTraits<long (__cdecl Windows::Foundation::ITypedEventHandler_impl<Windows::Foundation::Internal::AggregateType<Windows::UI::Text::Core::CoreTextEditContext *,Windows::UI::Text::Core::ICoreTextEditContext *>,Windows::Foundation::Internal::AggregateType<Windows::UI::Text::Core::CoreTextLayoutRequestedEventArgs *,Windows::UI::Text::Core::ICoreTextLayoutRequestedEventArgs *>>::*)(Windows::UI::Text::Core::ICoreTextEditContext *,Windows::UI::Text::Core::ICoreTextLayoutRequestedEventArgs *)>::DelegateInvokeHelper<Windows::Foundation::ITypedEventHandler<Windows::UI::Text::Core::CoreTextEditContext *,Windows::UI::Text::Core::CoreTextLayoutRequestedEventArgs *>,<lambda_691eb888678f8a68973448494aef6be6>,-1,Windows::UI::Text::Core::ICoreTextEditContext *,Windows::UI::Text::Core::ICoreTextLayoutRequestedEventArgs *>::Invoke()
Windows.UI.Core.TextInput.dll!Microsoft::WRL::InvokeTraits<-2>::InvokeDelegates<class <lambda_08d20749b81716ef718bb13b141c8993>,struct Windows::Foundation::ITypedEventHandler<class Windows::UI::ViewManagement::Core::CoreInputView *,class Windows::UI::Internal::ViewManagement::Core::FrameworkInputViewOcclusionsChangedEventArgs *> >(class <lambda_08d20749b81716ef718bb13b141c8993>,class Microsoft::WRL::Details::EventTargetArray *,class Microsoft::WRL::EventSource<struct Windows::Foundation::ITypedEventHandler<class Windows::UI::ViewManagement::Core::CoreInputView *,class Windows::UI::Internal::ViewManagement::Core::FrameworkInputViewOcclusionsChangedEventArgs *>,struct Microsoft::WRL::InvokeModeOptions<-2> > *)
Windows.UI.Core.TextInput.dll!Microsoft::WRL::EventSource<struct Windows::Foundation::ITypedEventHandler<class Windows::UI::ViewManagement::Core::CoreInputView *,class Windows::UI::Internal::ViewManagement::Core::FrameworkInputViewOcclusionsChangedEventArgs *>,struct Microsoft::WRL::InvokeModeOptions<-2> >::DoInvoke<class <lambda_08d20749b81716ef718bb13b141c8993> >(class <lambda_08d20749b81716ef718bb13b141c8993>)
Windows.UI.Core.TextInput.dll!Windows::UI::Text::Core::CEditContext::ReplaceTextInternal(int,int,struct MsgString *,bool,int,int)
Windows.UI.Core.TextInput.dll!Windows::UI::Text::Core::CEditContext::ReplaceText(int,int,struct MsgString *)
Windows.UI.Core.TextInput.dll!Windows::UI::Text::Core::CEditContext::InsertText(int,struct MsgString *)
msctf.dll!CTextChange::Execute()
msctf.dll!CTextInputClientOwnerAdapter::_ExecuteOperation()
msctf.dll!CTextInputClientOwnerAdapter::SetText(unsigned long,long,long,unsigned short const *,unsigned long,struct TS_TEXTCHANGE *)
TextInputFramework.dll!CACPWrap::SetText(unsigned long,struct IAnchor *,struct IAnchor *,unsigned short const *,unsigned long)
TextInputFramework.dll!CRange::_SetText(unsigned long,unsigned long,unsigned short const *,long)
IMETIP.DLL!CTipCompositionContext::SetText(unsigned long,struct ITfRange *,unsigned short const *,int,struct ITfRange * *)
IMETIP.DLL!CTipCompositionChunk::UpdateContext(unsigned long,class CTipCompositionContext *,int)
IMETIP.DLL!CTipComposition::UpdateContext()
IMETIP.DLL!CTipFnCompose::EsfnApplyComposition()
IMETIP.DLL!CTipFnCompose::OnEditSession()
IMETIP.DLL!CTipFnEditSessionHandler::CallEditSessionProc()
IMETIP.DLL!CTipFnEditSessionHandler::_OnDoEditSession()
IMETIP.DLL!Tsfutil::CTfEditSession::DoEditSession(unsigned long)
TextInputFramework.dll!CInputContext::_DoEditSession(unsigned long,struct ITfEditSession *,unsigned long)
TextInputFramework.dll!CInputContext::_EditSessionQiCallback(class CInputContext *,struct _TS_QUEUE_ITEM *,enum QiCallbackCode)
TextInputFramework.dll!CInputContext::OnLockGranted()
TextInputFramework.dll!CACPWrap::OnLockGranted()
msctf.dll!CTextInputClientOwnerAdapter::_EnableCiceroSession()
msctf.dll!CTextInputClientOwnerAdapter::RequestLock()
TextInputFramework.dll!CInputContext::_QueueItem()
TextInputFramework.dll!CInputContext::RequestEditSession()
IMETIP.DLL!CTipFnEditSessionHandler::InvokeInternal(enum __MIDL___MIDL_itf_tipfunc_0000_0009_0001,enum __MIDL___MIDL_itf_tipfunc_0000_0009_0002,struct ITipEditSessionProcedure *,struct IUnknown *,long *,unsigned long)
IMETIP.DLL!CTipFnEditSessionHandler::Invoke(enum __MIDL___MIDL_itf_tipfunc_0000_0009_0001,enum __MIDL___MIDL_itf_tipfunc_0000_0009_0002,struct ITipEditSessionProcedure *,struct IUnknown *,long *)
IMETIP.DLL!CTipComposition::ApplyToContext()
IMETIP.DLL!CTipFnProductStringHandler::UpdateComposition()
IMETIP.DLL!CTipFnProductStringHandler::_OnProductObjectChanged()
IMETIP.DLL!Imeapiutil::CImeCandidateListChangeNotify::OnCandidateListChanged(unsigned long)
IMJKAPI.DLL!CImeProductObject_JK::EndUpdateProductObject()
IMJPAPI.DLL!CIImeIPoint::UpdateContext()
IMJPAPI.DLL!CCmdUpdateContext::ExecuteWithParam()
IMJPAPI.DLL!CImeEMManager::Execute(struct _GUID const *)
IMJPAPI.DLL!CImeEMManager::EndBulkChange()
IMJPAPI.DLL!CImeKeyEventHandler_JPN_Desktop_V1::ProcessKey(struct __MIDL___MIDL_itf_imeapi_0000_0009_0001 const *,unsigned short)
IMJPAPI.DLL!CImeKeyEventHandler_JPN_Desktop_V1::OnKeyDown(struct __MIDL___MIDL_itf_imeapi_0000_0009_0001 const *,int *)
IMETIP.DLL!CTipFnKeyEventHandler::OnKeyDown()
IMETIP.DLL!CTipContextEditorMgr::_OnKeyboardEvent()
IMETIP.DLL!Tsfutil::CTfKeyEventSink::OnKeyDown(struct ITfContext *,unsigned __int64,__int64,int *)
msctf.dll!CTip::OnKeyboardEvent(struct IInputContextPrivate *,enum KeyEventFlags,unsigned __int64,__int64,int *)
msctf.dll!CThreadInputMgr::_CallKeyEventSink(unsigned long,struct IInputContextPrivate *,enum KeyEventFlags,unsigned __int64,__int64,int *)
msctf.dll!CThreadInputMgr::_KeyStroke()
msctf.dll!SYSTHREAD::OnKeyboardEvent(unsigned __int64,__int64,bool,unsigned short)
msctf.dll!TF_Notify()
user32.dll!CtfHookProcWorker(int,unsigned __int64,__int64,unsigned __int64)
user32.dll!CallHookWithSEH(struct _GENERICHOOKHEADER *,void *,unsigned long *,unsigned __int64)
user32.dll!__fnHkINDWORD()
ntdll.dll!KiUserCallbackDispatcherContinue()
win32u.dll!NtUserGetMessage()
user32.dll!GetMessageW()
WindowsTerminal.exe!WindowEmperor::HandleCommandlineArgs(int nCmdShow) Line 392
at C:\Users\James\terminal\src\cascadia\WindowsTerminal\WindowEmperor.cpp(392)
WindowsTerminal.exe!wWinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, wchar_t * __formal, int nCmdShow) Line 125
at C:\Users\James\terminal\src\cascadia\WindowsTerminal\main.cpp(125)
[External Code]
At the time I happened to be on a branch off main (PR #18949), but I doubt it makes any difference, because the vast majority of the stack trace was outside Windows Terminal.
My Windows version is 10.0.19045.5371 in case that's relevant.
Huh. That's not good.
I see all the spell checking stuff in the stack. I wonder if we can work around this issue by disabling spellcheck? Not ideal, but also... desperate times call for (desperate?) measures.
Any progress on this?