Killing DWM hangs the Terminal on 22000 #16896

Closed
opened 2026-01-31 05:26:32 +00:00 by claunia · 10 comments
Owner

Originally created by @zadjii-msft on GitHub (Feb 28, 2022).

This is likely due to the renderer refactor for atlas engine.

Repro is fairly consistent:

taskkill /f /im dwm.exe

from an elevated Terminal.

  • weird thing 1: If you're using the Atlas engine, you'll get a ContentDialog with an Unspecified Error from the renderer. This isn't the normal per-control warning, this is the window-level dialog. The renderer keeps chooching along though...?
  • crash 2: while outputting text with the DxEngine, the whole terminal will crash.
Stack
 178  Id: 4d78.cf0c Suspend: 1 Teb: 00000051`5195a000 Unfrozen "Rendering Output Thread"
 # Child-SP          RetAddr               Call Site
00 00000051`524fda90 00007ff8`81998879     KERNELBASE!RaiseFailFastException+0x152 [minkernel\kernelbase\xcpt.c @ 1198] 
01 00000051`524fe070 00007ff8`819950ac     Microsoft_Terminal_Control!wil::details::WilDynamicLoadRaiseFailFastException+0x49 [C:\a\_work\1\s\dep\wil\include\wil\result_macros.h @ 1841] 
02 00000051`524fe0a0 00007ff8`81995090     Microsoft_Terminal_Control!wil::details::WilRaiseFailFastException+0x18 [C:\a\_work\1\s\dep\wil\include\wil\result_macros.h @ 1781] 
03 00000051`524fe0d0 00007ff8`819958bf     Microsoft_Terminal_Control!wil::details::WilFailFast+0xa8 [C:\a\_work\1\s\dep\wil\include\wil\result_macros.h @ 3619] 
04 00000051`524fe1a0 00007ff8`81995284     Microsoft_Terminal_Control!wil::details::ReportFailure_NoReturn<3>+0x23f [C:\a\_work\1\s\dep\wil\include\wil\result_macros.h @ 3662] 
05 00000051`524ff6a0 00007ff8`8199567f     Microsoft_Terminal_Control!wil::details::ReportFailure_Base<3,0>+0x30 [C:\a\_work\1\s\dep\wil\include\wil\result_macros.h @ 3687] 
06 00000051`524ff700 00007ff8`819e3c38     Microsoft_Terminal_Control!wil::details::ReportFailure_Hr<3>+0x5f [C:\a\_work\1\s\dep\wil\include\wil\result_macros.h @ 3848] 
07 00000051`524ff780 00007ff8`81984f87     Microsoft_Terminal_Control!wil::details::in1diag3::_FailFast_Hr+0x18 [C:\a\_work\1\s\dep\wil\include\wil\result_macros.h @ 4925] 
08 00000051`524ff7d0 00007ff8`8194b3d0     Microsoft_Terminal_Control!Microsoft::Console::Render::DxEngine::Present+0x42cb7 [C:\a\_work\1\s\src\renderer\dx\DxRenderer.cpp @ 1579] 
09 00000051`524ff810 00007ff8`8194b626     Microsoft_Terminal_Control!Microsoft::Console::Render::Renderer::_PaintFrameForEngine+0x20c [C:\a\_work\1\s\src\renderer\base\renderer.cpp @ 179] 
0a 00000051`524ff8b0 00007ff8`8194b6d5     Microsoft_Terminal_Control!Microsoft::Console::Render::Renderer::PaintFrame+0x4a [C:\a\_work\1\s\src\renderer\base\renderer.cpp @ 79] 
0b 00000051`524ff8e0 00007ff8`f1e51474     Microsoft_Terminal_Control!Microsoft::Console::Render::RenderThread::_ThreadProc+0x71 [C:\a\_work\1\s\src\renderer\base\thread.cpp @ 214] 
0c 00000051`524ff910 00007ff8`f31a3258     KERNEL32!BaseThreadInitThunk+0x14 [clientcore\base\win32\client\thread.c @ 75] 
0d 00000051`524ff940 00000000`00000000     ntdll!RtlUserThreadStart+0x28 [minkernel\ntdll\rtlstrt.c @ 1166] 
Originally created by @zadjii-msft on GitHub (Feb 28, 2022). This is likely due to the renderer refactor for atlas engine. Repro is fairly consistent: ``` taskkill /f /im dwm.exe ``` from an elevated Terminal. * **weird thing 1**: If you're using the Atlas engine, you'll get a `ContentDialog` with an Unspecified Error from the renderer. This isn't the normal per-control warning, this is the window-level dialog. The renderer keeps chooching along though...? * **crash 2**: while outputting text with the DxEngine, the whole terminal will crash. <details> <summary>Stack</summary> ``` 178 Id: 4d78.cf0c Suspend: 1 Teb: 00000051`5195a000 Unfrozen "Rendering Output Thread" # Child-SP RetAddr Call Site 00 00000051`524fda90 00007ff8`81998879 KERNELBASE!RaiseFailFastException+0x152 [minkernel\kernelbase\xcpt.c @ 1198] 01 00000051`524fe070 00007ff8`819950ac Microsoft_Terminal_Control!wil::details::WilDynamicLoadRaiseFailFastException+0x49 [C:\a\_work\1\s\dep\wil\include\wil\result_macros.h @ 1841] 02 00000051`524fe0a0 00007ff8`81995090 Microsoft_Terminal_Control!wil::details::WilRaiseFailFastException+0x18 [C:\a\_work\1\s\dep\wil\include\wil\result_macros.h @ 1781] 03 00000051`524fe0d0 00007ff8`819958bf Microsoft_Terminal_Control!wil::details::WilFailFast+0xa8 [C:\a\_work\1\s\dep\wil\include\wil\result_macros.h @ 3619] 04 00000051`524fe1a0 00007ff8`81995284 Microsoft_Terminal_Control!wil::details::ReportFailure_NoReturn<3>+0x23f [C:\a\_work\1\s\dep\wil\include\wil\result_macros.h @ 3662] 05 00000051`524ff6a0 00007ff8`8199567f Microsoft_Terminal_Control!wil::details::ReportFailure_Base<3,0>+0x30 [C:\a\_work\1\s\dep\wil\include\wil\result_macros.h @ 3687] 06 00000051`524ff700 00007ff8`819e3c38 Microsoft_Terminal_Control!wil::details::ReportFailure_Hr<3>+0x5f [C:\a\_work\1\s\dep\wil\include\wil\result_macros.h @ 3848] 07 00000051`524ff780 00007ff8`81984f87 Microsoft_Terminal_Control!wil::details::in1diag3::_FailFast_Hr+0x18 [C:\a\_work\1\s\dep\wil\include\wil\result_macros.h @ 4925] 08 00000051`524ff7d0 00007ff8`8194b3d0 Microsoft_Terminal_Control!Microsoft::Console::Render::DxEngine::Present+0x42cb7 [C:\a\_work\1\s\src\renderer\dx\DxRenderer.cpp @ 1579] 09 00000051`524ff810 00007ff8`8194b626 Microsoft_Terminal_Control!Microsoft::Console::Render::Renderer::_PaintFrameForEngine+0x20c [C:\a\_work\1\s\src\renderer\base\renderer.cpp @ 179] 0a 00000051`524ff8b0 00007ff8`8194b6d5 Microsoft_Terminal_Control!Microsoft::Console::Render::Renderer::PaintFrame+0x4a [C:\a\_work\1\s\src\renderer\base\renderer.cpp @ 79] 0b 00000051`524ff8e0 00007ff8`f1e51474 Microsoft_Terminal_Control!Microsoft::Console::Render::RenderThread::_ThreadProc+0x71 [C:\a\_work\1\s\src\renderer\base\thread.cpp @ 214] 0c 00000051`524ff910 00007ff8`f31a3258 KERNEL32!BaseThreadInitThunk+0x14 [clientcore\base\win32\client\thread.c @ 75] 0d 00000051`524ff940 00000000`00000000 ntdll!RtlUserThreadStart+0x28 [minkernel\ntdll\rtlstrt.c @ 1166] ``` </details>
claunia added the Area-RenderingIssue-BugNeeds-Tag-FixProduct-TerminalPriority-2 labels 2026-01-31 05:26:33 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Feb 28, 2022):

