Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminal Crashes when used with switchable GPU scenario #2183

Closed
miniksa opened this issue Jul 31, 2019 · 20 comments
Closed

Terminal Crashes when used with switchable GPU scenario #2183

miniksa opened this issue Jul 31, 2019 · 20 comments
Labels
Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. Priority-2 A description (P2) Product-Terminal The new Windows Terminal. Severity-Crash Crashes are real bad news.
Milestone

Comments

@miniksa
Copy link
Member

miniksa commented Jul 31, 2019

This is a split/follow on from #1364.

One common case in that massive thread is folks with:

  • portable devices that have a discrete GPU and an integrated GPU
  • portable devices that have some sort of docking mechanism

Are experiencing issues where the Terminal only works properly on one of the GPUs or is having problems after certain driver updates.

I'm suspecting this is just a reliability problem in the DxRenderer.cpp code, but I don't have access to any of this type of device.

So this represents:

  • Someone with one of these devices and who is experiencing the crash and who is confident in their debugging abilities takes this issue and figures it out.
    OR
  • I (or someone on the team here) eventually gains access to one of these types of devices, repros it, and fixes it.
@miniksa miniksa added Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Issue-Bug It either shouldn't be doing this or needs an investigation. Severity-Crash Crashes are real bad news. Product-Terminal The new Windows Terminal. labels Jul 31, 2019
@ghost ghost added the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Jul 31, 2019
@miniksa miniksa removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Jul 31, 2019
@miniksa miniksa added the Help Wanted We encourage anyone to jump in on these. label Jul 31, 2019
@Byloth
Copy link

Byloth commented Aug 1, 2019

Hi, @miniksa... 👋
I just tried to help you to solve this problem.

Unfortunately, I only detected the last line inside the project where the problem is...
From then on, the code is marked as "External code" and even the loading of missing external symbols didn't help me to investigate further.

Here's the line:

RETURN_IF_FAILED(_dxgiFactory2->CreateSwapChainForComposition(_d3dDevice.Get(),
&SwapChainDesc,
nullptr,
&_dxgiSwapChain));

And here, the relative stacktrace:

TerminalControl.dll!Microsoft::Console::Render::DxEngine::_CreateDeviceResources(const bool createSwapChain) Riga 242	C++
TerminalControl.dll!Microsoft::Console::Render::DxEngine::GetSwapChain() Riga 406	C++ 	TerminalControl.dll!winrt::Microsoft::Terminal::TerminalControl::implementation::TermControl::_InitializeTerminal() Riga 442	C++
TerminalControl.dll!<lambda_6d049f29667612c95da7311db7a1a381>::operator()<winrt::Windows::Foundation::IInspectable,winrt::Windows::UI::Xaml::RoutedEventArgs>(winrt::Windows::Foundation::IInspectable __formal, winrt::Windows::UI::Xaml::RoutedEventArgs __formal) Riga 89	C++
TerminalControl.dll!winrt::impl::delegate<winrt::Windows::UI::Xaml::RoutedEventHandler,<lambda_6d049f29667612c95da7311db7a1a381> >::Invoke(void * sender, void * e) Riga 4669	C++

Oh... Right!
Another thing I did...

I also tried to compare the value for those parameters (_d3dDevice, SwapChainDesc & _dxgiSwapChain) between when it works and when it doesn't...

For SwapChainDesc and _dxgiSwapChain nothing changed.
Unfortunately, for _d3dDevice (and, of course, for _d3dDevice.Get()) I only got a memory address (like 0x000001e8a6b9b2d8) due to the missing symbols (again 😭).


I'll keep trying in the coming days...
Tell me if you think I should change my approach to this problem or if you need some more specific information from me.

Thank you. 🙂

@miniksa
Copy link
Member Author

miniksa commented Aug 1, 2019

Oooh. Excellent, @Byloth. What's the return code from CreateSwapChainForComposition in the failure case?

I expect all the parameters to be the same, but something about the system/device/DX-stack is causing a difference in behavior in this circumstance.

@miniksa
Copy link
Member Author

miniksa commented Aug 1, 2019

