Crash in DxEngine::SetPixelShaderPath #11990

Closed
opened 2026-01-31 03:03:17 +00:00 by claunia · 9 comments
Owner

Originally created by @zadjii-msft on GitHub (Jan 8, 2021).

Originally assigned to: @DHowett on GitHub.

Version: 1.6.3521.0

Unsure of exact repro steps. I edited the settings file and saved it. Presumably that forced an UpdateSettings, which is what triggered this?

void DxEngine::SetPixelShaderPath(std::wstring_view value) noexcept
try
{
    if (_pixelShaderPath != value)
    {
        // Enable shader effects if the path isn't empty. Otherwise leave it untouched.
        _terminalEffectsEnabled = value.empty() ? _terminalEffectsEnabled : true;
        _pixelShaderPath = { value }; // <---- This line right here
        _recreateDeviceRequested = true;
        LOG_IF_FAILED(InvalidateAll());
    }
}
CATCH_LOG()

I think making a wstring from an empty string is bad.

Relevant stack frames:


07 00000082`d4afed30 00007ffe`e8eecb17     TerminalControl!Microsoft::Console::Render::DxEngine::SetPixelShaderPath+0xd4 [E:\BA\184\s\src\renderer\dx\DxRenderer.cpp @ 978] 
08 (Inline Function) --------`--------     TerminalControl!winrt::hstring::operator class std::basic_string_view<wchar_t,struct std::char_traits<wchar_t> >+0x8e [E:\BA\184\s\src\cascadia\TerminalControl\Generated Files\winrt\base.h @ 2788] 
09 00000082`d4afed80 00007ffe`e8e73aa1     TerminalControl!winrt::Microsoft::Terminal::TerminalControl::implementation::TermControl::UpdateSettings$_ResumeCoro$1+0x5b7 [E:\BA\184\s\src\cascadia\TerminalControl\TermControl.cpp @ 313] 
0a (Inline Function) --------`--------     TerminalControl!std::experimental::coroutine_handle<void>::resume+0x9 [C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29333\include\experimental\coroutine @ 107] 
0b (Inline Function) --------`--------     TerminalControl!std::experimental::coroutine_handle<void>::operator()+0x9 [C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29333\include\experimental\coroutine @ 99] 
0c 00000082`d4afeec0 00007fff`15424684     TerminalControl!winrt::impl::resume_apartment_callback+0x11 [E:\BA\184\s\src\cascadia\TerminalControl\Generated Files\winrt\windows.ui.core.h @ 1277] 
0d 00000082`d4afeef0 00007fff`153dec9f     Windows_UI!<lambda_59517943c03487243f9bea31c6c1a784>::operator()+0x84 [onecoreuap\windows\advcore\winrt\onecoreiwindow\corewindow\common\dispatcher.cpp @ 908] 

Originally created by @zadjii-msft on GitHub (Jan 8, 2021). Originally assigned to: @DHowett on GitHub. Version: 1.6.3521.0 Unsure of exact repro steps. I edited the settings file and saved it. Presumably that forced an `UpdateSettings`, which is what triggered this? ```c++ void DxEngine::SetPixelShaderPath(std::wstring_view value) noexcept try { if (_pixelShaderPath != value) { // Enable shader effects if the path isn't empty. Otherwise leave it untouched. _terminalEffectsEnabled = value.empty() ? _terminalEffectsEnabled : true; _pixelShaderPath = { value }; // <---- This line right here _recreateDeviceRequested = true; LOG_IF_FAILED(InvalidateAll()); } } CATCH_LOG() ``` I think making a wstring from an empty string is _bad_. Relevant stack frames: ``` 07 00000082`d4afed30 00007ffe`e8eecb17 TerminalControl!Microsoft::Console::Render::DxEngine::SetPixelShaderPath+0xd4 [E:\BA\184\s\src\renderer\dx\DxRenderer.cpp @ 978] 08 (Inline Function) --------`-------- TerminalControl!winrt::hstring::operator class std::basic_string_view<wchar_t,struct std::char_traits<wchar_t> >+0x8e [E:\BA\184\s\src\cascadia\TerminalControl\Generated Files\winrt\base.h @ 2788] 09 00000082`d4afed80 00007ffe`e8e73aa1 TerminalControl!winrt::Microsoft::Terminal::TerminalControl::implementation::TermControl::UpdateSettings$_ResumeCoro$1+0x5b7 [E:\BA\184\s\src\cascadia\TerminalControl\TermControl.cpp @ 313] 0a (Inline Function) --------`-------- TerminalControl!std::experimental::coroutine_handle<void>::resume+0x9 [C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29333\include\experimental\coroutine @ 107] 0b (Inline Function) --------`-------- TerminalControl!std::experimental::coroutine_handle<void>::operator()+0x9 [C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.28.29333\include\experimental\coroutine @ 99] 0c 00000082`d4afeec0 00007fff`15424684 TerminalControl!winrt::impl::resume_apartment_callback+0x11 [E:\BA\184\s\src\cascadia\TerminalControl\Generated Files\winrt\windows.ui.core.h @ 1277] 0d 00000082`d4afeef0 00007fff`153dec9f Windows_UI!<lambda_59517943c03487243f9bea31c6c1a784>::operator()+0x84 [onecoreuap\windows\advcore\winrt\onecoreiwindow\corewindow\common\dispatcher.cpp @ 908] ```
Author
Owner

@zadjii-msft commented on GitHub (Jan 11, 2021):

@DHowett @carlos-zamora Hey heads up, this is going to make the settings UI bug bash really painful. 😬

@zadjii-msft commented on GitHub (Jan 11, 2021): @DHowett @carlos-zamora Hey heads up, this is going to make the settings UI bug bash really painful. 😬
Author
Owner

@DHowett commented on GitHub (Jan 11, 2021):

Hmm. Can it be worked around by setting a shader path (even the None shader?) if so, let’s detail that as an unblocking workaround.

@DHowett commented on GitHub (Jan 11, 2021): Hmm. Can it be worked around by setting a shader path (even the None shader?) if so, let’s detail that as an unblocking workaround.
Author
Owner

@carlos-zamora commented on GitHub (Jan 11, 2021):

By any chance, did you change retroTerminalEffects? Pankaj reported a crash related to changing retroTerminalEffects in the settings file a while back, but very recently (like last week), I wasn't able to repro it.

@carlos-zamora commented on GitHub (Jan 11, 2021): By any chance, did you change `retroTerminalEffects`? Pankaj reported a crash related to changing `retroTerminalEffects` in the settings file a while back, but very recently (like last week), I wasn't able to repro it.
Author
Owner

@zadjii-msft commented on GitHub (Jan 11, 2021):

Horrifyingly, I'm having a hard time reproing here. It hit the first time I tried saving the settings this morning, but hasn't hit again since. I'm building a fresh dev build off main to see if that one'll hit it.

@zadjii-msft commented on GitHub (Jan 11, 2021): Horrifyingly, I'm having a hard time reproing here. It hit the first time I tried saving the settings this morning, but hasn't hit again since. I'm building a fresh dev build off main to see if that one'll hit it.
Author
Owner

@DHowett commented on GitHub (Jan 25, 2021):

You know, there is something here.

E:\BA\203\s\src\renderer\dx\DxRenderer.cpp(983)\TerminalControl.dll!00007FFF131F97B2:
(caller: 00007FFF131ED9C7) LogHr(35) tid(1ae8) 8007000E Not enough memory resources
are available to complete this operation.
    Msg:[std::exception: bad allocation] 
@DHowett commented on GitHub (Jan 25, 2021): You know, there _is_ something here. ``` E:\BA\203\s\src\renderer\dx\DxRenderer.cpp(983)\TerminalControl.dll!00007FFF131F97B2: (caller: 00007FFF131ED9C7) LogHr(35) tid(1ae8) 8007000E Not enough memory resources are available to complete this operation. Msg:[std::exception: bad allocation] ```
Author
Owner

@DHowett commented on GitHub (Jan 25, 2021):

But it gets caught.

@DHowett commented on GitHub (Jan 25, 2021): But it gets caught.
Author
Owner

@DHowett commented on GitHub (Jan 25, 2021):

It's only fair that I trade you a cookie for a cookie. I accept the assignment ;P

@DHowett commented on GitHub (Jan 25, 2021): It's only fair that I trade you a cookie for a cookie. I accept the assignment ;P
Author
Owner

@zadjii-msft commented on GitHub (Jan 29, 2021):

Hey uh, there are a lot of crashes in this bucket. We should probably service this -.-

@zadjii-msft commented on GitHub (Jan 29, 2021): Hey uh, there are _a lot_ of crashes in this bucket. We should probably service this -.-
Author
Owner

@ghost commented on GitHub (Feb 11, 2021):

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

Handy links:

@ghost commented on GitHub (Feb 11, 2021): :tada:This issue was addressed in #9092, which has now been successfully released as `Windows Terminal Preview v1.6.10412.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.6.10412.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#11990