See also MSFT:38159926.

@zadjii-msft commented on GitHub (Feb 28, 2022): See also MSFT:38159926.
Author
Owner

@lhecker commented on GitHub (Mar 2, 2022):

@zadjii-msft I think this might actually be a regression in the D3D implementation of our internal builds...
If I add HRESULT logging to DxEngine and kill DWM I get the following errors:

C:\Users\lhecker\projects\terminal\src\renderer\dx\DxRenderer.cpp(1544)\Microsoft.Terminal.Control.dll!00007FF8375F0D35: (caller: 00007FF837921367) LogHr(11) tid(6b04) 80070057 The parameter is incorrect.
    [Microsoft::Console::Render::DxEngine::Present(hr)]
C:\Users\lhecker\projects\terminal\src\renderer\dx\DxRenderer.cpp(1574)\Microsoft.Terminal.Control.dll!00007FF8379697BB: (caller: 00007FF837921367) LogHr(12) tid(6b04) 80070057 The parameter is incorrect.
    [Microsoft::Console::Render::DxEngine::Present(hr)]
C:\Users\lhecker\projects\terminal\src\renderer\dx\DxRenderer.cpp(1544)\Microsoft.Terminal.Control.dll!00007FF8375F0D35: (caller: 00007FF837921367) LogHr(13) tid(6b04) 80070057 The parameter is incorrect.
    [Microsoft::Console::Render::DxEngine::Present(hr)]