Oh, also, if you have the latest code... the interesting thing to know is which D3D11CreateDevice statement above (lines 161-183) actually created this specific device if you can breakpoint up there.

Was it the one that says D3D_DRIVER_TYPE_HARDWARE or the one that says D3D_DRIVER_TYPE_WARP? All the other parameters should have been the same.

const auto hardwareResult = D3D11CreateDevice(NULL,
D3D_DRIVER_TYPE_HARDWARE,
NULL,
DeviceFlags,
FeatureLevels,
ARRAYSIZE(FeatureLevels),
D3D11_SDK_VERSION,
&_d3dDevice,
NULL,
&_d3dDeviceContext);
if (FAILED(hardwareResult))
{
RETURN_IF_FAILED(D3D11CreateDevice(NULL,
D3D_DRIVER_TYPE_WARP,
NULL,
DeviceFlags,
FeatureLevels,
ARRAYSIZE(FeatureLevels),
D3D11_SDK_VERSION,
&_d3dDevice,
NULL,
&_d3dDeviceContext));
}

@Byloth
Copy link

Byloth commented Aug 2, 2019

What's the return code from CreateSwapChainForComposition in the failure case?

I have to be honest: I don't know if this is what you're looking for... But...
If I jump inside that method with the debugger (for example, using the F11 key) I immediately find myself here:

