microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.4k stars 8.3k forks source link

Terminal Crashes when used with switchable GPU scenario #2183

Closed miniksa closed 2 years ago

miniksa commented 5 years ago

This is a split/follow on from #1364.

One common case in that massive thread is folks with:

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:

Byloth commented 5 years ago

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: https://github.com/microsoft/terminal/blob/f8f079882606247dcba6379dca20064bcffe65ef/src/renderer/dx/DxRenderer.cpp#L242-L245

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 commented 5 years ago

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 commented 5 years ago

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.

https://github.com/microsoft/terminal/blob/f8f079882606247dcba6379dca20064bcffe65ef/src/renderer/dx/DxRenderer.cpp#L161-L184

Byloth commented 5 years ago

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: https://github.com/microsoft/terminal/blob/0da13cdf2d5ba2081f12f85f6816546489d4918b/src/cascadia/WindowsTerminal/BaseWindow.h#L26-L29

These parameters are equal to:


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 commented 5 years ago

@Byloth, the return code is the number that is returned by the call to https://github.com/microsoft/terminal/blob/f8f079882606247dcba6379dca20064bcffe65ef/src/renderer/dx/DxRenderer.cpp#L242-L245

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

Hi, everyone!

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

Thanks! 🚀

mpetito commented 4 years ago

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 commented 4 years ago

@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 commented 4 years ago

@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

SpitFire-666 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 2 years ago

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 commented 2 years ago

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.