Terminal hangs when opening new windows or new tabs on Windows Server 2022 #15075

Closed
opened 2026-01-31 04:27:42 +00:00 by claunia · 75 comments
Owner

Originally created by @wkbrd on GitHub (Sep 3, 2021).

Originally assigned to: @carlos-zamora, @miniksa on GitHub.

After installing either Terminal 1.10 or Terminal Preview 1.11 (after its dependencies and winget), opening it the first time (or subsequent times) causes the window to hang indefinitely (the process shows as 'Not Responding' in Task Manager). A similar problem happens when clicking the + to open a new tab.

The problem happens regardless if the default terminal is either Powershell or others (like Command Prompt).

A partial workaround is to launch a second copy of the app while the instance is hung, then use Task Manager to kill the hung app. Once the hung process closes, the application opens as expected. The workaround does not address the new tab problem, but just the initial window opening.

If there is any logging or debug that can be enabled, please let me know.

Originally created by @wkbrd on GitHub (Sep 3, 2021). Originally assigned to: @carlos-zamora, @miniksa on GitHub. After installing either Terminal 1.10 or Terminal Preview 1.11 (after its dependencies and winget), opening it the first time (or subsequent times) causes the window to hang indefinitely (the process shows as 'Not Responding' in Task Manager). A similar problem happens when clicking the + to open a new tab. The problem happens regardless if the default terminal is either Powershell or others (like Command Prompt). A partial workaround is to launch a second copy of the app while the instance is hung, then use Task Manager to kill the hung app. Once the hung process closes, the application opens as expected. The workaround does not address the new tab problem, but just the initial window opening. If there is any logging or debug that can be enabled, please let me know.
Author
Owner

@zadjii-msft commented on GitHub (Sep 7, 2021):

A similar problem happens when clicking the + to open a new tab.

That quells my fear that it's related to #4472.

What shell are you trying to open in the new tab?

@zadjii-msft commented on GitHub (Sep 7, 2021): > A similar problem happens when clicking the + to open a new tab. That quells my fear that it's related to #4472. What shell are you trying to open in the new tab?
Author
Owner

@wkbrd commented on GitHub (Sep 7, 2021):

The default shell on a fresh install (PowerShell). I also changed the default to Command Prompt and it behaved the same.

@wkbrd commented on GitHub (Sep 7, 2021): The default shell on a fresh install (PowerShell). I also changed the default to Command Prompt and it behaved the same.
Author
Owner

@frugecn commented on GitHub (Sep 10, 2021):

I'm also seeing it in Windows 10 for Terminal 1.10

@frugecn commented on GitHub (Sep 10, 2021): I'm also seeing it in Windows 10 for Terminal 1.10
Author
Owner

@ghost commented on GitHub (Sep 15, 2021):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Sep 15, 2021): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@wkbrd commented on GitHub (Sep 15, 2021):

This is still a problem and I have replied. How does one remove the labels the bot mentions? I do not seem to have that ability.

Now the bot removed the labels but 8 days ago it did not.

@wkbrd commented on GitHub (Sep 15, 2021): This is still a problem and I have replied. How does one remove the labels the bot mentions? I do not seem to have that ability. Now the bot removed the labels but 8 days ago it did not.
Author
Owner

@zadjii-msft commented on GitHub (Sep 15, 2021):

Now the bot removed the labels but 8 days ago it did not.

Sorry about that, you probably replied in a weird window where the bot was down.

I've honestly got no idea what's going on here - could you grab a dump of the Terminal process while it's in the hung state? You should be able to with Task Manager:
image

There's not a ton of logging around this scenario, but that's partially because it's not something that's really been problematic in the past.

@zadjii-msft commented on GitHub (Sep 15, 2021): > Now the bot removed the labels but 8 days ago it did not. Sorry about that, you probably replied in a weird window where the bot was down. I've honestly got no idea what's going on here - could you grab a dump of the Terminal process while it's in the hung state? You should be able to with Task Manager: ![image](https://user-images.githubusercontent.com/18356694/133437172-87335f50-64b8-4a72-839b-2d0b43312c86.png) There's not a ton of logging around this scenario, but that's partially because it's not something that's really been problematic in the past.
Author
Owner

@wkbrd commented on GitHub (Sep 15, 2021):

@zadjii-msft : How do I transfer the dump file to you securely? I cannot seem to upload .zip files or .dmp files here.

@wkbrd commented on GitHub (Sep 15, 2021): @zadjii-msft : How do I transfer the dump file to you securely? I cannot seem to upload .zip files or .dmp files here.
Author
Owner

@zadjii-msft commented on GitHub (Sep 15, 2021):

My email is on my github profile, you can send it there ☺️

@zadjii-msft commented on GitHub (Sep 15, 2021): My email is on my github profile, you can send it there ☺️
Author
Owner

@wkbrd commented on GitHub (Sep 15, 2021):

@zadjii-msft : The dump file zipped is 76 MB which is larger than my e-mail quota allows. Is there another way to share it with you? I could request a temporary place via my IT organization, but it may take several days for the area to be provisioned.

@wkbrd commented on GitHub (Sep 15, 2021): @zadjii-msft : The dump file zipped is 76 MB which is larger than my e-mail quota allows. Is there another way to share it with you? I could request a temporary place via my IT organization, but it may take several days for the area to be provisioned.
Author
Owner

@negf commented on GitHub (Sep 16, 2021):

I have the same problem. Windows Terminal Preview v1.10.1933.0 works, and Windows Terminal v1.10.2383.0 hangs. I am on Windows 10 (19043.1237).

@negf commented on GitHub (Sep 16, 2021): I have the same problem. Windows Terminal Preview v1.10.1933.0 works, and Windows Terminal v1.10.2383.0 hangs. I am on Windows 10 (19043.1237).
Author
Owner

@wkbrd commented on GitHub (Sep 20, 2021):

@zadjii-msft : What other methods do you have to provide Microsoft the dump file? I am unable to attach it here or send via e-mail?

@wkbrd commented on GitHub (Sep 20, 2021): @zadjii-msft : What other methods do you have to provide Microsoft the dump file? I am unable to attach it here or send via e-mail?
Author
Owner

@zadjii-msft commented on GitHub (Sep 20, 2021):

@wkbrd Honestly, not sure I have a good solution. @DHowett Do we have another way other than email for something like this?

@zadjii-msft commented on GitHub (Sep 20, 2021): @wkbrd Honestly, not sure I have a good solution. @DHowett Do we have another way other than email for something like this?
Author
Owner

@wkbrd commented on GitHub (Sep 20, 2021):

Perhaps if you have a private OneDrive folder that could be shared with me and then I could upload into it? (And hopefully the upload is not blocked by OneDrive)

@wkbrd commented on GitHub (Sep 20, 2021): Perhaps if you have a private OneDrive folder that could be shared with me and then I could upload into it? (And hopefully the upload is not blocked by OneDrive)
Author
Owner

@Falco20019 commented on GitHub (Sep 21, 2021):

Similar to #11252 btw.

@Falco20019 commented on GitHub (Sep 21, 2021): Similar to #11252 btw.
Author
Owner

@wkbrd commented on GitHub (Sep 21, 2021):

@Falco20019 : Yes, this appears similar.

@wkbrd commented on GitHub (Sep 21, 2021): @Falco20019 : Yes, this appears similar.
Author
Owner

@Sankgreall commented on GitHub (Sep 21, 2021):

#11252 appears to be related to Windows 10, whereas this issue appears to be related to Windows Server. I'm not sure they are duplicates, though #11252 has been marked as a duplicate of this issue now.

@Sankgreall commented on GitHub (Sep 21, 2021): #11252 appears to be related to Windows 10, whereas this issue appears to be related to Windows Server. I'm not sure they are duplicates, though #11252 has been marked as a duplicate of this issue now.
Author
Owner

@Sankgreall commented on GitHub (Sep 21, 2021):

@zadjii-msft If it helps, I have uploaded a memory dump with Windows Terminal in its hang state and shared it with your email address. You can access it through OneDrive here. https://srminform-my.sharepoint.com/:u:/g/personal/j_jackson_s-rminform_com/EfptE2hZQ2xErdBCGJN967MBjQavxnnXQQx8JtaNyc8_uQ?email=migrie%40microsoft.com&e=9IKHlN

Hope that's okay but let me know if you would like me to host it somewhere else