C:\Users\lhecker\projects\terminal\src\renderer\dx\DxRenderer.cpp(1574)\Microsoft.Terminal.Control.dll!00007FF8379697BB: (caller: 00007FF837921367) LogHr(14) tid(6b04) 80070057 The parameter is incorrect.
    [Microsoft::Console::Render::DxEngine::Present(hr)]
C:\Users\lhecker\projects\terminal\src\renderer\dx\DxRenderer.cpp(1544)\Microsoft.Terminal.Control.dll!00007FF8375F0D35: (caller: 00007FF837921367) LogHr(15) tid(6b04) 80070057 The parameter is incorrect.
    [Microsoft::Console::Render::DxEngine::Present(hr)]
C:\Users\lhecker\projects\terminal\src\renderer\dx\DxRenderer.cpp(1574)\Microsoft.Terminal.Control.dll!00007FF8379697BB: (caller: 00007FF837921367) LogHr(16) tid(6b04) 80070057 The parameter is incorrect.
    [Microsoft::Console::Render::DxEngine::Present(hr)]
C:\Users\lhecker\projects\terminal\src\renderer\dx\DxRenderer.cpp(1544)\Microsoft.Terminal.Control.dll!00007FF8375F0D35: (caller: 00007FF837921367) LogHr(17) tid(6b04) 80070057 The parameter is incorrect.
    [Microsoft::Console::Render::DxEngine::Present(hr)]
C:\Users\lhecker\projects\terminal\src\renderer\dx\DxRenderer.cpp(1574)\Microsoft.Terminal.Control.dll!00007FF8379697BB: (caller: 00007FF837921367) LogHr(18) tid(6b04) 80070057 The parameter is incorrect.
    [Microsoft::Console::Render::DxEngine::Present(hr)]

Not a single DXGI_ERROR_DEVICE_REMOVED or DXGI_ERROR_DEVICE_RESET in sight!

I'll try this on my public Windows 11 build 22000 machine tomorrow.