[[nodiscard]] static LRESULT __stdcall WndProc(HWND const window, UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept
{
WINRT_ASSERT(window);

These parameters are equal to:

  • lparam0
  • message31
  • window0x0000000000600b2c {unused=??? }
  • wparam0

From then on, the execution step by step seems to be no longer useful...
Sorry but I can't give you a detailed stacktrace to let you know how I reach there...
In fact, the intermediate steps are all marked as [External code].


Was it the one that says D3D_DRIVER_TYPE_HARDWARE or the one that says D3D_DRIVER_TYPE_WARP? All the other parameters should have been the same.

It's always the D3D_DRIVER_TYPE_HARDWARE one... In both cases!
And, yes... All the other parameters are exactly the same.


I hope it can be useful!

@miniksa
Copy link
Member Author

miniksa commented Aug 2, 2019

@Byloth, the return code is the number that is returned by the call to

RETURN_IF_FAILED(_dxgiFactory2->CreateSwapChainForComposition(_d3dDevice.Get(),
&SwapChainDesc,
nullptr,
&_dxgiSwapChain));

It should show up in the VS debugger as the "return value" and/or it should be logged to the debugger output window because it is inside a RETURN_IF_FAILED. It should be a number that starts with 0x887A like any of these: https://docs.microsoft.com/en-us/windows/win32/direct3ddxgi/dxgi-error

@Byloth
Copy link

Byloth commented Aug 5, 2019

It should be a number that starts with 0x887A like any of these: [...]

Mmmh... Nooope!
Nothing similar... Sorry! 😥

The entire debug output might be useful?

'WindowsTerminal.exe' (Win32): caricamento di 'C:\Users\Matteo\Progetti\microsoft\terminal\src\cascadia\CascadiaPackage\bin\x64\Debug\AppX\WindowsTerminal.exe' completato. Simboli caricati.
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\ntdll.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\kernel32.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\KernelBase.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\user32.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\win32u.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\gdi32.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\gdi32full.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\msvcp_win.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\ucrtbase.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\SHCore.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\msvcrt.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\rpcrt4.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\combase.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\bcryptprimitives.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\ole32.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\advapi32.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\sechost.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\oleaut32.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\bcrypt.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\dwmapi.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\UIAutomationCore.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Program Files\WindowsApps\Microsoft.VCLibs.140.00.Debug.UWPDesktop_14.0.27323.0_x64__8wekyb3d8bbwe\msvcp140d.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Program Files\WindowsApps\Microsoft.VCLibs.140.00.Debug.UWPDesktop_14.0.27323.0_x64__8wekyb3d8bbwe\vcruntime140d.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Users\Matteo\Progetti\microsoft\terminal\src\cascadia\CascadiaPackage\bin\x64\Debug\AppX\ucrtbased.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\imm32.dll' completato. 
Il thread 0x5f10 è terminato con il codice 0 (0x0).
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\kernel.appcore.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\clbcatq.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Users\Matteo\Progetti\microsoft\terminal\src\cascadia\CascadiaPackage\bin\x64\Debug\AppX\TerminalApp.dll' completato. Simboli caricati.
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\shell32.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\cfgmgr32.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\windows.storage.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\profapi.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\powrprof.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\umpdc.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\shlwapi.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\cryptsp.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Users\Matteo\Progetti\microsoft\terminal\src\cascadia\CascadiaPackage\bin\x64\Debug\AppX\Microsoft.Toolkit.Win32.UI.XamlHost.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Users\Matteo\Progetti\microsoft\terminal\src\cascadia\CascadiaPackage\bin\x64\Debug\AppX\vcruntime140_app.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Program Files\WindowsApps\Microsoft.VCLibs.140.00.Debug.UWPDesktop_14.0.27323.0_x64__8wekyb3d8bbwe\vcruntime140.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Users\Matteo\Progetti\microsoft\terminal\src\cascadia\CascadiaPackage\bin\x64\Debug\AppX\msvcp140_app.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Program Files\WindowsApps\Microsoft.VCLibs.140.00.Debug.UWPDesktop_14.0.27323.0_x64__8wekyb3d8bbwe\msvcp140.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\twinapi.appcore.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\rmclient.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\threadpoolwinrt.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\Windows.UI.Xaml.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\CoreMessaging.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\BCP47Langs.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\dcomp.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\iertutil.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\WinTypes.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\OneCoreUAPCommonProxyStub.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\MrmCoreR.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\Windows.StateRepositoryCore.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\Windows.UI.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\InputHost.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\TextInputFramework.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\propsys.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\CoreUIComponents.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\CoreUIComponents.dll' completato. 
'WindowsTerminal.exe' (Win32): scaricamento di 'C:\Windows\System32\CoreUIComponents.dll' completato
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\ntmarta.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\BCP47mrm.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\uxtheme.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\msctf.dll' completato. 
Eccezione generata in corrispondenza di 0x00007FFE1558A839 (KernelBase.dll) in WindowsTerminal.exe: 0x40080202: WinRT transform error (parametri: 0x000000008000000B, 0x0000000080070490, 0x000000000000001F, 0x0000003EBECFE9C0).
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\UiaManager.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\urlmon.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\cryptbase.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\dxgi.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\DXCore.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\ResourcePolicyClient.dll' completato. 
'WindowsTerminal.exe' (Win32): scaricamento di 'C:\Windows\System32\ResourcePolicyClient.dll' completato
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\DriverStore\FileRepository\nvdmi.inf_amd64_0892ebbc44dbcc2a\nvdlistx.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\version.dll' completato. 
'WindowsTerminal.exe' (Win32): scaricamento di 'C:\Windows\System32\version.dll' completato
'WindowsTerminal.exe' (Win32): scaricamento di 'C:\Windows\System32\DriverStore\FileRepository\nvdmi.inf_amd64_0892ebbc44dbcc2a\nvdlistx.dll' completato
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\d3d11.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\DriverStore\FileRepository\nvdmi.inf_amd64_0892ebbc44dbcc2a\nvldumdx.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\version.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\crypt32.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\msasn1.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\wintrust.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\imagehlp.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Users\Matteo\Progetti\microsoft\terminal\src\cascadia\CascadiaPackage\bin\x64\Debug\AppX\Microsoft.UI.Xaml.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\rsaenh.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\DriverStore\FileRepository\nvdmi.inf_amd64_0892ebbc44dbcc2a\nvwgf2umx.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\winmm.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\winmmbase.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\winmmbase.dll' completato. 
'WindowsTerminal.exe' (Win32): scaricamento di 'C:\Windows\System32\winmmbase.dll' completato
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\Windows.UI.Immersive.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Program Files\NVIDIA Corporation\Ansel\Tools\NvCameraWhitelisting64.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\DataExchange.dll' completato. 
'WindowsTerminal.exe' (Win32): scaricamento di 'C:\Program Files\NVIDIA Corporation\Ansel\Tools\NvCameraWhitelisting64.dll' completato
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\nvspcap64.dll' completato. 
Eccezione generata in corrispondenza di 0x00007FFE1558A839 (KernelBase.dll) in WindowsTerminal.exe: WinRT originate error - 0x8000000E : 'Impossibile creare una nuova visualizzazione perché la finestra principale non è ancora stata creata'.
onecoreuap\shell\coreapplication\application\lib\coreapplication.cpp(3154)\twinapi.appcore.dll!00007FFE128C6337: (caller: 00007FFE12825480) ReturnHr(1) tid(5eb8) 8000000E È stato chiamato un metodo in un momento imprevisto.
onecoreuap\shell\coreapplication\application\lib\coreapplicationfactory.cpp(329)\twinapi.appcore.dll!00007FFE128C8DCC: (caller: 00007FFE1290E4C8) ReturnHr(2) tid(5eb8) 8000000E È stato chiamato un metodo in un momento imprevisto.
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\d2d1.dll' completato. 
Il thread 0x5e54 è terminato con il codice 0 (0x0).
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\DWrite.dll' completato. 
Il thread 0x58bc è terminato con il codice 0 (0x0).
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Users\Matteo\Progetti\microsoft\terminal\src\cascadia\CascadiaPackage\bin\x64\Debug\AppX\TerminalSettings.dll' completato. Simboli caricati.
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Users\Matteo\Progetti\microsoft\terminal\src\cascadia\CascadiaPackage\bin\x64\Debug\AppX\TerminalControl.dll' completato. Simboli caricati.
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\oleacc.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\sxs.dll' completato. 
mincore\com\oleaut32\dispatch\ups.cpp(2125)\OLEAUT32.dll!00007FFE16843C4B: (caller: 00007FFE16843DC2) ReturnHr(1) tid(5eb8) 8002801D Libreria non registrata.
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\Windows.Globalization.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\Windows.UI.Xaml.Controls.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\Windows.ApplicationModel.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\Windows.Energy.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\Windows.Graphics.dll' completato. 
onecoreuap\windows\wgi\winrt\display\displaycommon.cpp(411)\Windows.Graphics.dll!00007FFE0D8104B0: (caller: 00007FFE0D8101F5) ReturnHr(1) tid(5eb8) 80070490 Impossibile trovare elemento.
onecoreuap\windows\wgi\winrt\display\displaycommon.cpp(411)\Windows.Graphics.dll!00007FFE0D8104B0: (caller: 00007FFE0D81017A) ReturnHr(2) tid(5eb8) 80070490 Impossibile trovare elemento.
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\WindowsCodecs.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Users\Matteo\Progetti\microsoft\terminal\src\cascadia\CascadiaPackage\bin\x64\Debug\AppX\TerminalConnection.dll' completato. Simboli caricati.
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\ws2_32.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Users\Matteo\Progetti\microsoft\terminal\src\cascadia\CascadiaPackage\bin\x64\Debug\AppX\SSLEAY32.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Users\Matteo\Progetti\microsoft\terminal\src\cascadia\CascadiaPackage\bin\x64\Debug\AppX\cpprest_2_10d.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Users\Matteo\Progetti\microsoft\terminal\src\cascadia\CascadiaPackage\bin\x64\Debug\AppX\LIBEAY32.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Users\Matteo\Progetti\microsoft\terminal\src\cascadia\CascadiaPackage\bin\x64\Debug\AppX\LIBEAY32.dll' completato. 
'WindowsTerminal.exe' (Win32): scaricamento di 'C:\Users\Matteo\Progetti\microsoft\terminal\src\cascadia\CascadiaPackage\bin\x64\Debug\AppX\LIBEAY32.dll' completato
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\httpapi.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\winhttp.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Program Files\WindowsApps\Microsoft.VCLibs.140.00.Debug.UWPDesktop_14.0.27323.0_x64__8wekyb3d8bbwe\concrt140d.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\dpapi.dll' completato. 
onecoreuap\windows\wgi\winrt\display\displaycommon.cpp(411)\Windows.Graphics.dll!00007FFE0D8104B0: (caller: 00007FFE0D8101F5) ReturnHr(3) tid(5eb8) 80070490 Element not found.
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\wuceffects.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Windows\System32\directmanipulation.dll' completato. 
'WindowsTerminal.exe' (Win32): caricamento di 'C:\Program Files\NVIDIA Corporation\Ansel\Tools\NvCameraWhitelisting64.dll' completato. 
'WindowsTerminal.exe' (Win32): scaricamento di 'C:\Program Files\NVIDIA Corporation\Ansel\Tools\NvCameraWhitelisting64.dll' completato
Eccezione generata in corrispondenza di 0x00007FFE1558A839 in WindowsTerminal.exe: Eccezione Microsoft C++: _com_error in corrispondenza della posizione di memoria 0x0000003EBECFD240.
Eccezione generata in corrispondenza di 0x00007FFE1558A839 in WindowsTerminal.exe: Eccezione Microsoft C++: _com_error in corrispondenza della posizione di memoria 0x0000003EBECFCFF0.
Debug Error!

Program: ...scadia\CascadiaPackage\bin\x64\Debug\AppX\WindowsTerminal.exe

abort() has been called

(Press Retry to debug the application)
WindowsTerminal.exe ha avviato un punto di interruzione.

Il thread 0x24a4 è terminato con il codice 3 (0x3).
Il thread 0x5f10 è terminato con il codice 3 (0x3).
Il thread 0x2ce4 è terminato con il codice 3 (0x3).
Il thread 0x2990 è terminato con il codice 3 (0x3).
Il thread 0x5db4 è terminato con il codice 3 (0x3).
Il thread 0x5f48 è terminato con il codice 3 (0x3).
Il thread 0x2d3c è terminato con il codice 3 (0x3).
Il thread 0x5a74 è terminato con il codice 3 (0x3).
Il thread 0x5fec è terminato con il codice 3 (0x3).
Il thread 0x3230 è terminato con il codice 3 (0x3).
Il thread 0x5cd8 è terminato con il codice 3 (0x3).
Il thread 0x5eac è terminato con il codice 3 (0x3).
Il thread 0x5684 è terminato con il codice 3 (0x3).
Il thread 0x5dac è terminato con il codice 3 (0x3).
Il thread 0x482c è terminato con il codice 3 (0x3).
Il thread 0x5d98 è terminato con il codice 3 (0x3).
Il thread 0x3374 è terminato con il codice 3 (0x3).
Il thread 0x5d44 è terminato con il codice 3 (0x3).
Il thread 0x5db0 è terminato con il codice 3 (0x3).
Il programma '[24244] WindowsTerminal.exe' è terminato con il codice 3 (0x3).

Sorry for the Italian language... 😔

@miniksa
Copy link
Member Author

miniksa commented Aug 5, 2019

Hm, no, the return code from the dxrenderer.cpp isn't in that log.

I don't really know how to further explain what a return code is, but that's what I need from the function.

@Byloth
Copy link

Byloth commented Aug 13, 2019

I made some other attempts trying to retrieve what you're asking me...
Well... Nothing that starts with 0x887A! 😥

I also tried setting a breakpoint on the RETURN_IF_FAILED function line...
It seems to stops running before reaching there.


BUT...
This time I found myself in the C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\crt\src\x64\gshandlereh.cpp file on line 101.

There is a ExceptionRecord object that is equal to:

+ ExceptionRecord     0x000000a81d0fc630 {ExceptionCode=3765269347 ExceptionFlags=1 ExceptionRecord=0x0000000000000000 <NULL> ...}
     ExceptionCode           3765269347
     ExceptionFlags          1
     ExceptionRecord         0x0000000000000000 <NULL>
     ExceptionAddress        KernelBase.dll!0x00007ffd4beca839
     NumberParameters        4
   + ExceptionInformation    0x000000a81d0fc650 {429065504, 722042079824, 140725853409344, 140725852635136, 0, 0, 0, 0, 0, 0, 0, ...}
        [0]     429065504
        [1]     722042079824
        [2]     140725853409344
        [3]     140725852635136
        [4]     0
        [5]     0
        [6]     0
        [7]     0
        [8]     0
        [9]     0
        [10]    0
        [11]    0
        [12]    0
        [13]    0
        [14]    0

I'm not sure it could be useful, though... 😔

@miniksa
Copy link
Member Author

miniksa commented Aug 16, 2019

No, it's not that. But that's strange. I wouldn't have expected it to point to a structured exception. Also none of those error codes show something related to DirectX. Thanks for trying, but I think we're just still stuck here.

@mttradebyte
Copy link

mttradebyte commented Sep 3, 2019

I referenced this ticket in #2646, whereby I couldn't launch the app while RDPing to my laptop (which has 2 GPUs), and a workaround I have found to keep it working is to change the graphics settings to force it to use the onboard one. The workaround was not necessary when physically working on the device. Hopefully this knowledge is useful for your diagnosis.

@bitcrazed
Copy link
Contributor

@mtanatwine Thanks for submitting your feedback. Alas, we're unable to repro this on our machines.

You also mention that you've 'graphics settings and by forcing the app to use the "Power Saving" (onboard) GPU, it launches and works via RDP as intended'.

It's entirely possible that your graphics card vendor's drivers are causing some unexpected issue when RD is used. Could I ask you to ensure you're running the latest drivers from your device OEM and/or GFX card vendor.

If you still see this issue re-occur, please let us know with more details re. your hardware setup.

Thanks.

@Byloth
Copy link

Byloth commented Oct 7, 2019

Hi, everyone!

From the Release v.0.5.2661.0 I'm no longer experiencing this problem.
It seems to be solved!

Thanks! 🚀

@mpetito
Copy link

mpetito commented Nov 18, 2019

I believe I am encountering this same issue in v0.6.2951.0 with a Dell XPS laptop (having both Intel integrated and Nvidia discrete graphics) when connected to a display via displayport on an external dock. I can provide more details on the hardware if desired.

The crash occurs if the window is started on the external display or if the window is moved from the laptop display to the external display.

Faulting application name: WindowsTerminal.exe, version: 1.0.1910.22001, time stamp: 0x5daf7ab2
Faulting module name: KERNELBASE.dll, version: 10.0.19025.1, time stamp: 0xf2945738
Exception code: 0xc000027b
Fault offset: 0x000000000010b86c
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report Id: 4310a290-1296-4769-ad4d-e39e1bf8a615
Faulting package full name: Microsoft.WindowsTerminal_0.6.2951.0_x64__8wekyb3d8bbwe

This is consistently reproducible on the machine and I was able to narrow down the problem to a single setting. If showTabsInTitlebar is set to false, then the crash does not occur with one or more tabs. However, as soon as this setting is set to true and one or more tabs are displayed in the titlebar, the crash always occurs on the external display.

@chrismetz
Copy link

@mpetito I have a Dell XPS 15 with Nvidia discrete graphics and Intel integrated. I have been experiencing the same problem for the past few days with version 0.6.2951.0. I have just set showTabsInTitlebar to false, I will see how it goes

@nijeesh4all
Copy link

nijeesh4all commented Jul 25, 2020

@chrismetz it does happens to me as well on an XPS,

i have an XPS-9530 with a GT 750M graphics card. Terminal crashed when i run the program with the Auto settings in the NVIDIA control panel. But it runs perfectly well when i force it to run on the integrated graphics card in NVIDIA control panel

i am on version 1.1.2021.0

edit: 31/07/2020
reinstalling Intel and NVIDIA graphics drivers fixed the issue for me

@cinnamon-msft cinnamon-msft removed this from the Terminal v1.x milestone Sep 29, 2020
@cinnamon-msft cinnamon-msft added this to the Terminal v2.0 milestone Sep 29, 2020
@SpitFire-666
Copy link

Just had the same/similar crash, creating two errors in eventlog:


Faulting application name: OpenConsole.exe, version: 1.8.2105.24004, time stamp: 0x60ac2e5d
Faulting module name: ucrtbase.dll, version: 10.0.19041.789, time stamp: 0x2bd748bf
Exception code: 0xc0000409
Fault offset: 0x000000000007286e
Faulting process ID: 0x2454
Faulting application start time: 0x01d755acc47ef54f
Faulting application path: C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.8.1444.0_x64__8wekyb3d8bbwe\OpenConsole.exe
Faulting module path: C:\WINDOWS\System32\ucrtbase.dll
Report ID: edfc43e4-c34a-4958-9020-4169a310e36c
Faulting package full name: Microsoft.WindowsTerminal_1.8.1444.0_x64__8wekyb3d8bbwe
Faulting package-relative application ID: App
Faulting application name: WindowsTerminal.exe, version: 1.8.2105.24004, time stamp: 0x60ac2e94
Faulting module name: KERNELBASE.dll, version: 10.0.19041.964, time stamp: 0x812662a7
Exception code: 0xc000027b
Fault offset: 0x000000000010b39c
Faulting process ID: 0x92c
Faulting application start time: 0x01d75287021fdf74
Faulting application path: C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.8.1444.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report ID: 06aa1421-adc4-4bb6-9627-70f9acc76adc
Faulting package full name: Microsoft.WindowsTerminal_1.8.1444.0_x64__8wekyb3d8bbwe
Faulting package-relative application ID: App

It happened after resizing the terminal window. I'm on a Dell Latitude 7490 laptop - no dock, but with two screens plugged in (HDMI and VGA via dongle). Intel(R) UHD Graphics 620.

@SpitFire-666
Copy link

Today I had an (identical?) crash to my previous post - eventlog details were the same, but the crash happened with moving the window between screens today.

@dpauls
Copy link

dpauls commented Jun 2, 2021

I am reporting this here since this issue is identified as being responsible for this issue, first reported in #1364, which I believe covers what I am reporting below:

Launching on a portable device that uses switchable GPUs or an external dock GPU

Ever since I upgraded Windows to 21H1 on May 28, I have been unable to open Windows Terminal or Windows Terminal Preview. It immediately crashes with this error in the Event Log (very similar to @campbellkerr above, except the application is OpenConsole.exe vs. WindowsTerminal.exe):

Faulting module name: ucrtbase.dll, version: 10.0.19041.789, time stamp: 0x2bd748bf
Exception code: 0xc0000409
Fault offset: 0x000000000007286e
Faulting process id: 0x32c4
Faulting application start time: 0x01d7562ceba1768f
Faulting application path: C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.9.1445.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe
Faulting module path: C:\WINDOWS\System32\ucrtbase.dll
Report Id: 10be65e1-5924-4ea5-b8a9-acca11bd89da
Faulting package full name: Microsoft.WindowsTerminalPreview_1.9.1445.0_x64__8wekyb3d8bbwe
Faulting package-relative application ID: App

I have a Microsoft Surface Book 2, which has 2 graphics adapters. I have tried changing the graphics settings for Microsoft Terminal to use one adapter or the other, but I get the same error regardless of which GPU is configured.

The drivers for both GPUs are up-to-date, but have not changed since April. So it appears this problem is somehow related to the 21H2 update.

@zadjii-msft zadjii-msft added the Priority-2 A description (P2) label Jan 4, 2022
@zadjii-msft zadjii-msft modified the milestones: Terminal v2.0, Backlog Jan 4, 2022
@zadjii-msft
Copy link
Member

Hmmm. So, there were a lot of issues with 1.9, so I'd bet that most of the crashes that folks in this thread were seeing were other 1.9 issues that we sorted out.

We haven't really tested this on a switchable GPU in quite some time, but in the 3 years since this was filed, we've had a lot of general stability fixes for the renderer. At this point, even if the renderer encounters an error, it should just tap out and let the user restart the renderer manually (rather than killing the Terminal entirely).

Anyone in this thread that does have a switchable GPU - you still seeing this on 1.14 / 1.15/?

@ghost ghost added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. labels Aug 3, 2022
@ghost
Copy link

ghost commented Aug 7, 2022

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 ghost closed this as completed Aug 10, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. Priority-2 A description (P2) Product-Terminal The new Windows Terminal. Severity-Crash Crashes are real bad news.
Projects
None yet
Development

No branches or pull requests