@Sankgreall commented on GitHub (Sep 21, 2021): @zadjii-msft If it helps, I have uploaded a memory dump with Windows Terminal in its hang state and shared it with your email address. You can access it through OneDrive here. [https://srminform-my.sharepoint.com/:u:/g/personal/j_jackson_s-rminform_com/EfptE2hZQ2xErdBCGJN967MBjQavxnnXQQx8JtaNyc8_uQ?email=migrie%40microsoft.com&e=9IKHlN](https://srminform-my.sharepoint.com/:u:/g/personal/j_jackson_s-rminform_com/EfptE2hZQ2xErdBCGJN967MBjQavxnnXQQx8JtaNyc8_uQ?email=migrie%40microsoft.com&e=9IKHlN) Hope that's okay but let me know if you would like me to host it somewhere else
Author
Owner

@wkbrd commented on GitHub (Sep 21, 2021):

Hi @Sankgreall , was your dump from Windows 10 or Server 2022?

@wkbrd commented on GitHub (Sep 21, 2021): Hi @Sankgreall , was your dump from Windows 10 or Server 2022?
Author
Owner

@zadjii-msft commented on GitHub (Sep 21, 2021):

main thread
0:000> k
 # Child-SP          RetAddr               Call Site
00 0000002f`555ae538 00007ffe`616b9205     ntdll!ZwWaitForAlertByThreadId+0x14 [minkernel\ntdll\daytona\objfre\amd64\usrstubs.asm @ 3891] 
01 0000002f`555ae540 00007ffd`fe356328     ntdll!RtlAcquireSRWLockExclusive+0x165 [minkernel\ntos\rtl\srwlock.c @ 1296] 
02 (Inline Function) --------`--------     Microsoft_Terminal_Control!std::shared_mutex::lock+0x8 [C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\shared_mutex @ 41] 
03 0000002f`555ae5b0 00007ffd`fe367b39     Microsoft_Terminal_Control!std::unique_lock<std::shared_mutex>::unique_lock<std::shared_mutex>+0x18 [C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\mutex @ 139] 
04 (Inline Function) --------`--------     Microsoft_Terminal_Control!Microsoft::Terminal::Core::Terminal::LockForWriting+0x10 [C:\a\_work\1\s\src\cascadia\TerminalCore\Terminal.cpp @ 883] 
05 0000002f`555ae5e0 00007ffd`fe34d1d7     Microsoft_Terminal_Control!winrt::Microsoft::Terminal::Control::implementation::ControlCore::Initialize+0x81 [C:\a\_work\1\s\src\cascadia\TerminalControl\ControlCore.cpp @ 145] 
06 0000002f`555ae720 00007ffd`fe34c85b     Microsoft_Terminal_Control!winrt::Microsoft::Terminal::Control::implementation::TermControl::_InitializeTerminal+0x1cb [C:\a\_work\1\s\src\cascadia\TerminalControl\TermControl.cpp @ 666] 
07 (Inline Function) --------`--------     Microsoft_Terminal_Control!winrt::Microsoft::Terminal::Control::implementation::TermControl::{ctor}::__l2::<lambda_51f78f479bc2732475eb713fee482d54>::operator()+0x9 [C:\a\_work\1\s\src\cascadia\TerminalControl\TermControl.cpp @ 99] 
08 0000002f`555ae800 00007ffe`59670a4f     Microsoft_Terminal_Control!winrt::impl::delegate<winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable>,<lambda_51f78f479bc2732475eb713fee482d54> >::Invoke+0x4b [C:\a\_work\1\s\src\cascadia\TerminalControl\Generated Files\winrt\Windows.Foundation.h @ 882] 
09 0000002f`555ae850 00007ffe`5967094a     Windows_UI_Xaml!DirectUI::CEventSourceBase<DirectUI::IUntypedEventSource,Windows::Foundation::IEventHandler<IInspectable *>,IInspectable,IInspectable>::Raise+0x7f [onecoreuap\windows\dxaml\xcp\dxaml\lib\JoltClasses.h @ 275] 
0a 0000002f`555ae8b0 00007ffe`59663342     Windows_UI_Xaml!DirectUI::CEventSourceBase<DirectUI::IUntypedEventSource,Windows::Foundation::IEventHandler<IInspectable *>,IInspectable,IInspectable>::UntypedRaise+0x4a [onecoreuap\windows\dxaml\xcp\dxaml\lib\JoltClasses.h @ 248] 
0b 0000002f`555ae8f0 00007ffe`5962ed11     Windows_UI_Xaml!DirectUI::FrameworkElement::RaiseLayoutUpdated+0x42 [onecoreuap\windows\dxaml\xcp\dxaml\lib\frameworkelement_partial.cpp @ 975] 
0c 0000002f`555ae920 00007ffe`5960b952     Windows_UI_Xaml!DirectUI::DXamlCore::OnLayoutUpdated+0x121 [onecoreuap\windows\dxaml\xcp\dxaml\lib\dxamlcore.cpp @ 2131] 
0d 0000002f`555ae980 00007ffe`5958ff5c     Windows_UI_Xaml!DirectUI::DXamlCore::RaiseEvent+0x252
Renderer Thread

0:018> k

Child-SP RetAddr Call Site

00 0000002f569ffa38 00007ffe5f431a8e ntdll!ZwWaitForSingleObject+0x14 [minkernel\ntdll\daytona\objfre\amd64\usrstubs.asm @ 211]
01 0000002f569ffa40 00007ffdfe36d0ec KERNELBASE!WaitForSingleObjectEx+0x8e [minkernel\kernelbase\synch.c @ 1328]
02 0000002f569ffae0 00007ffe5fab7034 Microsoft_Terminal_Control!Microsoft::Console::Render::RenderThread::_ThreadProc+0x1c [C:\a_work\1\s\src\renderer\base\thread.cpp @ 173]
03 0000002f569ffb10 00007ffe616e2651 kernel32!BaseThreadInitThunk+0x14 [clientcore\base\win32\client\thread.c @ 64]
04 0000002f569ffb40 0000000000000000 ntdll!RtlUserThreadStart+0x21 [minkernel\ntdll\rtlstrt.c @ 1153]

some variables on the main thread
0:000> dx this
this                 : 0x1e285215dd0 [Type: winrt::impl::heap_implements<winrt::Microsoft::Terminal::Control::implementation::ControlCore> * (derived from winrt::Microsoft::Terminal::Control::implementation::ControlCore *)]
    [+0x010] vtable           [Type: winrt::impl::produce<winrt::Microsoft::Terminal::Control::implementation::ControlCore,winrt::Microsoft::Terminal::Control::IControlCore>]
    [+0x018] vtable           [Type: winrt::impl::produce<winrt::Microsoft::Terminal::Control::implementation::ControlCore,winrt::Microsoft::Terminal::Control::ICoreState>]
    is_composing     : false [Type: bool]
    [+0x008] m_references     : 0x800000f1436922a0 [Type: std::atomic<unsigned __int64>]
    [+0x020] _FontSizeChangedHandlers [Type: winrt::event<winrt::Microsoft::Terminal::Control::FontSizeChangedEventArgs>]
    [+0x038] _CopyToClipboardHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Microsoft::Terminal::Control::CopyToClipboardEventArgs> >]
    [+0x050] _TitleChangedHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Microsoft::Terminal::Control::TitleChangedEventArgs> >]
    [+0x068] _WarningBellHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Windows::Foundation::IInspectable> >]
    [+0x080] _TabColorChangedHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Windows::Foundation::IInspectable> >]
    [+0x098] _BackgroundColorChangedHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Windows::Foundation::IInspectable> >]
    [+0x0b0] _ScrollPositionChangedHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Microsoft::Terminal::Control::ScrollPositionChangedArgs> >]
    [+0x0c8] _CursorPositionChangedHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Windows::Foundation::IInspectable> >]
    [+0x0e0] _TaskbarProgressChangedHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Windows::Foundation::IInspectable> >]
    [+0x0f8] _ConnectionStateChangedHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Windows::Foundation::IInspectable> >]
    [+0x110] _HoveredHyperlinkChangedHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Windows::Foundation::IInspectable> >]
    [+0x128] _RendererEnteredErrorStateHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Windows::Foundation::IInspectable> >]
    [+0x140] _SwapChainChangedHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Windows::Foundation::IInspectable> >]
    [+0x158] _RendererWarningHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Microsoft::Terminal::Control::RendererWarningArgs> >]
    [+0x170] _RaiseNoticeHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Microsoft::Terminal::Control::NoticeEventArgs> >]
    [+0x188] _TransparencyChangedHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Microsoft::Terminal::Control::TransparencyChangedEventArgs> >]
    [+0x1a0] _ReceivedOutputHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Windows::Foundation::IInspectable> >]
    [+0x1b8] _initializedTerminal : false [Type: bool]
    [+0x1b9] _closing         : false [Type: std::atomic<bool>]
    [+0x1c0] _connection      [Type: winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection]
    [+0x1c8] _connectionOutputEventToken [Type: winrt::event_token]
    [+0x1d0] _connectionStateChangedRevoker [Type: winrt::impl::event_revoker<winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection,&winrt::impl::abi<winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection,void>::type::`vcall'{104}'>]
    [+0x1e0] _terminal        : unique_ptr {...} [Type: std::unique_ptr<Microsoft::Terminal::Core::Terminal,std::default_delete<Microsoft::Terminal::Core::Terminal> >]
    [+0x1e8] _renderEngine    : empty [Type: std::unique_ptr<Microsoft::Console::Render::DxEngine,std::default_delete<Microsoft::Console::Render::DxEngine> >]
    [+0x1f0] _renderer        : unique_ptr {...} [Type: std::unique_ptr<Microsoft::Console::Render::Renderer,std::default_delete<Microsoft::Console::Render::Renderer> >]
    [+0x1f8] _settings        [Type: winrt::Microsoft::Terminal::Control::IControlSettings]
    [+0x200] _desiredFont     [Type: FontInfoDesired]
    [+0x238] _actualFont      [Type: FontInfo]
    [+0x278] _leadingSurrogate : nullopt [Type: std::optional<wchar_t>]
    [+0x280] _lastHoveredCell : nullopt [Type: std::optional<til::point>]
    [+0x298] _lastHoveredId   : 0x0 [Type: unsigned short]
    [+0x29a] _isReadOnly      : false [Type: bool]
    [+0x2a0] _lastHoveredInterval : nullopt [Type: std::optional<interval_tree::Interval<til::point,unsigned __int64> >]
    [+0x2d0] _panelWidth      : 1121.333374 [Type: double]
    [+0x2d8] _panelHeight     : 580.000000 [Type: double]
    [+0x2e0] _compositionScale : 1.500000 [Type: double]
0:000> dx dxEngine
dxEngine                 : unique_ptr {...} [Type: std::unique_ptr<Microsoft::Console::Render::DxEngine,std::default_delete<Microsoft::Console::Render::DxEngine> >]
    [<Raw View>]     [Type: std::unique_ptr<Microsoft::Console::Render::DxEngine,std::default_delete<Microsoft::Console::Render::DxEngine> >]
    [ptr]            : 0x2f555ae6c0 [Type: Microsoft::Console::Render::DxEngine *]

Curious, the stack is stuck in LockForWriting, but dxEngine has been initialized. Maybe that's just garbage though? _renderer has one engine, the UiaEngine already hooked up. That's not terribly surprising, given the other UIA threads that already exist.

  • Preview v1.10.1933.0 works
  • Stable v1.10.2383.0 hangs

what did we backport to 1.10.2383 that wasn't in 1.10.1933? The Uia change, #10971 maybe?