@lhecker commented on GitHub (Mar 2, 2022): @zadjii-msft I think this might actually be a regression in the D3D implementation of our internal builds... If I add HRESULT logging to DxEngine and kill DWM I get the following errors: ``` C:\Users\lhecker\projects\terminal\src\renderer\dx\DxRenderer.cpp(1544)\Microsoft.Terminal.Control.dll!00007FF8375F0D35: (caller: 00007FF837921367) LogHr(11) tid(6b04) 80070057 The parameter is incorrect. [Microsoft::Console::Render::DxEngine::Present(hr)] C:\Users\lhecker\projects\terminal\src\renderer\dx\DxRenderer.cpp(1574)\Microsoft.Terminal.Control.dll!00007FF8379697BB: (caller: 00007FF837921367) LogHr(12) tid(6b04) 80070057 The parameter is incorrect. [Microsoft::Console::Render::DxEngine::Present(hr)] C:\Users\lhecker\projects\terminal\src\renderer\dx\DxRenderer.cpp(1544)\Microsoft.Terminal.Control.dll!00007FF8375F0D35: (caller: 00007FF837921367) LogHr(13) tid(6b04) 80070057 The parameter is incorrect. [Microsoft::Console::Render::DxEngine::Present(hr)] C:\Users\lhecker\projects\terminal\src\renderer\dx\DxRenderer.cpp(1574)\Microsoft.Terminal.Control.dll!00007FF8379697BB: (caller: 00007FF837921367) LogHr(14) tid(6b04) 80070057 The parameter is incorrect. [Microsoft::Console::Render::DxEngine::Present(hr)] C:\Users\lhecker\projects\terminal\src\renderer\dx\DxRenderer.cpp(1544)\Microsoft.Terminal.Control.dll!00007FF8375F0D35: (caller: 00007FF837921367) LogHr(15) tid(6b04) 80070057 The parameter is incorrect. [Microsoft::Console::Render::DxEngine::Present(hr)] C:\Users\lhecker\projects\terminal\src\renderer\dx\DxRenderer.cpp(1574)\Microsoft.Terminal.Control.dll!00007FF8379697BB: (caller: 00007FF837921367) LogHr(16) tid(6b04) 80070057 The parameter is incorrect. [Microsoft::Console::Render::DxEngine::Present(hr)] C:\Users\lhecker\projects\terminal\src\renderer\dx\DxRenderer.cpp(1544)\Microsoft.Terminal.Control.dll!00007FF8375F0D35: (caller: 00007FF837921367) LogHr(17) tid(6b04) 80070057 The parameter is incorrect. [Microsoft::Console::Render::DxEngine::Present(hr)] C:\Users\lhecker\projects\terminal\src\renderer\dx\DxRenderer.cpp(1574)\Microsoft.Terminal.Control.dll!00007FF8379697BB: (caller: 00007FF837921367) LogHr(18) tid(6b04) 80070057 The parameter is incorrect. [Microsoft::Console::Render::DxEngine::Present(hr)] ``` Not a single `DXGI_ERROR_DEVICE_REMOVED` or `DXGI_ERROR_DEVICE_RESET` in sight! I'll try this on my public Windows 11 build 22000 machine tomorrow.
Author
Owner

@lhecker commented on GitHub (Mar 3, 2022):

1.13 doesn't crash on 22000, which makes this a regression in D3D.

However curiously, DxEngine and AtlasEngine freeze up about half the time after killing DWM...
Aside from the scrollbar the UI still works about 90% of the time, so this isn't a complete deadlock like in #12607 (10% of the time it is). But it's definitely not a fail-fast anymore, which indicates a regression in D3D.

@lhecker commented on GitHub (Mar 3, 2022): 1.13 doesn't crash on 22000, which makes this a regression in D3D. However curiously, DxEngine and AtlasEngine freeze up about half the time after killing DWM... Aside from the scrollbar the UI still works about 90% of the time, so this isn't a complete deadlock like in #12607 (10% of the time it is). But it's definitely not a fail-fast anymore, which indicates a regression in D3D.
Author
Owner

@zadjii-msft commented on GitHub (Mar 3, 2022):

Well, let's leave this open tracking the hang on 22000 (and clean it up whenever), and then re-open the internal bug and toss it over to the DWM team.

@zadjii-msft commented on GitHub (Mar 3, 2022): Well, let's leave this open tracking the hang on 22000 (and clean it up whenever), and then re-open the internal bug and toss it over to the DWM team.
Author
Owner

@WHYBBE commented on GitHub (Mar 13, 2022):

I have same problem, but I don't know something about atlas engine. However, when I run some cli application in windows terminal or vscode internal terminal, both of them or my pc would crash like the phenomenon after running taskkill /f /im dwm.exe .

  • windows terminal version: 1.12.10393
  • vscode version: 1.65.2
  • windows version: 22H2 22572.100
@WHYBBE commented on GitHub (Mar 13, 2022): I have same problem, but I don't know something about atlas engine. However, when I run some cli application in windows terminal or vscode internal terminal, both of them or my pc would crash like the phenomenon after running `taskkill /f /im dwm.exe` . * windows terminal version: 1.12.10393 * vscode version: 1.65.2 * windows version: 22H2 22572.100
Author
Owner

@lhecker commented on GitHub (Mar 14, 2022):

@WHYBBE Are you using a NVIDIA GPU? If not could you provide us with more information about the hardware you're using?

@lhecker commented on GitHub (Mar 14, 2022): @WHYBBE Are you using a NVIDIA GPU? If not could you provide us with more information about the hardware you're using?
Author
Owner

@WHYBBE commented on GitHub (Mar 14, 2022):

@WHYBBE Are you using a NVIDIA GPU? If not could you provide us with more information about the hardware you're using?

not NVIDIA, AMD RX560
CPU: AMD Ryzen 5600x

@WHYBBE commented on GitHub (Mar 14, 2022): > @WHYBBE Are you using a NVIDIA GPU? If not could you provide us with more information about the hardware you're using? not NVIDIA, AMD RX560 CPU: AMD Ryzen 5600x
Author
Owner

@lhecker commented on GitHub (Mar 14, 2022):

@WHYBBE Ah sorry, I just mixed up this issue with another rendering issue related to NVIDIA. I'm sorry.
Yes, this crash is expected in Windows 22572.100. Internally we've already fixed the regression and as far as I know it should end up in a Insider version within about 2-3 weeks.

I'll probably also submit a PR here to remove the source of these crashes on our end.

@lhecker commented on GitHub (Mar 14, 2022): @WHYBBE Ah sorry, I just mixed up this issue with another rendering issue related to NVIDIA. I'm sorry. Yes, this crash is expected in Windows 22572.100. Internally we've already fixed the regression and as far as I know it should end up in a Insider version within about 2-3 weeks. I'll probably also submit a PR here to remove the source of these crashes on our end.
Author
Owner

@WHYBBE commented on GitHub (Mar 14, 2022):

@WHYBBE Ah sorry, I just mixed up this issue with another rendering issue related to NVIDIA. I'm sorry.

Yes, this crash is expected in Windows 22572.100. Internally we've already fixed the regression and as far as I know it should end up in a Insider version within about 2-3 weeks.

I'll probably also submit a PR here to remove the source of these crashes on our end.

Thank you! Currently I use hyper as a replacement and have no major problems using it. Overall, I prefer to use Windows Terminal. Looking forward to when the bug is fixed.

@WHYBBE commented on GitHub (Mar 14, 2022): > @WHYBBE Ah sorry, I just mixed up this issue with another rendering issue related to NVIDIA. I'm sorry. > > Yes, this crash is expected in Windows 22572.100. Internally we've already fixed the regression and as far as I know it should end up in a Insider version within about 2-3 weeks. > > > > I'll probably also submit a PR here to remove the source of these crashes on our end. Thank you! Currently I use hyper as a replacement and have no major problems using it. Overall, I prefer to use Windows Terminal. Looking forward to when the bug is fixed.
Author
Owner

@DHowett commented on GitHub (Dec 9, 2025):

I think this is solved. I'm sure not seeing it with 1.23.

@DHowett commented on GitHub (Dec 9, 2025): I think this is solved. I'm sure not seeing it with 1.23.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#16896