@zadjii-msft commented on GitHub (Sep 21, 2021): <details> <summary>main thread</summary> ``` 0:000> k # Child-SP RetAddr Call Site 00 0000002f`555ae538 00007ffe`616b9205 ntdll!ZwWaitForAlertByThreadId+0x14 [minkernel\ntdll\daytona\objfre\amd64\usrstubs.asm @ 3891] 01 0000002f`555ae540 00007ffd`fe356328 ntdll!RtlAcquireSRWLockExclusive+0x165 [minkernel\ntos\rtl\srwlock.c @ 1296] 02 (Inline Function) --------`-------- Microsoft_Terminal_Control!std::shared_mutex::lock+0x8 [C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\shared_mutex @ 41] 03 0000002f`555ae5b0 00007ffd`fe367b39 Microsoft_Terminal_Control!std::unique_lock<std::shared_mutex>::unique_lock<std::shared_mutex>+0x18 [C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\mutex @ 139] 04 (Inline Function) --------`-------- Microsoft_Terminal_Control!Microsoft::Terminal::Core::Terminal::LockForWriting+0x10 [C:\a\_work\1\s\src\cascadia\TerminalCore\Terminal.cpp @ 883] 05 0000002f`555ae5e0 00007ffd`fe34d1d7 Microsoft_Terminal_Control!winrt::Microsoft::Terminal::Control::implementation::ControlCore::Initialize+0x81 [C:\a\_work\1\s\src\cascadia\TerminalControl\ControlCore.cpp @ 145] 06 0000002f`555ae720 00007ffd`fe34c85b Microsoft_Terminal_Control!winrt::Microsoft::Terminal::Control::implementation::TermControl::_InitializeTerminal+0x1cb [C:\a\_work\1\s\src\cascadia\TerminalControl\TermControl.cpp @ 666] 07 (Inline Function) --------`-------- Microsoft_Terminal_Control!winrt::Microsoft::Terminal::Control::implementation::TermControl::{ctor}::__l2::<lambda_51f78f479bc2732475eb713fee482d54>::operator()+0x9 [C:\a\_work\1\s\src\cascadia\TerminalControl\TermControl.cpp @ 99] 08 0000002f`555ae800 00007ffe`59670a4f Microsoft_Terminal_Control!winrt::impl::delegate<winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable>,<lambda_51f78f479bc2732475eb713fee482d54> >::Invoke+0x4b [C:\a\_work\1\s\src\cascadia\TerminalControl\Generated Files\winrt\Windows.Foundation.h @ 882] 09 0000002f`555ae850 00007ffe`5967094a Windows_UI_Xaml!DirectUI::CEventSourceBase<DirectUI::IUntypedEventSource,Windows::Foundation::IEventHandler<IInspectable *>,IInspectable,IInspectable>::Raise+0x7f [onecoreuap\windows\dxaml\xcp\dxaml\lib\JoltClasses.h @ 275] 0a 0000002f`555ae8b0 00007ffe`59663342 Windows_UI_Xaml!DirectUI::CEventSourceBase<DirectUI::IUntypedEventSource,Windows::Foundation::IEventHandler<IInspectable *>,IInspectable,IInspectable>::UntypedRaise+0x4a [onecoreuap\windows\dxaml\xcp\dxaml\lib\JoltClasses.h @ 248] 0b 0000002f`555ae8f0 00007ffe`5962ed11 Windows_UI_Xaml!DirectUI::FrameworkElement::RaiseLayoutUpdated+0x42 [onecoreuap\windows\dxaml\xcp\dxaml\lib\frameworkelement_partial.cpp @ 975] 0c 0000002f`555ae920 00007ffe`5960b952 Windows_UI_Xaml!DirectUI::DXamlCore::OnLayoutUpdated+0x121 [onecoreuap\windows\dxaml\xcp\dxaml\lib\dxamlcore.cpp @ 2131] 0d 0000002f`555ae980 00007ffe`5958ff5c Windows_UI_Xaml!DirectUI::DXamlCore::RaiseEvent+0x252 ``` </details> <details> <summary>Renderer Thread</summary> 0:018> k # Child-SP RetAddr Call Site 00 0000002f`569ffa38 00007ffe`5f431a8e ntdll!ZwWaitForSingleObject+0x14 [minkernel\ntdll\daytona\objfre\amd64\usrstubs.asm @ 211] 01 0000002f`569ffa40 00007ffd`fe36d0ec KERNELBASE!WaitForSingleObjectEx+0x8e [minkernel\kernelbase\synch.c @ 1328] 02 0000002f`569ffae0 00007ffe`5fab7034 Microsoft_Terminal_Control!Microsoft::Console::Render::RenderThread::_ThreadProc+0x1c [C:\a\_work\1\s\src\renderer\base\thread.cpp @ 173] 03 0000002f`569ffb10 00007ffe`616e2651 kernel32!BaseThreadInitThunk+0x14 [clientcore\base\win32\client\thread.c @ 64] 04 0000002f`569ffb40 00000000`00000000 ntdll!RtlUserThreadStart+0x21 [minkernel\ntdll\rtlstrt.c @ 1153] </details> <details> <summary>some variables on the main thread</summary> ``` 0:000> dx this this : 0x1e285215dd0 [Type: winrt::impl::heap_implements<winrt::Microsoft::Terminal::Control::implementation::ControlCore> * (derived from winrt::Microsoft::Terminal::Control::implementation::ControlCore *)] [+0x010] vtable [Type: winrt::impl::produce<winrt::Microsoft::Terminal::Control::implementation::ControlCore,winrt::Microsoft::Terminal::Control::IControlCore>] [+0x018] vtable [Type: winrt::impl::produce<winrt::Microsoft::Terminal::Control::implementation::ControlCore,winrt::Microsoft::Terminal::Control::ICoreState>] is_composing : false [Type: bool] [+0x008] m_references : 0x800000f1436922a0 [Type: std::atomic<unsigned __int64>] [+0x020] _FontSizeChangedHandlers [Type: winrt::event<winrt::Microsoft::Terminal::Control::FontSizeChangedEventArgs>] [+0x038] _CopyToClipboardHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Microsoft::Terminal::Control::CopyToClipboardEventArgs> >] [+0x050] _TitleChangedHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Microsoft::Terminal::Control::TitleChangedEventArgs> >] [+0x068] _WarningBellHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Windows::Foundation::IInspectable> >] [+0x080] _TabColorChangedHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Windows::Foundation::IInspectable> >] [+0x098] _BackgroundColorChangedHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Windows::Foundation::IInspectable> >] [+0x0b0] _ScrollPositionChangedHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Microsoft::Terminal::Control::ScrollPositionChangedArgs> >] [+0x0c8] _CursorPositionChangedHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Windows::Foundation::IInspectable> >] [+0x0e0] _TaskbarProgressChangedHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Windows::Foundation::IInspectable> >] [+0x0f8] _ConnectionStateChangedHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Windows::Foundation::IInspectable> >] [+0x110] _HoveredHyperlinkChangedHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Windows::Foundation::IInspectable> >] [+0x128] _RendererEnteredErrorStateHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Windows::Foundation::IInspectable> >] [+0x140] _SwapChainChangedHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Windows::Foundation::IInspectable> >] [+0x158] _RendererWarningHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Microsoft::Terminal::Control::RendererWarningArgs> >] [+0x170] _RaiseNoticeHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Microsoft::Terminal::Control::NoticeEventArgs> >] [+0x188] _TransparencyChangedHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Microsoft::Terminal::Control::TransparencyChangedEventArgs> >] [+0x1a0] _ReceivedOutputHandlers [Type: winrt::event<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Foundation::IInspectable,winrt::Windows::Foundation::IInspectable> >] [+0x1b8] _initializedTerminal : false [Type: bool] [+0x1b9] _closing : false [Type: std::atomic<bool>] [+0x1c0] _connection [Type: winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection] [+0x1c8] _connectionOutputEventToken [Type: winrt::event_token] [+0x1d0] _connectionStateChangedRevoker [Type: winrt::impl::event_revoker<winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection,&winrt::impl::abi<winrt::Microsoft::Terminal::TerminalConnection::ITerminalConnection,void>::type::`vcall'{104}'>] [+0x1e0] _terminal : unique_ptr {...} [Type: std::unique_ptr<Microsoft::Terminal::Core::Terminal,std::default_delete<Microsoft::Terminal::Core::Terminal> >] [+0x1e8] _renderEngine : empty [Type: std::unique_ptr<Microsoft::Console::Render::DxEngine,std::default_delete<Microsoft::Console::Render::DxEngine> >] [+0x1f0] _renderer : unique_ptr {...} [Type: std::unique_ptr<Microsoft::Console::Render::Renderer,std::default_delete<Microsoft::Console::Render::Renderer> >] [+0x1f8] _settings [Type: winrt::Microsoft::Terminal::Control::IControlSettings] [+0x200] _desiredFont [Type: FontInfoDesired] [+0x238] _actualFont [Type: FontInfo] [+0x278] _leadingSurrogate : nullopt [Type: std::optional<wchar_t>] [+0x280] _lastHoveredCell : nullopt [Type: std::optional<til::point>] [+0x298] _lastHoveredId : 0x0 [Type: unsigned short] [+0x29a] _isReadOnly : false [Type: bool] [+0x2a0] _lastHoveredInterval : nullopt [Type: std::optional<interval_tree::Interval<til::point,unsigned __int64> >] [+0x2d0] _panelWidth : 1121.333374 [Type: double] [+0x2d8] _panelHeight : 580.000000 [Type: double] [+0x2e0] _compositionScale : 1.500000 [Type: double] 0:000> dx dxEngine dxEngine : unique_ptr {...} [Type: std::unique_ptr<Microsoft::Console::Render::DxEngine,std::default_delete<Microsoft::Console::Render::DxEngine> >] [<Raw View>] [Type: std::unique_ptr<Microsoft::Console::Render::DxEngine,std::default_delete<Microsoft::Console::Render::DxEngine> >] [ptr] : 0x2f555ae6c0 [Type: Microsoft::Console::Render::DxEngine *] ``` </details> Curious, the stack is stuck in `LockForWriting`, but `dxEngine` _has_ been initialized. Maybe that's just garbage though? `_renderer` has one engine, the `UiaEngine` already hooked up. That's not terribly surprising, given the other UIA threads that already exist. > * Preview v1.10.1933.0 works > * Stable v1.10.2383.0 hangs what did we backport to 1.10.2383 that wasn't in 1.10.1933? The Uia change, #10971 maybe?
Author
Owner

@Sankgreall commented on GitHub (Sep 21, 2021):

Hi @Sankgreall , was your dump from Windows 10 or Server 2022?

Windows 10 build 2004

@Sankgreall commented on GitHub (Sep 21, 2021): > Hi @Sankgreall , was your dump from Windows 10 or Server 2022? Windows 10 build 2004
Author
Owner

@miniksa commented on GitHub (Sep 21, 2021):

Hi @Sankgreall , was your dump from Windows 10 or Server 2022?

Windows 10 build 2004

0:000> vertarget
Windows 10 Version 19042 MP (8 procs) Free x64
Product: Server, suite: TerminalServer
Edition build lab: 19041.1.amd64fre.vb_release.191206-1406
Machine Name:
Debug session time: Tue Sep 21 06:11:55.000 2021 (UTC - 7:00)
System Uptime: 0 days 10:01:57.506
Process Uptime: 0 days 0:00:19.000
Kernel time: 0 days 0:00:00.000
User time: 0 days 0:00:00.000

@Sankgreall... it looks like you're running Server too.

@miniksa commented on GitHub (Sep 21, 2021): > > Hi @Sankgreall , was your dump from Windows 10 or Server 2022? > > Windows 10 build 2004 0:000> vertarget Windows 10 Version 19042 MP (8 procs) Free x64 Product: Server, suite: TerminalServer Edition build lab: 19041.1.amd64fre.vb_release.191206-1406 Machine Name: Debug session time: Tue Sep 21 06:11:55.000 2021 (UTC - 7:00) System Uptime: 0 days 10:01:57.506 Process Uptime: 0 days 0:00:19.000 Kernel time: 0 days 0:00:00.000 User time: 0 days 0:00:00.000 @Sankgreall... it looks like you're running Server too.
Author
Owner

@zadjii-msft commented on GitHub (Sep 21, 2021):

My theory that it's related to OS version is probably wrong since @Falco20019 was seeing this on 1909 as well. I'm really thinking it's the uia change but @miniksa's going to check a Server VM just for sanity

@zadjii-msft commented on GitHub (Sep 21, 2021): My theory that it's related to OS version is probably wrong since @Falco20019 was seeing this on 1909 as well. I'm really thinking it's the uia change but @miniksa's going to check a Server VM just for sanity
Author
Owner

@miniksa commented on GitHub (Sep 21, 2021):

I just want a local repro if possible since the SRWLock doesn't store the thread ID that locked it.

@miniksa commented on GitHub (Sep 21, 2021): I just want a local repro if possible since the SRWLock doesn't store the thread ID that locked it.
Author
Owner

@Sankgreall commented on GitHub (Sep 21, 2021):

Hi @Sankgreall , was your dump from Windows 10 or Server 2022?

Windows 10 build 2004

0:000> vertarget
Windows 10 Version 19042 MP (8 procs) Free x64
Product: Server, suite: TerminalServer
Edition build lab: 19041.1.amd64fre.vb_release.191206-1406
Machine Name:
Debug session time: Tue Sep 21 06:11:55.000 2021 (UTC - 7:00)
System Uptime: 0 days 10:01:57.506
Process Uptime: 0 days 0:00:19.000
Kernel time: 0 days 0:00:00.000
User time: 0 days 0:00:00.000

@Sankgreall... it looks like you're running Server too.

I think this is because I am using the multi-session build on Azure, which if I understand correctly borrows a few things from the server builds... All I can say for certain is that this machine was deployed using the image in the public Azure Marketplace called "Windows 10 Enterprise multi-session"

@Sankgreall commented on GitHub (Sep 21, 2021): > > > Hi @Sankgreall , was your dump from Windows 10 or Server 2022? > > > > > > Windows 10 build 2004 > > 0:000> vertarget > Windows 10 Version 19042 MP (8 procs) Free x64 > Product: Server, suite: TerminalServer > Edition build lab: 19041.1.amd64fre.vb_release.191206-1406 > Machine Name: > Debug session time: Tue Sep 21 06:11:55.000 2021 (UTC - 7:00) > System Uptime: 0 days 10:01:57.506 > Process Uptime: 0 days 0:00:19.000 > Kernel time: 0 days 0:00:00.000 > User time: 0 days 0:00:00.000 > > @Sankgreall... it looks like you're running Server too. I think this is because I am using the multi-session build on Azure, which if I understand correctly borrows a few things from the server builds... All I can say for certain is that this machine was deployed using the image in the public Azure Marketplace called "Windows 10 Enterprise multi-session"
Author
Owner

@miniksa commented on GitHub (Sep 21, 2021):

OK so it's not happening for me straight up with a Windows Server 2022 image as either standard user or administrator... trying to think of a different approach...

@miniksa commented on GitHub (Sep 21, 2021): OK so it's not happening for me straight up with a Windows Server 2022 image as either standard user or administrator... trying to think of a different approach...
Author
Owner

@miniksa commented on GitHub (Sep 21, 2021):

I tried creating the same Azure image and it didn't repro there either, @Sankgreall. Can you provide any additional information about the parameters you used for that Azure machine and/or screenshots of the marketplace for the options you chose?

@miniksa commented on GitHub (Sep 21, 2021): I tried creating the same Azure image and it didn't repro there either, @Sankgreall. Can you provide any additional information about the parameters you used for that Azure machine and/or screenshots of the marketplace for the options you chose?
Author
Owner

@zadjii-msft commented on GitHub (Sep 21, 2021):

Our other theory has to do with some sort of accessibility code, so if any of y'all are using screen readers of any sort (Narrator, NVDA, Accessibility Insights, anything), that might be helpful information as well.

@zadjii-msft commented on GitHub (Sep 21, 2021): Our other theory has to do with some sort of accessibility code, so if any of y'all are using screen readers of any sort (Narrator, NVDA, Accessibility Insights, anything), that might be helpful information as well.
Author
Owner

@wkbrd commented on GitHub (Sep 21, 2021):

I do not think I am using any accessibility apps/code on Windows Server 2022.

@wkbrd commented on GitHub (Sep 21, 2021): I do not think I am using any accessibility apps/code on Windows Server 2022.
Author
Owner

@Sankgreall commented on GitHub (Sep 21, 2021):

Our other theory has to do with some sort of accessibility code, so if any of y'all are using screen readers of any sort (Narrator, NVDA, Accessibility Insights, anything), that might be helpful information as well.

Not to my knowledge. Is there a theory that this error is limited to a recent version. Worth checking it doesn't appear on a particular older version?

Will confirm the exact Windows build tomorrow, just need to consult the ARM template when I'm back in the office.

@Sankgreall commented on GitHub (Sep 21, 2021): > Our other theory has to do with some sort of accessibility code, so if any of y'all are using screen readers of any sort (Narrator, NVDA, Accessibility Insights, anything), that might be helpful information as well. Not to my knowledge. Is there a theory that this error is limited to a recent version. Worth checking it doesn't appear on a particular older version? Will confirm the exact Windows build tomorrow, just need to consult the ARM template when I'm back in the office.
Author
Owner

@Sankgreall commented on GitHub (Sep 21, 2021):

Not to my knowledge. Is there a theory that this error is limited to a recent version. Worth checking it doesn't appear on a particular older version?

However - actually, we are using this during our build process: https://github.com/The-Virtual-Desktop-Team/Virtual-Desktop-Optimization-Tool

Just thought that this may disable some accessibility features, in case that's relevant?

@Sankgreall commented on GitHub (Sep 21, 2021): >Not to my knowledge. Is there a theory that this error is limited to a recent version. Worth checking it doesn't appear on a particular older version? However - actually, we are using this during our build process: https://github.com/The-Virtual-Desktop-Team/Virtual-Desktop-Optimization-Tool Just thought that this may disable some accessibility features, in case that's relevant?
Author
Owner

@frugecn commented on GitHub (Sep 21, 2021):

Windows 10 19042.1202
Also in Azure, though I don't know any of the details as to how they set it up
No special accessibility settings that I'm aware of.

@frugecn commented on GitHub (Sep 21, 2021): Windows 10 19042.1202 Also in Azure, though I don't know any of the details as to how they set it up No special accessibility settings that I'm aware of.
Author
Owner

@zadjii-msft commented on GitHub (Sep 21, 2021):

the ARM template

wait are you running on ARM? That would be an interesting note here

Is there a theory that this error is limited to a recent version. Worth checking it doesn't appear on a particular older version?

My theory is that this was caused by #10971 (and/or the paired commit for the 1.10 branch), but unless you can build the Terminal from source, there's no way to isolate that commit as the root cause here

@zadjii-msft commented on GitHub (Sep 21, 2021): > the ARM template wait are you running on ARM? That would be an interesting note here > Is there a theory that this error is limited to a recent version. Worth checking it doesn't appear on a particular older version? My theory is that this was caused by #10971 (and/or the paired commit for the 1.10 branch), but unless you can build the Terminal from source, there's no way to isolate that commit as the root cause here
Author
Owner

@miniksa commented on GitHub (Sep 21, 2021):

the ARM template

wait are you running on ARM? That would be an interesting note here

@DHowett says "ARM" is "Azure Resource Manager"... a thing to template out Azure deployments. Not the CPU architecture.

@miniksa commented on GitHub (Sep 21, 2021): > > the ARM template > > wait are you running on ARM? That would be an interesting note here @DHowett says "ARM" is "Azure Resource Manager"... a thing to template out Azure deployments. Not the CPU architecture.
Author
Owner

@Sankgreall commented on GitHub (Sep 21, 2021):

@DHowett says "ARM" is "Azure Resource Manager"... a thing to template out Azure deployments. Not the CPU architecture.

This is correct, apologies for the confusion

@Sankgreall commented on GitHub (Sep 21, 2021): >@DHowett says "ARM" is "Azure Resource Manager"... a thing to template out Azure deployments. Not the CPU architecture. This is correct, apologies for the confusion
Author
Owner

@zadjii-msft commented on GitHub (Sep 21, 2021):

note to self:

0:000> dx host
host                 [Type: AppHost]
    [+0x008] _useNonClientArea : true [Type: bool]
    [+0x010] _window          : unique_ptr {...} [Type: std::unique_ptr<IslandWindow,std::default_delete<IslandWindow> >]
    [+0x018] _app             [Type: winrt::TerminalApp::App]
    [+0x020] _logic           [Type: winrt::TerminalApp::AppLogic]
    [+0x028] _shouldCreateWindow : true [Type: bool]
    [+0x030] _windowManager   [Type: winrt::Microsoft::Terminal::Remoting::WindowManager]
    [+0x038] _hotkeys         : { size=1 } [Type: std::vector<winrt::Microsoft::Terminal::Control::KeyChord,std::allocator<winrt::Microsoft::Terminal::Control::KeyChord> >]
    [+0x050] _hotkeyActions   [Type: winrt::Windows::Foundation::Collections::IMapView<winrt::Microsoft::Terminal::Control::KeyChord,winrt::Microsoft::Terminal::Settings::Model::Command>]
    [+0x058] _desktopManager  [Type: winrt::com_ptr<IVirtualDesktopManager>]
    [+0x060] _trayIconData    : nullopt [Type: std::optional<_NOTIFYICONDATAW>]
0:000> dx -r1 (*((WindowsTerminal!winrt::Microsoft::Terminal::Remoting::WindowManager *)0x2f555af700))
(*((WindowsTerminal!winrt::Microsoft::Terminal::Remoting::WindowManager *)0x2f555af700))                 [Type: winrt::Microsoft::Terminal::Remoting::WindowManager]
    [+0x000] m_ptr            : 0x1e280169ae0 [Type: winrt::impl::abi<winrt::Windows::Foundation::IUnknown,void>::type *]
0:000> dx -r1 (*((Microsoft_Terminal_Remoting!winrt::Microsoft::Terminal::Remoting::Peasant *)0x1e280169b38))
(*((Microsoft_Terminal_Remoting!winrt::Microsoft::Terminal::Remoting::Peasant *)0x1e280169b38))                 [Type: winrt::Microsoft::Terminal::Remoting::Peasant]
    [+0x000] m_ptr            : 0x0 [Type: winrt::impl::abi<winrt::Windows::Foundation::IUnknown,void>::type *]
0:000> dx -r1 (*((Microsoft_Terminal_Remoting!winrt::Microsoft::Terminal::Remoting::Monarch *)0x1e280169b30))
(*((Microsoft_Terminal_Remoting!winrt::Microsoft::Terminal::Remoting::Monarch *)0x1e280169b30))                 [Type: winrt::Microsoft::Terminal::Remoting::Monarch]
    [+0x000] m_ptr            : 0x614 [Type: winrt::impl::abi<winrt::Windows::Foundation::IUnknown,void>::type *]

the monarch exists, but the peasant is null, and that's just wrong. Maybe I was the murderer after all.

@zadjii-msft commented on GitHub (Sep 21, 2021): note to self: ``` 0:000> dx host host [Type: AppHost] [+0x008] _useNonClientArea : true [Type: bool] [+0x010] _window : unique_ptr {...} [Type: std::unique_ptr<IslandWindow,std::default_delete<IslandWindow> >] [+0x018] _app [Type: winrt::TerminalApp::App] [+0x020] _logic [Type: winrt::TerminalApp::AppLogic] [+0x028] _shouldCreateWindow : true [Type: bool] [+0x030] _windowManager [Type: winrt::Microsoft::Terminal::Remoting::WindowManager] [+0x038] _hotkeys : { size=1 } [Type: std::vector<winrt::Microsoft::Terminal::Control::KeyChord,std::allocator<winrt::Microsoft::Terminal::Control::KeyChord> >] [+0x050] _hotkeyActions [Type: winrt::Windows::Foundation::Collections::IMapView<winrt::Microsoft::Terminal::Control::KeyChord,winrt::Microsoft::Terminal::Settings::Model::Command>] [+0x058] _desktopManager [Type: winrt::com_ptr<IVirtualDesktopManager>] [+0x060] _trayIconData : nullopt [Type: std::optional<_NOTIFYICONDATAW>] 0:000> dx -r1 (*((WindowsTerminal!winrt::Microsoft::Terminal::Remoting::WindowManager *)0x2f555af700)) (*((WindowsTerminal!winrt::Microsoft::Terminal::Remoting::WindowManager *)0x2f555af700)) [Type: winrt::Microsoft::Terminal::Remoting::WindowManager] [+0x000] m_ptr : 0x1e280169ae0 [Type: winrt::impl::abi<winrt::Windows::Foundation::IUnknown,void>::type *] 0:000> dx -r1 (*((Microsoft_Terminal_Remoting!winrt::Microsoft::Terminal::Remoting::Peasant *)0x1e280169b38)) (*((Microsoft_Terminal_Remoting!winrt::Microsoft::Terminal::Remoting::Peasant *)0x1e280169b38)) [Type: winrt::Microsoft::Terminal::Remoting::Peasant] [+0x000] m_ptr : 0x0 [Type: winrt::impl::abi<winrt::Windows::Foundation::IUnknown,void>::type *] 0:000> dx -r1 (*((Microsoft_Terminal_Remoting!winrt::Microsoft::Terminal::Remoting::Monarch *)0x1e280169b30)) (*((Microsoft_Terminal_Remoting!winrt::Microsoft::Terminal::Remoting::Monarch *)0x1e280169b30)) [Type: winrt::Microsoft::Terminal::Remoting::Monarch] [+0x000] m_ptr : 0x614 [Type: winrt::impl::abi<winrt::Windows::Foundation::IUnknown,void>::type *] ``` the monarch exists, but the peasant is null, and that's just wrong. Maybe I was the murderer after all.
Author
Owner

@zadjii-msft commented on GitHub (Sep 21, 2021):

We've got an idea - if you're hitting this, can you try doing the following (in a console window, not a Terminal one)

wpr -start Terminal.wprp!Terminal.Verbose.File
{try to launch the terminal here, to repro the bug}
wpr -stop recording.etl {put a description here}

with Terminal.wprp?

That should get us the recording.etl that we can use to look through and try and diagnose what went wrong


Though, e37fd5e546..aec7392e6b doesn't seem particularly informative...

@zadjii-msft commented on GitHub (Sep 21, 2021): We've got an idea - if you're hitting this, can you try doing the following (in a console window, not a Terminal one) ``` wpr -start Terminal.wprp!Terminal.Verbose.File {try to launch the terminal here, to repro the bug} wpr -stop recording.etl {put a description here} ``` with [Terminal.wprp](https://github.com/microsoft/terminal/blob/main/src/Terminal.wprp)? That should get us the `recording.etl` that we can use to look through and try and diagnose what went wrong <hr> Though, https://github.com/microsoft/terminal/compare/e37fd5e546476bea53cabcaac236e2f05703ca85..aec7392e6b702929fcf3dac2f678a5a590fb2e4a doesn't seem particularly informative...
Author
Owner

@Sankgreall commented on GitHub (Sep 21, 2021):

We've got an idea - if you're hitting this, can you try doing the following (in a console window, not a Terminal one)

wpr -start Terminal.wprp!Terminal.Verbose.File
{try to launch the terminal here, to repro the bug}
wpr -stop recording.etl {put a description here}

with Terminal.wprp?

That should get us the recording.etl that we can use to look through and try and diagnose what went wrong

Though, e37fd5e546..aec7392e6b doesn't seem particularly informative...

Using the file you linked to, but getting the error: The <Profile> element could not be found in the profile file.

Using CMD as Administrator, with working directory set to Desktop where the Terminal.wprp file is located. Any ideas? Am I missing a requirement?

@Sankgreall commented on GitHub (Sep 21, 2021): > We've got an idea - if you're hitting this, can you try doing the following (in a console window, not a Terminal one) > > ``` > wpr -start Terminal.wprp!Terminal.Verbose.File > {try to launch the terminal here, to repro the bug} > wpr -stop recording.etl {put a description here} > ``` > > with [Terminal.wprp](https://github.com/microsoft/terminal/blob/main/src/Terminal.wprp)? > > That should get us the `recording.etl` that we can use to look through and try and diagnose what went wrong > > Though, https://github.com/microsoft/terminal/compare/e37fd5e546476bea53cabcaac236e2f05703ca85..aec7392e6b702929fcf3dac2f678a5a590fb2e4a doesn't seem particularly informative... Using the file you linked to, but getting the error: `The <Profile> element could not be found in the profile file.` Using CMD as Administrator, with working directory set to Desktop where the Terminal.wprp file is located. Any ideas? Am I missing a requirement?
Author
Owner

@miniksa commented on GitHub (Sep 21, 2021):

Using the file you linked to, but getting the error: The <Profile> element could not be found in the profile file.

Man... why does everything have to not work like it's supposed to... checking into this.

@miniksa commented on GitHub (Sep 21, 2021): > Using the file you linked to, but getting the error: `The <Profile> element could not be found in the profile file.` Man... why does everything have to not work like it's supposed to... checking into this.
Author
Owner

@zadjii-msft commented on GitHub (Sep 21, 2021):

fbd50af8af/src/Terminal.wprp (L15)

-start  [<filename.wprp>!]<profile> is either a built-in profile or a path to
                        (and name of) a user-defined custom profile.
                        The user can specify up to 64 profiles on the command line.
                        Each profile is specified as:
                        [<filename.wprp>!]<profile name>[.{light|verbose}]
                        Each profile can define both light and verbose variants or just one.
                        If neither option is specified, the verbose variant is used unless
                        the profile has only a light variant.

🤦 it's the name not the id

wpr -start Terminal.wprp!Terminal

should work

@zadjii-msft commented on GitHub (Sep 21, 2021): https://github.com/microsoft/terminal/blob/fbd50af8afb2d0bcdd7b4a252515c6d7fe729e84/src/Terminal.wprp#L15 ``` -start [<filename.wprp>!]<profile> is either a built-in profile or a path to (and name of) a user-defined custom profile. The user can specify up to 64 profiles on the command line. Each profile is specified as: [<filename.wprp>!]<profile name>[.{light|verbose}] Each profile can define both light and verbose variants or just one. If neither option is specified, the verbose variant is used unless the profile has only a light variant. ``` 🤦 it's the `name` not the `id` ``` wpr -start Terminal.wprp!Terminal ``` should work
Author
Owner

@zadjii-msft commented on GitHub (Sep 21, 2021):

wpr -start Terminal.wprp!Terminal.Verbose

from an elevated window

what's what I get for baseless conjecture 😖

@zadjii-msft commented on GitHub (Sep 21, 2021): ``` wpr -start Terminal.wprp!Terminal.Verbose ``` **from an elevated window** what's what I get for baseless conjecture 😖
Author
Owner

@miniksa commented on GitHub (Sep 21, 2021):

wpr -start Terminal.wprp!Terminal.Verbose

from an elevated window

what's what I get for baseless conjecture 😖

To be fair, when we do this on corpnet it's 1000% easier with the UI that's a pain in the butt to install from the public hardware toolkit..

@miniksa commented on GitHub (Sep 21, 2021): > ``` > wpr -start Terminal.wprp!Terminal.Verbose > ``` > > **from an elevated window** > > what's what I get for baseless conjecture 😖 To be fair, when we do this on corpnet it's 1000% easier with the UI that's a pain in the butt to install from the public hardware toolkit..
Author
Owner

@Sankgreall commented on GitHub (Sep 21, 2021):

Haha thanks guys. Ran with the !Terminal.Verbose flag. @zadjii-msft link shared to your email address, accessible on OneDrive here.

@Sankgreall commented on GitHub (Sep 21, 2021): Haha thanks guys. Ran with the `!Terminal.Verbose` flag. @zadjii-msft link shared to your email address, accessible on OneDrive [here](https://srminform-my.sharepoint.com/:u:/g/personal/j_jackson_s-rminform_com/ERjHXBo6TJBDneErP7uVG8QBq-9os-ZBUyG0L5zp2Lpz6A).
Author
Owner

@zadjii-msft commented on GitHub (Sep 21, 2021):

image

The monarch and the peasant look like they're set up correct in the trace, but, we're getting a E_INVALIDARG for... xamlRoot? That's weird. I'd think that diff-d9af234d6d might be the cause, but

  • if that's crashing, then that would crash the main thread and take the window down, not deadlock us
  • if that's only logging on failure, then that's fine and shouldn't prevent us from moving on.

The last useful message we get is

45	Microsoft.Windows.Terminal.App	TabInformation	09/21/2021 15:22:01.607	"EventVer: 	1
													                         FontFace: 	Cascadia Mono
													                         ProfileGuid: 	{61c54bbd-c2c6-5271-96e7-009a87ff44bf}
													                         ProfileSpecified: 	true
													                         SchemeName: 	Campbell
													                         TabCount: 	1
													                         TintOpacity: 	0.500000
													                         UseAcrylic: 	false"				14540	15000	5		00000000-0000-0000-0000-000000000000		

which implies that the tab should be created, and the TermControl constructed (but not necessarily initialized yet), which {checks notes} is exactly what we could have gathered from the dump 😑

@zadjii-msft commented on GitHub (Sep 21, 2021): ![image](https://user-images.githubusercontent.com/18356694/134245138-f07924a0-4628-4e7e-a29f-f25a9cb602c7.png) The monarch and the peasant look like they're set up correct in the trace, but, we're getting a `E_INVALIDARG` for... `xamlRoot`? That's weird. I'd think that [diff-d9af234d6d](https://github.com/microsoft/terminal/compare/e37fd5e546476bea53cabcaac236e2f05703ca85..aec7392e6b702929fcf3dac2f678a5a590fb2e4a#diff-d9af234d6dd21db9240dc3733d69471898a79f1c4386cb3c48ac45ab7158cd07R1035-R1051) might be the cause, but * if that's crashing, then that would crash the main thread and take the window down, not deadlock us * if that's only logging on failure, then that's fine and shouldn't prevent us from moving on. The last useful message we get is ``` 45 Microsoft.Windows.Terminal.App TabInformation 09/21/2021 15:22:01.607 "EventVer: 1 FontFace: Cascadia Mono ProfileGuid: {61c54bbd-c2c6-5271-96e7-009a87ff44bf} ProfileSpecified: true SchemeName: Campbell TabCount: 1 TintOpacity: 0.500000 UseAcrylic: false" 14540 15000 5 00000000-0000-0000-0000-000000000000 ``` which implies that the tab should be created, and the TermControl constructed (but not necessarily initialized yet), which {checks notes} is exactly what we could have gathered from the dump 😑
Author
Owner

@zadjii-msft commented on GitHub (Sep 21, 2021):

@Sankgreall How exactly are you launching the Terminal? From the Start Menu? From the Taskbar? From the Run Dialog with wt.exe? Something else? The path that the Terminal started in is... unexpected, but viable. But it sorta implies that the Terminal was launched as a default Terminal invocation for powershell.exe (in ...\Start Menu\Programs\Windows PowerShell)

@zadjii-msft commented on GitHub (Sep 21, 2021): @Sankgreall How exactly are you launching the Terminal? From the Start Menu? From the Taskbar? From the Run Dialog with `wt.exe`? Something else? The path that the Terminal started in is... unexpected, but viable. But it sorta implies that the Terminal was launched as a default Terminal invocation for `powershell.exe` (in `...\Start Menu\Programs\Windows PowerShell`)
Author
Owner

@Sankgreall commented on GitHub (Sep 21, 2021):

Hmm okay. So first of all, I can tell you exactly how I am installing the application, because this is done via a PowerShell script as part of our machine build process. Might be helpful?

# Get latest release of Windows Terminal
$release_page = "https://github.com/microsoft/terminal/releases/latest"
$page = (New-Object System.Net.WebClient).DownloadString($release_page)
$regex = "microsoft\/terminal\/releases\/download\/.*\/Microsoft\.WindowsTerminal.*\.msixbundle"
$uri_MSTerm = ($page | Select-String -Pattern $regex -All).Matches.Value | Select-Object -First 1
$uri_MSTerm = "https://github.com/$uri_MSTerm"

# Download to temp dir
$Filename_MSTerm = "Terminal.msixbundle"
$downloadpath_MSTerm = "$temp_dir\$Filename_MSTerm"
Invoke-WebRequest -Uri $uri_MSTerm -OutFile $downloadpath_MSTerm

# Install Terminal
dism /Online /Add-ProvisionedAppxPackage /PackagePath:"$temp_dir\$Filename_MSTerm" /SkipLicense

In terms of how I'm starting it, well I have defined a start menu config (refer here) and am importing this at build, excerpted below for the start menu:

<start:Tile Size="2x2" Column="0" Row="0" AppUserModelID="Microsoft.WindowsTerminal_8wekyb3d8bbwe!App" />

And the Taskbar:

<taskbar:UWA AppUserModelID="Microsoft.WindowsTerminal_8wekyb3d8bbwe!App" />

I have just tried:

  • Starting from Taskbar
  • Starting from Start Menu
  • Starting by invoking wt.exe

All result in the same error. For clarity, during testing and generation of the recording.etl file, I was starting Windows Terminal through the Taskbar.

@Sankgreall commented on GitHub (Sep 21, 2021): Hmm okay. So first of all, I can tell you exactly how I am installing the application, because this is done via a PowerShell script as part of our machine build process. Might be helpful? ``` # Get latest release of Windows Terminal $release_page = "https://github.com/microsoft/terminal/releases/latest" $page = (New-Object System.Net.WebClient).DownloadString($release_page) $regex = "microsoft\/terminal\/releases\/download\/.*\/Microsoft\.WindowsTerminal.*\.msixbundle" $uri_MSTerm = ($page | Select-String -Pattern $regex -All).Matches.Value | Select-Object -First 1 $uri_MSTerm = "https://github.com/$uri_MSTerm" # Download to temp dir $Filename_MSTerm = "Terminal.msixbundle" $downloadpath_MSTerm = "$temp_dir\$Filename_MSTerm" Invoke-WebRequest -Uri $uri_MSTerm -OutFile $downloadpath_MSTerm # Install Terminal dism /Online /Add-ProvisionedAppxPackage /PackagePath:"$temp_dir\$Filename_MSTerm" /SkipLicense ``` In terms of how I'm starting it, well I have defined a start menu config (refer [here](https://docs.microsoft.com/en-us/windows/configuration/customize-and-export-start-layout)) and am importing this at build, excerpted below for the start menu: ` <start:Tile Size="2x2" Column="0" Row="0" AppUserModelID="Microsoft.WindowsTerminal_8wekyb3d8bbwe!App" /> ` And the Taskbar: ` <taskbar:UWA AppUserModelID="Microsoft.WindowsTerminal_8wekyb3d8bbwe!App" /> ` I have just tried: - Starting from Taskbar - Starting from Start Menu - Starting by invoking wt.exe All result in the same error. For clarity, during testing and generation of the `recording.etl` file, I was starting Windows Terminal through the Taskbar.
Author
Owner

@frugecn commented on GitHub (Sep 21, 2021):

@zadjii-msft I just sent you mine. I'm also going through DISM to add the application to the machine if that helps narrow it down.

@frugecn commented on GitHub (Sep 21, 2021): @zadjii-msft I just sent you mine. I'm also going through DISM to add the application to the machine if that helps narrow it down.
Author
Owner

@Sankgreall commented on GitHub (Sep 21, 2021):

I tried creating the same Azure image and it didn't repro there either, @Sankgreall. Can you provide any additional information about the parameters you used for that Azure machine and/or screenshots of the marketplace for the options you chose?

I just ran a quick additional test on this (to rule out a conflict/issue with my build process) and created a brand new Windows 10 machine in Azure. Definitely using the Windows 10 Enterprise multi-session 2004 image. Screenshot attached to rule out any doubt.

image

After deployment, the only thing I did was deploy the app via DISM, as per my above post... And the issue was fully replicable. Went straight to grey screen. So I'm confident this is nothing to do with my build processes now at least!

@Sankgreall commented on GitHub (Sep 21, 2021): >I tried creating the same Azure image and it didn't repro there either, @Sankgreall. Can you provide any additional information about the parameters you used for that Azure machine and/or screenshots of the marketplace for the options you chose? I just ran a quick additional test on this (to rule out a conflict/issue with my build process) and created a brand new Windows 10 machine in Azure. Definitely using the Windows 10 Enterprise multi-session 2004 image. Screenshot attached to rule out any doubt. ![image](https://user-images.githubusercontent.com/53608489/134254976-25cf15aa-798a-4b7d-a9db-f28d6abe80d1.png) After deployment, the only thing I did was deploy the app via DISM, as per my [above post](https://github.com/microsoft/terminal/issues/11135#issuecomment-924397754)... And the issue was fully replicable. Went straight to grey screen. So I'm confident this is nothing to do with my build processes now at least!
Author
Owner

@miniksa commented on GitHub (Sep 21, 2021):

I tried creating the same Azure image and it didn't repro there either, @Sankgreall. Can you provide any additional information about the parameters you used for that Azure machine and/or screenshots of the marketplace for the options you chose?

I just ran a quick additional test on this (to rule out a conflict/issue with my build process) and created a brand new Windows 10 machine in Azure. Definitely using the Windows 10 Enterprise multi-session 2004 image. Screenshot attached to rule out any doubt.

image

After deployment, the only thing I did was deploy the app via DISM, as per my above post... And the issue was fully replicable. Went straight to grey screen. So I'm confident this is nothing to do with my build processes now at least!

Which configuration of the image? Given this is a locking problem, it could be a race of some sort and you're picking different tiers of hardware than I am.

It could also be the DISM thing. It is surprising @zadjii-msft and I that two of you are using DISM to install this. We will try that.

@miniksa commented on GitHub (Sep 21, 2021): > > I tried creating the same Azure image and it didn't repro there either, @Sankgreall. Can you provide any additional information about the parameters you used for that Azure machine and/or screenshots of the marketplace for the options you chose? > > I just ran a quick additional test on this (to rule out a conflict/issue with my build process) and created a brand new Windows 10 machine in Azure. Definitely using the Windows 10 Enterprise multi-session 2004 image. Screenshot attached to rule out any doubt. > > ![image](https://user-images.githubusercontent.com/53608489/134254976-25cf15aa-798a-4b7d-a9db-f28d6abe80d1.png) > > After deployment, the only thing I did was deploy the app via DISM, as per my [above post](https://github.com/microsoft/terminal/issues/11135#issuecomment-924397754)... And the issue was fully replicable. Went straight to grey screen. So I'm confident this is nothing to do with my build processes now at least! Which configuration of the image? Given this is a locking problem, it could be a race of some sort and you're picking different tiers of hardware than I am. It could also be the DISM thing. It is surprising @zadjii-msft and I that two of you are using DISM to install this. We will try that.
Author
Owner

@miniksa commented on GitHub (Sep 21, 2021):

Tried DISM on my local Server 2022 VM.... it seems the same. It's gotta be hardware or something I'm still not doing. I did DISM to add it from the administrator account... added a new user... then went and logged in as them. It was in the start menu. I clicked it, it installed, it opened fine.

@miniksa commented on GitHub (Sep 21, 2021): Tried DISM on my local Server 2022 VM.... it seems the same. It's gotta be hardware or something I'm still not doing. I did DISM to add it from the administrator account... added a new user... then went and logged in as them. It was in the start menu. I clicked it, it installed, it opened fine.
Author
Owner

@Sankgreall commented on GitHub (Sep 21, 2021):

I can't imagine it's hardware. I tested this on a Standard_D8as_v4 machine. That's 8 vCPUs and 32GiB memory. Definitely not a slow or under resourced machine. OS was also on a Premium SSD.

@Sankgreall commented on GitHub (Sep 21, 2021): I can't imagine it's hardware. I tested this on a Standard_D8as_v4 machine. That's 8 vCPUs and 32GiB memory. Definitely not a slow or under resourced machine. OS was also on a Premium SSD.
Author
Owner

@miniksa commented on GitHub (Sep 21, 2021):

Can you try something for me? Can you just download the APPX onto one of your machines, change the extension to .zip, unzip it, and double click on WindowsTerminal.exe to launch it unpackaged and see if it repros that way also? If it does, we might be able to have you collect a Time Travel trace. Of course, that might also change the timings of it and make it not repro... I'm just throwing ideas at the wall. (Time Travel doesn't work on packaged apps... that's why I ask you to see if it repro's unpackaged.)

I'm also standing up another Azure image at this moment with those HW specifications. Which region? I did South Central US.

@miniksa commented on GitHub (Sep 21, 2021): Can you try something for me? Can you just download the APPX onto one of your machines, change the extension to .zip, unzip it, and double click on WindowsTerminal.exe to launch it unpackaged and see if it repros that way also? If it does, we might be able to have you collect a [Time Travel](https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/time-travel-debugging-record) trace. Of course, that might also change the timings of it and make it not repro... I'm just throwing ideas at the wall. (Time Travel doesn't work on packaged apps... that's why I ask you to see if it repro's unpackaged.) I'm also standing up another Azure image at this moment with those HW specifications. Which region? I did South Central US.
Author
Owner

@Sankgreall commented on GitHub (Sep 21, 2021):

Okay will give this a go.

UK South region.

@Sankgreall commented on GitHub (Sep 21, 2021): Okay will give this a go. UK South region.
Author
Owner

@Sankgreall commented on GitHub (Sep 22, 2021):

The issue reproduces using the method you mentioned.

For clarity, just to ensure I did this correctly, I:

  • Downloaded the latest MSIX bundle release
  • Opened the archive, and extracted the x64 MSIX package
  • Opened the MSIX package and extracted the files to a folder
  • Executed WindowsTerminal.exe
@Sankgreall commented on GitHub (Sep 22, 2021): The issue reproduces using the method you mentioned. For clarity, just to ensure I did this correctly, I: - Downloaded the [latest MSIX bundle release](https://github.com/microsoft/terminal/releases/download/v1.10.2383.0/Microsoft.WindowsTerminal_1.10.2383.0_8wekyb3d8bbwe.msixbundle) - Opened the archive, and extracted the x64 MSIX package - Opened the MSIX package and extracted the files to a folder - Executed WindowsTerminal.exe
Author
Owner

@frugecn commented on GitHub (Sep 22, 2021):

same result. I extracted both the msixbundle and the Windows10_PreinstallKit with the same results.

@frugecn commented on GitHub (Sep 22, 2021): same result. I extracted both the msixbundle and the Windows10_PreinstallKit with the same results.
Author
Owner

@miniksa commented on GitHub (Sep 22, 2021):

Oooh. That cuts quite a few things out. Thank you! Then it's not the DISM stack or installing-to-a-new-user or user vs machine install or the modern frameworks or anything.

If either of you have time/capability/patience to install WinDbg Preview and attempt to capture the Time Travel Trace and get it to me... I might be able to just have the whole capture/playback of what's going wrong.

I am still furiously trying to reproduce around here too with various hardware and config flags flipped all over the place.

South Central US didn't repro for me... but I did D8s_v4 not D8as_v4. Starting in UK South now.

@miniksa commented on GitHub (Sep 22, 2021): Oooh. That cuts quite a few things out. Thank you! Then it's not the DISM stack or installing-to-a-new-user or user vs machine install or the modern frameworks or anything. If either of you have time/capability/patience to install [WinDbg Preview](https://docs.microsoft.com/windows-hardware/drivers/debugger/windbg-install-preview) and attempt to capture the [Time Travel Trace](https://docs.microsoft.com/windows-hardware/drivers/debugger/time-travel-debugging-record) and get it to me... I might be able to just have the whole capture/playback of what's going wrong. I am still furiously trying to reproduce around here too with various hardware and config flags flipped all over the place. South Central US didn't repro for me... but I did D8s_v4 not D8as_v4. Starting in UK South now.
Author
Owner

@Sankgreall commented on GitHub (Sep 22, 2021):

Just doing the trace now. Have I got it right that I can just exit the trace after the application has hung? I get a .out file and a .idx file. Do you need them both?

@Sankgreall commented on GitHub (Sep 22, 2021): Just doing the trace now. Have I got it right that I can just exit the trace after the application has hung? I get a `.out` file and a `.idx` file. Do you need them both?
Author
Owner

@miniksa commented on GitHub (Sep 22, 2021):

Yes you can exit after it's hung. Yes I need both of the files. Yes they're usually huge. Yes I'm sorry.

@miniksa commented on GitHub (Sep 22, 2021): Yes you can exit after it's hung. Yes I need both of the files. Yes they're usually huge. Yes I'm sorry.
Author
Owner

@Sankgreall commented on GitHub (Sep 22, 2021):

Do you have an email address so I can share a OneDrive link?

@Sankgreall commented on GitHub (Sep 22, 2021): Do you have an email address so I can share a OneDrive link?
Author
Owner

@miniksa commented on GitHub (Sep 22, 2021):

My GH name at the usual suspect corporate domain.

@miniksa commented on GitHub (Sep 22, 2021): My GH name at the usual suspect corporate domain.
Author
Owner

@Sankgreall commented on GitHub (Sep 22, 2021):

Hosted here.

I will note that one of my debug sessions actually spun up the Terminal correctly. I just wasn't thinking and deleted it, but this is also expected behaviour as others have noted if you kill the process manually and start a new console, it sometimes appears to work and bypasses this issue.

@Sankgreall commented on GitHub (Sep 22, 2021): Hosted [here](https://srminform-my.sharepoint.com/:u:/g/personal/j_jackson_s-rminform_com/EWbidP8zdTRMqnEIJuFv0D0BkoGvk7KI8649m2wNBdee7Q?email=miniksa%40microsoft.com&e=ScuFl8). I will note that one of my debug sessions actually spun up the Terminal correctly. I just wasn't thinking and deleted it, but this is also expected behaviour as others have noted if you kill the process manually and start a new console, it sometimes appears to work and bypasses this issue.
Author
Owner

@miniksa commented on GitHub (Sep 22, 2021):

Sounds super race condition-y to me. I hope this trace is insightful. Opening now.

@miniksa commented on GitHub (Sep 22, 2021): Sounds super race condition-y to me. I hope this trace is insightful. Opening now.
Author
Owner

@miniksa commented on GitHub (Sep 22, 2021):

Oh my goodness. There is an exception thrown on a thread inside of this trace. We might be onto something! Digging!

@miniksa commented on GitHub (Sep 22, 2021): Oh my goodness. There is an exception thrown on a thread inside of this trace. We might be onto something! Digging!
Author
Owner

@miniksa commented on GitHub (Sep 22, 2021):

This is going to sound really weird. Do you have a touchscreen?

@miniksa commented on GitHub (Sep 22, 2021): This is going to sound really weird. Do you have a touchscreen?
Author
Owner

@Sankgreall commented on GitHub (Sep 22, 2021):

Well. Technically yes? The machines we install Windows Terminal on get shipped out to users with Surface Laptops, which have touch screens. I am running a Dell XPS, which also has touchscreen. The touchscreen functionality is not used for any business processes, however... If that makes sense?

@Sankgreall commented on GitHub (Sep 22, 2021): Well. Technically yes? The machines we install Windows Terminal on get shipped out to users with Surface Laptops, which have touch screens. I am running a Dell XPS, which also has touchscreen. The touchscreen functionality is not used for any business processes, however... If that makes sense?
Author
Owner

@miniksa commented on GitHub (Sep 22, 2021):

An access violation happens (0xC0000005) as we attempt to get the position of the cursor in ScreenInfoUiaProviderBase::GetSelection in response to a query right as we're starting up.

Partial stack of throwing callsite
0:000> k
 # Child-SP          RetAddr               Call Site
00 (Inline Function) --------`--------     Microsoft_Terminal_Control!Cursor::GetPosition [C:\a\_work\1\s\src\buffer\out\cursor.cpp @ 42] 
01 000000f0`c2d0e7a0 00007ffc`b1473643     Microsoft_Terminal_Control!Microsoft::Console::Types::UiaTextRangeBase::RuntimeClassInitialize+0x5c [C:\a\_work\1\s\src\types\UiaTextRangeBase.cpp @ 47] 
02 (Inline Function) --------`--------     Microsoft_Terminal_Control!Microsoft::Terminal::TermControlUiaTextRange::RuntimeClassInitialize+0x25 [C:\a\_work\1\s\src\types\TermControlUiaTextRange.cpp @ 23] 
03 000000f0`c2d0e7f0 00007ffc`b147378f     Microsoft_Terminal_Control!Microsoft::WRL::Details::MakeAndInitialize<Microsoft::Terminal::TermControlUiaTextRange,Microsoft::Terminal::TermControlUiaTextRange,Microsoft::Console::Types::IUiaData * &,IRawElementProviderSimple * const &,Cursor const &,std::basic_string_view<wchar_t,std::char_traits<wchar_t> > const &>+0xcf [C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\winrt\wrl\implements.h @ 2478] 
04 000000f0`c2d0e860 00007ffc`b14725a9     Microsoft_Terminal_Control!Microsoft::Terminal::TermControlUiaProvider::CreateTextRange+0x6f [C:\a\_work\1\s\src\types\TermControlUiaProvider.cpp @ 155] 
05 000000f0`c2d0e8d0 00007ffc`b1461b2e     Microsoft_Terminal_Control!Microsoft::Console::Types::ScreenInfoUiaProviderBase::GetSelection+0x139 [C:\a\_work\1\s\src\types\ScreenInfoUiaProviderBase.cpp @ 245] 
06 000000f0`c2d0e970 00007ffc`b1461a7b     Microsoft_Terminal_Control!winrt::Microsoft::Terminal::Control::implementation::TermControlAutomationPeer::GetSelection+0x3e [C:\a\_work\1\s\src\cascadia\TerminalControl\TermControlAutomationPeer.cpp @ 171] 
07 000000f0`c2d0e9b0 00007ffc`c1d3988a     Microsoft_Terminal_Control!winrt::impl::produce<winrt::Microsoft::Terminal::Control::implementation::TermControlAutomationPeer,winrt::Windows::UI::Xaml::Automation::Provider::ITextProvider>::GetSelection+0x2b [C:\a\_work\1\s\src\cascadia\TerminalControl\Generated Files\winrt\Windows.UI.Xaml.Automation.Provider.h @ 1470] 

aec7392e6b/src/types/ScreenInfoUiaProviderBase.cpp (L243)

_getTextBuffer() yields nullptr as it's not set up yet, the GetCursor() method resolves to +0x20 from that location and we try to read the cursor information out of 0x0000000000000020 which is completely wrong and the access violation is thrown.

The tablet input service (the soft keyboard that shows up on touch screens... also known as tabtip.exe) is making a query of the Terminal through the UIA framework while it's still loading. Before it even loaded that text buffer and got it ready.

But the tablet input service is being sneaky. They know they're calling other people's code and that it could contain bugs. So they registered a Structured Exception Handler to catch anything that could go wrong. Up to and including an access violation that would normally crash the application. The C++ Frame Handler we had installed will not catch an access violation... but an SEH one will!

Time Travel Position: 11C7B0:328 [Unindexed] Index
tiptsf!`CImmersiveFocusTracker::HandleAutomationEvent'::`1'::filt$0:
00007ffc`bcd70e08 4055            push    rbp

The touch screen keyboard handler then just marks the call as failed and gives up. But it ends that whole thread right where it stood... and doesn't let our unlock call go off in the scope exit.

aec7392e6b/src/types/ScreenInfoUiaProviderBase.cpp (L221-L244)

Then when the rest of the Terminal is given a chance to load... (see https://github.com/microsoft/terminal/issues/11135#issuecomment-924073186 in the main thread)... it tries to take the lock to set things up. But the SEH-killed thread from the tiptsf never let it go. So it's deadlocked.

In short, it's an easy repro. Run tabtip.exe or right click the task bar to bring up the touch/tablet keyboard and then start the Terminal with that open. Or use a touch screen where it's already open all the time. That's what got us. We don't have touchscreens on our dev boxes. :(

So the culprit is https://github.com/microsoft/terminal/pull/10971 (and 1.10 backport https://github.com/microsoft/terminal/pull/11042) because it allows queries from the UIA before everything is ready.

Now our team will debate whether that fix is appropriate and we should revert it... whether we should patch up this particular call site and/or audit the others from tabtip.exe to see if we can guard against this circumstance... and whether we should maybe install our own SEH handler to make sure that locks get unlocked from the UIA context if everything goes sideways before someone kills the thread on us (LOOKING AT YOU tiptsf.dll!)

Thank you so much for working with us today and helping us track this down. This looks like it is going to be a big deal and a big priority for us to service. I have to head home for this evening and @zadjii-msft is already off for today, but we'll cycle through with @carlos-zamora and @DHowett in the morning and start cranking on fixes and working out our servicing story. So much appreciated that you went above and beyond in providing us all the logging, diagnostics, and tracing we could possibly need today. You're awesome!

@miniksa commented on GitHub (Sep 22, 2021): An access violation happens (`0xC0000005`) as we attempt to get the position of the cursor in `ScreenInfoUiaProviderBase::GetSelection` in response to a query right as we're starting up. <details> <summary>Partial stack of throwing callsite</summary> ``` 0:000> k # Child-SP RetAddr Call Site 00 (Inline Function) --------`-------- Microsoft_Terminal_Control!Cursor::GetPosition [C:\a\_work\1\s\src\buffer\out\cursor.cpp @ 42] 01 000000f0`c2d0e7a0 00007ffc`b1473643 Microsoft_Terminal_Control!Microsoft::Console::Types::UiaTextRangeBase::RuntimeClassInitialize+0x5c [C:\a\_work\1\s\src\types\UiaTextRangeBase.cpp @ 47] 02 (Inline Function) --------`-------- Microsoft_Terminal_Control!Microsoft::Terminal::TermControlUiaTextRange::RuntimeClassInitialize+0x25 [C:\a\_work\1\s\src\types\TermControlUiaTextRange.cpp @ 23] 03 000000f0`c2d0e7f0 00007ffc`b147378f Microsoft_Terminal_Control!Microsoft::WRL::Details::MakeAndInitialize<Microsoft::Terminal::TermControlUiaTextRange,Microsoft::Terminal::TermControlUiaTextRange,Microsoft::Console::Types::IUiaData * &,IRawElementProviderSimple * const &,Cursor const &,std::basic_string_view<wchar_t,std::char_traits<wchar_t> > const &>+0xcf [C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\winrt\wrl\implements.h @ 2478] 04 000000f0`c2d0e860 00007ffc`b14725a9 Microsoft_Terminal_Control!Microsoft::Terminal::TermControlUiaProvider::CreateTextRange+0x6f [C:\a\_work\1\s\src\types\TermControlUiaProvider.cpp @ 155] 05 000000f0`c2d0e8d0 00007ffc`b1461b2e Microsoft_Terminal_Control!Microsoft::Console::Types::ScreenInfoUiaProviderBase::GetSelection+0x139 [C:\a\_work\1\s\src\types\ScreenInfoUiaProviderBase.cpp @ 245] 06 000000f0`c2d0e970 00007ffc`b1461a7b Microsoft_Terminal_Control!winrt::Microsoft::Terminal::Control::implementation::TermControlAutomationPeer::GetSelection+0x3e [C:\a\_work\1\s\src\cascadia\TerminalControl\TermControlAutomationPeer.cpp @ 171] 07 000000f0`c2d0e9b0 00007ffc`c1d3988a Microsoft_Terminal_Control!winrt::impl::produce<winrt::Microsoft::Terminal::Control::implementation::TermControlAutomationPeer,winrt::Windows::UI::Xaml::Automation::Provider::ITextProvider>::GetSelection+0x2b [C:\a\_work\1\s\src\cascadia\TerminalControl\Generated Files\winrt\Windows.UI.Xaml.Automation.Provider.h @ 1470] ``` </details> https://github.com/microsoft/terminal/blob/aec7392e6b702929fcf3dac2f678a5a590fb2e4a/src/types/ScreenInfoUiaProviderBase.cpp#L243 `_getTextBuffer()` yields `nullptr` as it's not set up yet, the `GetCursor()` method resolves to `+0x20` from that location and we try to read the cursor information out of `0x0000000000000020` which is completely wrong and the access violation is thrown. The tablet input service (the soft keyboard that shows up on touch screens... also known as `tabtip.exe`) is making a query of the Terminal through the UIA framework while it's still loading. Before it even loaded that text buffer and got it ready. But the tablet input service is being sneaky. They know they're calling other people's code and that it could contain bugs. So they registered a [Structured Exception Handler](https://docs.microsoft.com/cpp/cpp/structured-exception-handling-c-cpp?view=msvc-160) to catch anything that could go wrong. Up to and including an access violation that would normally crash the application. The [C++ Frame Handler](https://docs.microsoft.com/cpp/c-runtime-library/cxxframehandler?view=msvc-160) we had installed will not catch an access violation... but an SEH one will! ``` Time Travel Position: 11C7B0:328 [Unindexed] Index tiptsf!`CImmersiveFocusTracker::HandleAutomationEvent'::`1'::filt$0: 00007ffc`bcd70e08 4055 push rbp ``` The touch screen keyboard handler then just marks the call as failed and gives up. But it ends that whole thread right where it stood... and doesn't let our unlock call go off in the scope exit. https://github.com/microsoft/terminal/blob/aec7392e6b702929fcf3dac2f678a5a590fb2e4a/src/types/ScreenInfoUiaProviderBase.cpp#L221-L244 Then when the rest of the Terminal is given a chance to load... (see https://github.com/microsoft/terminal/issues/11135#issuecomment-924073186 in the main thread)... it tries to take the lock to set things up. But the SEH-killed thread from the `tiptsf` never let it go. So it's deadlocked. In short, it's an easy repro. Run `tabtip.exe` or right click the task bar to bring up the touch/tablet keyboard and then start the Terminal with that open. Or use a touch screen where it's already open all the time. That's what got us. We don't have touchscreens on our dev boxes. :( So the culprit is https://github.com/microsoft/terminal/pull/10971 (and 1.10 backport https://github.com/microsoft/terminal/pull/11042) because it allows queries from the UIA before everything is ready. Now our team will debate whether that fix is appropriate and we should revert it... whether we should patch up this particular call site and/or audit the others from `tabtip.exe` to see if we can guard against this circumstance... and whether we should maybe install our own SEH handler to make sure that locks get unlocked from the UIA context if everything goes sideways before someone kills the thread on us (LOOKING AT YOU `tiptsf.dll`!) Thank you so much for working with us today and helping us track this down. This looks like it is going to be a big deal and a big priority for us to service. I have to head home for this evening and @zadjii-msft is already off for today, but we'll cycle through with @carlos-zamora and @DHowett in the morning and start cranking on fixes and working out our servicing story. So much appreciated that you went above and beyond in providing us all the logging, diagnostics, and tracing we could possibly need today. You're awesome!
Author
Owner

@Sankgreall commented on GitHub (Sep 22, 2021):

Ah amazing. Very happy I could help, and also want to say thank you and the rest of the team for servicing such an incredible application that we use literally every single day. Your effort is really appreciated!

@Sankgreall commented on GitHub (Sep 22, 2021): Ah amazing. Very happy I could help, and also want to say thank you and the rest of the team for servicing such an incredible application that we use literally every single day. Your effort is really appreciated!
Author
Owner

@miniksa commented on GitHub (Sep 22, 2021):

OK here's the plan:

We're going to prepare two fixes:

  1. We're going to prepare the quick fix by guarding the nullptr dereference callsites just inside the UIA provider's public methods so if something makes a query early in the process, we should detect that the structure is empty and can answer "sorry, nothing selected" nicely (and the like) instead of having the crash.
Here's the structure output to make it easier to see which members need guarding:
0:000> dx -r1 ((Microsoft_Terminal_Control!Microsoft::Console::Types::IUiaData *)0x233fc65cfb8)
((Microsoft_Terminal_Control!Microsoft::Console::Types::IUiaData *)0x233fc65cfb8)                 : 0x233fc65cfa0 [Type: Microsoft::Terminal::Core::Terminal * (derived from Microsoft::Console::Types::IUiaData *)]
    [+0x020] _pfnWriteInput   : empty [Type: std::function<void __cdecl(std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > &)>]
    [+0x060] _pfnWarningBell  : empty [Type: std::function<void __cdecl(void)>]
    [+0x0a0] _pfnTitleChanged : empty [Type: std::function<void __cdecl(std::basic_string_view<wchar_t,std::char_traits<wchar_t> >)>]
    [+0x0e0] _pfnCopyToClipboard : empty [Type: std::function<void __cdecl(std::basic_string_view<wchar_t,std::char_traits<wchar_t> >)>]
    [+0x120] _pfnScrollPositionChanged : empty [Type: std::function<void __cdecl(int,int,int)>]
    [+0x160] _pfnBackgroundColorChanged : empty [Type: std::function<void __cdecl(til::color)>]
    [+0x1a0] _pfnCursorPositionChanged : empty [Type: std::function<void __cdecl(void)>]
    [+0x1e0] _pfnTabColorChanged : empty [Type: std::function<void __cdecl(std::optional<til::color>)>]
    [+0x220] _pfnTaskbarProgressChanged : empty [Type: std::function<void __cdecl(void)>]
    [+0x260] _stateMachine    : empty [Type: std::unique_ptr<Microsoft::Console::VirtualTerminal::StateMachine,std::default_delete<Microsoft::Console::VirtualTerminal::StateMachine> >]
    [+0x268] _terminalInput   : empty [Type: std::unique_ptr<Microsoft::Console::VirtualTerminal::TerminalInput,std::default_delete<Microsoft::Console::VirtualTerminal::TerminalInput> >]
    [+0x270] _title           : nullopt [Type: std::optional<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > >]
    [+0x298] _startingTitle   : "" [Type: std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >]
    [+0x2b8] _tabColor        : nullopt [Type: std::optional<til::color>]
    [+0x2c0] _startingTabColor : nullopt [Type: std::optional<til::color>]
    [+0x2c8] _colorTable      : { size=256 } [Type: std::array<unsigned long,256>]
    [+0x6c8] _defaultFg       : {RGB: 0, 0, 0; α: 0} [Type: til::color]
    [+0x6cc] _defaultBg       : {RGB: 0, 0, 0; α: 0} [Type: til::color]
    [+0x6d0] _defaultCursorShape : Legacy (0x0) [Type: CursorType]
    [+0x6d4] _screenReversed  : false [Type: bool]
    [+0x6d8] _blinkingState   [Type: Microsoft::Console::Render::BlinkingState]
    [+0x6f0] _snapOnInput     : false [Type: bool]
    [+0x6f1] _altGrAliasing   : false [Type: bool]
    [+0x6f2] _suppressApplicationTitle : false [Type: bool]
    [+0x6f3] _bracketedPasteMode : false [Type: bool]
    [+0x6f4] _trimBlockSelection : false [Type: bool]
    [+0x6f5] _intenseIsBright : false [Type: bool]
    [+0x6f8] _taskbarState    : 0x0 [Type: unsigned __int64]
    [+0x700] _taskbarProgress : 0x0 [Type: unsigned __int64]
    [+0x708] _hyperlinkPatternId : 0x0 [Type: unsigned __int64]
    [+0x710] _workingDirectory : "" [Type: std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >]
    [+0x730] _fontInfo        [Type: FontInfo]
    [+0x770] _selection       : nullopt [Type: std::optional<Microsoft::Terminal::Core::Terminal::SelectionAnchors>]
    [+0x77e] _blockSelection  : false [Type: bool]
    [+0x780] _wordDelimiters  : "" [Type: std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >]
    [+0x7a0] _multiClickSelectionMode : Cell (0) [Type: Microsoft::Terminal::Core::Terminal::SelectionExpansionMode]
    [+0x7a8] _readWriteLock   [Type: std::shared_mutex]
    [+0x7b0] _buffer          [Type: std::unique_ptr<TextBuffer,std::default_delete<TextBuffer> >]
    [+0x7b8] _mutableViewport : {LT(0, 0) RB(-1, -1) [0 x 0]} [Type: Microsoft::Console::Types::Viewport]
    [+0x7c0] _scrollbackLines : 0 [Type: short]
    [+0x7c4] _scrollOffset    : 0 [Type: int]
    [+0x7c8] _patternIntervalTree [Type: interval_tree::IntervalTree<til::point,unsigned __int64>]
    [+0x800] _lastKeyEventCodes : nullopt [Type: std::optional<Microsoft::Terminal::Core::Terminal::KeyEventCodes>]
    [+0x808] _sgrStack        [Type: Microsoft::Console::VirtualTerminal::SgrStack]
The quick fix will enable us to resolve the specific issue with touch keyboards and `tabtip.exe` relatively quickly. We should be able to turn it around and deploy it in the few days.
  1. We're going to prepare a more comprehensive fix. This will take us potentially a week or two and might not be as easily serviceable to 1.10 or 1.11 and instead come in 1.12.
  • In addition to guarding the nullptr dereferencing locations into the public UIA methods, we want to...
  • Ensure we have unit or feature tests that run in our PR automation that will exercise the entire Terminal UIA provider surface from the early empty initialization state before everything comes up. I believe we have them for the "ready" state but not this new empty initialization state.
  • Ensure that we have TraceLogging applied to every public UIA method so we can have people collect comprehensive logs of how they're being called in the trace files like I asked you to collect. We think we already have the provider setup, but that we fumbled at loading it into the Terminal.wprp file. So we'll get that fixed.
  • Consider creating and applying a TraceLogging provider to the Terminal lock call sites so we can easily see the "Waiting", "Taken", and "Released" states interleaved with the other trace logging output. It should be on its own provider so we can easily exclude it (as it's probably going to be a perf hog and could affect timings for other tracing scenarios). Also it should be in the Terminal.wprp file... either in the existing session or in a new TerminalLocks session or something. (The specifics of this are to put it on terminalrenderdata.cpp!Terminal::LockConsole(), terminalrenderdata.cpp!Terminal::UnlockConsole(), terminal.cpp!Terminal::LockForReading(), and terminal.cpp!Terminal.LockForWriting().)

And then when we're done, we'll hold ourselves to doing a "Root Cause Analysis" to reflect on what went wrong, how we can correct it beyond this, how we can discover things like this faster, and how we can prevent issues like this in the future. Some of what we've slated for the comprehensive fix is already a part of satisfying the "how we can prevent this" and "how we can discover this faster", but we would like to be accountable for this issue.

@miniksa commented on GitHub (Sep 22, 2021): OK here's the plan: We're going to prepare two fixes: 1. We're going to prepare the quick fix by guarding the nullptr dereference callsites just inside the UIA provider's public methods so if something makes a query early in the process, we should detect that the structure is empty and can answer "sorry, nothing selected" nicely (and the like) instead of having the crash. <details> <summary> Here's the structure output to make it easier to see which members need guarding: </summary> ``` 0:000> dx -r1 ((Microsoft_Terminal_Control!Microsoft::Console::Types::IUiaData *)0x233fc65cfb8) ((Microsoft_Terminal_Control!Microsoft::Console::Types::IUiaData *)0x233fc65cfb8) : 0x233fc65cfa0 [Type: Microsoft::Terminal::Core::Terminal * (derived from Microsoft::Console::Types::IUiaData *)] [+0x020] _pfnWriteInput : empty [Type: std::function<void __cdecl(std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > &)>] [+0x060] _pfnWarningBell : empty [Type: std::function<void __cdecl(void)>] [+0x0a0] _pfnTitleChanged : empty [Type: std::function<void __cdecl(std::basic_string_view<wchar_t,std::char_traits<wchar_t> >)>] [+0x0e0] _pfnCopyToClipboard : empty [Type: std::function<void __cdecl(std::basic_string_view<wchar_t,std::char_traits<wchar_t> >)>] [+0x120] _pfnScrollPositionChanged : empty [Type: std::function<void __cdecl(int,int,int)>] [+0x160] _pfnBackgroundColorChanged : empty [Type: std::function<void __cdecl(til::color)>] [+0x1a0] _pfnCursorPositionChanged : empty [Type: std::function<void __cdecl(void)>] [+0x1e0] _pfnTabColorChanged : empty [Type: std::function<void __cdecl(std::optional<til::color>)>] [+0x220] _pfnTaskbarProgressChanged : empty [Type: std::function<void __cdecl(void)>] [+0x260] _stateMachine : empty [Type: std::unique_ptr<Microsoft::Console::VirtualTerminal::StateMachine,std::default_delete<Microsoft::Console::VirtualTerminal::StateMachine> >] [+0x268] _terminalInput : empty [Type: std::unique_ptr<Microsoft::Console::VirtualTerminal::TerminalInput,std::default_delete<Microsoft::Console::VirtualTerminal::TerminalInput> >] [+0x270] _title : nullopt [Type: std::optional<std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > >] [+0x298] _startingTitle : "" [Type: std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >] [+0x2b8] _tabColor : nullopt [Type: std::optional<til::color>] [+0x2c0] _startingTabColor : nullopt [Type: std::optional<til::color>] [+0x2c8] _colorTable : { size=256 } [Type: std::array<unsigned long,256>] [+0x6c8] _defaultFg : {RGB: 0, 0, 0; α: 0} [Type: til::color] [+0x6cc] _defaultBg : {RGB: 0, 0, 0; α: 0} [Type: til::color] [+0x6d0] _defaultCursorShape : Legacy (0x0) [Type: CursorType] [+0x6d4] _screenReversed : false [Type: bool] [+0x6d8] _blinkingState [Type: Microsoft::Console::Render::BlinkingState] [+0x6f0] _snapOnInput : false [Type: bool] [+0x6f1] _altGrAliasing : false [Type: bool] [+0x6f2] _suppressApplicationTitle : false [Type: bool] [+0x6f3] _bracketedPasteMode : false [Type: bool] [+0x6f4] _trimBlockSelection : false [Type: bool] [+0x6f5] _intenseIsBright : false [Type: bool] [+0x6f8] _taskbarState : 0x0 [Type: unsigned __int64] [+0x700] _taskbarProgress : 0x0 [Type: unsigned __int64] [+0x708] _hyperlinkPatternId : 0x0 [Type: unsigned __int64] [+0x710] _workingDirectory : "" [Type: std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >] [+0x730] _fontInfo [Type: FontInfo] [+0x770] _selection : nullopt [Type: std::optional<Microsoft::Terminal::Core::Terminal::SelectionAnchors>] [+0x77e] _blockSelection : false [Type: bool] [+0x780] _wordDelimiters : "" [Type: std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >] [+0x7a0] _multiClickSelectionMode : Cell (0) [Type: Microsoft::Terminal::Core::Terminal::SelectionExpansionMode] [+0x7a8] _readWriteLock [Type: std::shared_mutex] [+0x7b0] _buffer [Type: std::unique_ptr<TextBuffer,std::default_delete<TextBuffer> >] [+0x7b8] _mutableViewport : {LT(0, 0) RB(-1, -1) [0 x 0]} [Type: Microsoft::Console::Types::Viewport] [+0x7c0] _scrollbackLines : 0 [Type: short] [+0x7c4] _scrollOffset : 0 [Type: int] [+0x7c8] _patternIntervalTree [Type: interval_tree::IntervalTree<til::point,unsigned __int64>] [+0x800] _lastKeyEventCodes : nullopt [Type: std::optional<Microsoft::Terminal::Core::Terminal::KeyEventCodes>] [+0x808] _sgrStack [Type: Microsoft::Console::VirtualTerminal::SgrStack] ``` </details> The quick fix will enable us to resolve the specific issue with touch keyboards and `tabtip.exe` relatively quickly. We should be able to turn it around and deploy it in the few days. 2. We're going to prepare a more comprehensive fix. This will take us potentially a week or two and might not be as easily serviceable to 1.10 or 1.11 and instead come in 1.12. - In addition to guarding the `nullptr` dereferencing locations into the public UIA methods, we want to... - Ensure we have unit or feature tests that run in our PR automation that will exercise the entire Terminal UIA provider surface from the early empty initialization state before everything comes up. I believe we have them for the "ready" state but not this new empty initialization state. - Ensure that we have TraceLogging applied to every public UIA method so we can have people collect comprehensive logs of how they're being called in the trace files like I asked you to collect. We think we already have the provider setup, but that we fumbled at loading it into the `Terminal.wprp` file. So we'll get that fixed. - Consider creating and applying a TraceLogging provider to the Terminal lock call sites so we can easily see the "Waiting", "Taken", and "Released" states interleaved with the other trace logging output. It should be on its own provider so we can easily exclude it (as it's probably going to be a perf hog and could affect timings for other tracing scenarios). Also it should be in the `Terminal.wprp` file... either in the existing session or in a new `TerminalLocks` session or something. (The specifics of this are to put it on `terminalrenderdata.cpp!Terminal::LockConsole()`, `terminalrenderdata.cpp!Terminal::UnlockConsole()`, `terminal.cpp!Terminal::LockForReading()`, and `terminal.cpp!Terminal.LockForWriting()`.) And then when we're done, we'll hold ourselves to doing a "Root Cause Analysis" to reflect on what went wrong, how we can correct it beyond this, how we can discover things like this faster, and how we can prevent issues like this in the future. Some of what we've slated for the comprehensive fix is already a part of satisfying the "how we can prevent this" and "how we can discover this faster", but we would like to be accountable for this issue.
Author
Owner

@wkbrd commented on GitHub (Sep 22, 2021):

Great to hear the progress you are all making. Once a patch is available I could try it in my Windows Server 2022 environment. Thanks!

@wkbrd commented on GitHub (Sep 22, 2021): Great to hear the progress you are all making. Once a patch is available I could try it in my Windows Server 2022 environment. Thanks!
Author
Owner

@wkbrd commented on GitHub (Sep 22, 2021):

FYI, it appears that a workaround for my scenario on Windows Server 2022 is to kill the TabTip.exe process using Task Manager before attempting to use Windows Terminal.

@wkbrd commented on GitHub (Sep 22, 2021): FYI, it appears that a workaround for my scenario on Windows Server 2022 is to kill the TabTip.exe process using Task Manager before attempting to use Windows Terminal.
Author
Owner

@miniksa commented on GitHub (Sep 24, 2021):

Alright folks, I'll be preparing servicing builds for this fix early next week (mostly because preparing and launching something on Friday feels like a bad idea.) Thanks again for your help and it should be in your hands soon!

@miniksa commented on GitHub (Sep 24, 2021): Alright folks, I'll be preparing servicing builds for this fix early next week (mostly because preparing and launching something on Friday feels like a bad idea.) Thanks again for your help and it should be in your hands soon!
Author
Owner

@Falco20019 commented on GitHub (Oct 4, 2021):

@miniksa Any timeline for when this will land in release (or a hint on how I can use the servicing build)?

@Falco20019 commented on GitHub (Oct 4, 2021): @miniksa Any timeline for when this will land in release (or a hint on how I can use the servicing build)?
Author
Owner

@miniksa commented on GitHub (Oct 4, 2021):

@miniksa Any timeline for when this will land in release (or a hint on how I can use the servicing build)?

It's rolling out now! It was sent to some inside rings on Friday and it's rolling out to the remaining rings today to be ready for the Windows launch date tomorrow. I'll have patch notes and the releases up by end of day today. And hopefully the winget manifests too.

Sorry, I'm a little behind schedule juggling things. @DHowett is out on vacation so I'm pretending to be him and I'm not as good a juggler!

@miniksa commented on GitHub (Oct 4, 2021): > @miniksa Any timeline for when this will land in release (or a hint on how I can use the servicing build)? It's rolling out now! It was sent to some inside rings on Friday and it's rolling out to the remaining rings today to be ready for the Windows launch date tomorrow. I'll have patch notes and the releases up by end of day today. And hopefully the winget manifests too. Sorry, I'm a little behind schedule juggling things. @DHowett is out on vacation so I'm pretending to be him and I'm not as good a juggler!
Author
Owner

@ghost commented on GitHub (Oct 4, 2021):

:tada:This issue was addressed in #11312, which has now been successfully released as Windows Terminal v1.10.2714.0.🎉

Handy links:

@ghost commented on GitHub (Oct 4, 2021): :tada:This issue was addressed in #11312, which has now been successfully released as `Windows Terminal v1.10.2714.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.10.2714.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (Oct 4, 2021):

:tada:This issue was addressed in #11312, which has now been successfully released as Windows Terminal Preview v1.11.2731.0.🎉

Handy links:

@ghost commented on GitHub (Oct 4, 2021): :tada:This issue was addressed in #11312, which has now been successfully released as `Windows Terminal Preview v1.11.2731.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.11.2731.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (Oct 20, 2021):

:tada:This issue was addressed in #11312, which has now been successfully released as Windows Terminal Preview v1.12.2922.0.🎉

Handy links:

@ghost commented on GitHub (Oct 20, 2021): :tada:This issue was addressed in #11312, which has now been successfully released as `Windows Terminal Preview v1.12.2922.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.12.2922.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#15075