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

Cannot run deployed application (winrt::hresult_error when debugging) #886

Closed
mertcanekiz opened this issue May 17, 2019 · 8 comments
Closed
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Issue-Question For questions or discussion Product-Terminal The new Windows Terminal. Resolution-Answered Related to questions that have been answered

Comments

@mertcanekiz
Copy link

Windows build number: 10.0.18362
Windows Terminal version (if applicable): Cloned from latest commit as of writing
Visual Studio 2019

I was successful in building three days ago, but I had to reinstall Windows on my machine, and now when I deploy the app and try to run it, I don't get any window showing up at all.

When I try debugging on Visual Studio, I get the following error:

Exception thrown at 0x00007FF8A990A839 in WindowsTerminal.exe: Microsoft C++ exception: winrt::hresult_error at memory location 0x000000C5D358DDF8. occurred

Output > Debug:

'WindowsTerminal.exe' (Win32): Loaded 'C:\Users\Mertcan\dev\Terminal\src\cascadia\CascadiaPackage\bin\x64\Debug\AppX\WindowsTerminal.exe'. Symbols loaded.
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\win32u.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\gdi32full.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\msvcp_win.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\SHCore.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\combase.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\bcryptprimitives.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\ole32.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\oleaut32.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\dwmapi.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Program Files\WindowsApps\Microsoft.VCLibs.140.00.Debug.UWPDesktop_14.0.27508.1_x64__8wekyb3d8bbwe\msvcp140d.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Program Files\WindowsApps\Microsoft.VCLibs.140.00.Debug.UWPDesktop_14.0.27508.1_x64__8wekyb3d8bbwe\vcruntime140d.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Users\Mertcan\dev\Terminal\src\cascadia\CascadiaPackage\bin\x64\Debug\AppX\ucrtbased.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'. 
The thread 0x870 has exited with code 0 (0x0).
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\kernel.appcore.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\clbcatq.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Users\Mertcan\dev\Terminal\src\cascadia\CascadiaPackage\bin\x64\Debug\AppX\TerminalApp.dll'. Symbols loaded.
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\shell32.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\cfgmgr32.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\windows.storage.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\profapi.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\powrprof.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\umpdc.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\shlwapi.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\cryptsp.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Users\Mertcan\dev\Terminal\src\cascadia\CascadiaPackage\bin\x64\Debug\AppX\Microsoft.UI.Xaml.Markup.dll'. Symbols loaded.
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\twinapi.appcore.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\rmclient.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\threadpoolwinrt.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\Windows.UI.Xaml.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\CoreMessaging.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\iertutil.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\BCP47Langs.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\dcomp.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\WinTypes.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\OneCoreUAPCommonProxyStub.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\Windows.Storage.ApplicationData.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\propsys.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\uxtheme.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\mssprxy.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\StructuredQuery.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\Windows.StateRepositoryPS.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.18362.30_none_a1435978519dce7f\comctl32.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\Windows.Storage.Search.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\cldapi.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\bcrypt.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\fltLib.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\sspicli.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\edputil.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\Windows.Web.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Users\Mertcan\dev\Terminal\src\cascadia\CascadiaPackage\bin\x64\Debug\AppX\TerminalSettings.dll'. Symbols loaded.
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\msctf.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Users\Mertcan\dev\Terminal\src\cascadia\CascadiaPackage\bin\x64\Debug\AppX\TerminalControl.dll'. Symbols loaded.
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\DWrite.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\dxgi.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\d3d11.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\d2d1.dll'. 
'WindowsTerminal.exe' (Win32): Loaded 'C:\Windows\System32\DXCore.dll'. 
c:\users\mertcan\dev\terminal\src\renderer\dx\dxrenderer.cpp(1420)\TerminalControl.dll!00007FF85081CE44: (caller: 00007FF850819CB7) Exception(1) tid(f80) 8007000E Not enough memory resources are available to complete this operation.
    Msg:[Failed to find the requested font] [Microsoft::Console::Render::DxEngine::_GetProposedFont(face)]
c:\users\mertcan\dev\terminal\src\renderer\dx\dxrenderer.cpp(1553)\TerminalControl.dll!00007FF850928E7D: (caller: 00007FF850819CB7) ReturnHr(1) tid(f80) 8007000E Not enough memory resources are available to complete this operation.
    Msg:[c:\users\mertcan\dev\terminal\src\renderer\dx\dxrenderer.cpp(1420)\TerminalControl.dll!00007FF85081CE44: (caller: 00007FF850819CB7) Exception(1) tid(f80) 8007000E Not enough memory resources are available to complete this operation.
    Msg:[Failed to find the requested font] [Microsoft::Console::Render::DxEngine::_GetProposedFont(face)]
] [Microsoft::Console::Render::DxEngine::_GetProposedFont]
c:\users\mertcan\dev\terminal\src\cascadia\terminalcontrol\termcontrol.cpp(1090)\TerminalControl.dll!00007FF8507E1E49: (caller: 00007FF8507FC11D) Exception(2) tid(f80) 8007000E Not enough memory resources are available to complete this operation.
    [winrt::Microsoft::Terminal::TerminalControl::implementation::TermControl::GetProposedDimensions(dxEngine->UpdateFont(desiredFont, actualFont))]
Exception thrown at 0x00007FF8A990A839 in WindowsTerminal.exe: Microsoft C++ exception: wil::ResultException at memory location 0x000000C5D358AE90.
Exception thrown at 0x00007FF8A990A839 in WindowsTerminal.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.
Exception thrown at 0x00007FF8A990A839 in WindowsTerminal.exe: Microsoft C++ exception: wil::ResultException at memory location 0x000000C5D358C410.
Exception thrown at 0x00007FF8A990A839 in WindowsTerminal.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.
Exception thrown at 0x00007FF8A990A839 (KernelBase.dll) in WindowsTerminal.exe: WinRT originate error - 0x80004005 : 'c:\users\mertcan\dev\terminal\src\cascadia\terminalcontrol\termcontrol.cpp(1090)\TerminalControl.dll!00007FF8507E1E49: (caller: 00007FF8507FC11D) Exception(2) tid(f80) 8007000E Not enough memory resources are available to complete this operation.
    [winrt::Microsoft::Terminal::TerminalControl::implementation::TermControl::GetProposedDimensions(dxEngine->UpdateFont(desiredFont, actualFont))]'.
Exception thrown at 0x00007FF8A990A839 in WindowsTerminal.exe: Microsoft C++ exception: winrt::hresult_error at memory location 0x000000C5D358DDF8.

(Please tell me if there is another way of providing better debug information, as I am quite inexperienced with using Visual Studio.)

@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 May 17, 2019
@zadjii-msft
Copy link
Member

the real meat of the exception is here:

c:\users\mertcan\dev\terminal\src\renderer\dx\dxrenderer.cpp(1420)\TerminalControl.dll!00007FF85081CE44: (caller: 00007FF850819CB7) Exception(1) tid(f80) 8007000E Not enough memory resources are available to complete this operation.
    Msg:[Failed to find the requested font] [Microsoft::Console::Render::DxEngine::_GetProposedFont(face)]
c:\users\mertcan\dev\terminal\src\renderer\dx\dxrenderer.cpp(1553)\TerminalControl.dll!00007FF850928E7D: (caller: 00007FF850819CB7) ReturnHr(1) tid(f80) 8007000E Not enough memory resources are available to complete this operation.
    Msg:[c:\users\mertcan\dev\terminal\src\renderer\dx\dxrenderer.cpp(1420)\TerminalControl.dll!00007FF85081CE44: (caller: 00007FF850819CB7) Exception(1) tid(f80) 8007000E Not enough memory resources are available to complete this operation.
    Msg:[Failed to find the requested font] [Microsoft::Console::Render::DxEngine::_GetProposedFont(face)]
] [Microsoft::Console::Render::DxEngine::_GetProposedFont]
c:\users\mertcan\dev\terminal\src\cascadia\terminalcontrol\termcontrol.cpp(1090)\TerminalControl.dll!00007FF8507E1E49: (caller: 00007FF8507FC11D) Exception(2) tid(f80) 8007000E Not enough memory resources are available to complete this operation.
    [winrt::Microsoft::Terminal::TerminalControl::implementation::TermControl::GetProposedDimensions(dxEngine->UpdateFont(desiredFont, actualFont))]
Exception thrown at 0x00007FF8A990A839 in WindowsTerminal.exe: Microsoft C++ exception: wil::ResultException at memory location 0x000000C5D358AE90.
Exception thrown at 0x00007FF8A990A839 in WindowsTerminal.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.
Exception thrown at 0x00007FF8A990A839 in WindowsTerminal.exe: Microsoft C++ exception: wil::ResultException at memory location 0x000000C5D358C410.
Exception thrown at 0x00007FF8A990A839 in WindowsTerminal.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.
Exception thrown at 0x00007FF8A990A839 (KernelBase.dll) in WindowsTerminal.exe: WinRT originate error - 0x80004005 : 'c:\users\mertcan\dev\terminal\src\cascadia\terminalcontrol\termcontrol.cpp(1090)\TerminalControl.dll!00007FF8507E1E49: (caller: 00007FF8507FC11D) Exception(2) tid(f80) 8007000E Not enough memory resources are available to complete this operation.
    [winrt::Microsoft::Terminal::TerminalControl::implementation::TermControl::GetProposedDimensions(dxEngine->UpdateFont(desiredFont, actualFont))]'.
Exception thrown at 0x00007FF8A990A839 in WindowsTerminal.exe: Microsoft C++ exception: winrt::hresult_error at memory location 0x000000C5D358DDF8.


What font is set in your profiles.json? If it doesn't exist, the app will crash without warning currently. See #550

@DHowett-MSFT DHowett-MSFT added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels May 17, 2019
@mertcanekiz
Copy link
Author

The thing is, I never got to launch the app, therefore did not edit profiles.json file. If the app is deployed into %LOCALAPPDATA% there is only a 0KB wdt.exe file in there that I can find.

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels May 17, 2019
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label May 17, 2019
@mKay00
Copy link
Contributor

mKay00 commented May 17, 2019

The profiles.json should be under "%LOCALAPPDATA%\Packages\WindowsTerminalDev_8wekyb3d8bbwe\RoamingState" does this folder exist and is there a profiles.json with correct content?

@mertcanekiz
Copy link
Author

Yes there is this folder, and a profiles.json with the following content:

{"defaultProfile":"{09dc5eef-6840-4050-ae69-21e55e6a2e62}","initialRows":30,"initialCols":120,"alwaysShowTabs":true,"showTerminalTitleInTitlebar":true,"experimental_showTabsInTitlebar":false,"profiles":[{"guid":"{0fa7ef23-e38b-47a0-87bc-39f22ee8c2ff}","name":"PowerShell","background":"#012456","colorscheme":"Campbell","historySize":9001,"snapOnInput":true,"cursorColor":"#FFFFFF","cursorShape":"bar","commandline":"powershell.exe","fontFace":"Courier New","fontSize":12,"acrylicOpacity":0.5,"useAcrylic":false,"closeOnExit":true,"padding":"0, 0, 0, 0"},{"guid":"{3735a482-0d20-4f1e-9cef-735ffe93a19a}","name":"cmd","colorscheme":"Campbell","historySize":9001,"snapOnInput":true,"cursorColor":"#FFFFFF","cursorShape":"bar","commandline":"cmd.exe","fontFace":"Iosevka","fontSize":12,"acrylicOpacity":0.4,"useAcrylic":true,"closeOnExit":true,"padding":"0, 0, 0, 0"},{"guid":"{09dc5eef-6840-4050-ae69-21e55e6a2e62}","name":"WSL","colorscheme":"Solarized Dark","historySize":9001,"snapOnInput":true,"cursorColor":"#FFFFFF","cursorShape":"bar","commandline":"C:\\Users\\Mertcan\\Downloads\\Arch\\Arch.exe","fontFace":"Iosevka","fontSize":12,"acrylicOpacity":0.6,"useAcrylic":true,"closeOnExit":true,"padding":"0, 0, 0, 0"}],"schemes":[{"name":"Campbell","foreground":"#F2F2F2","background":"#0C0C0C","black":"#0C0C0C","red":"#C50F1F","green":"#13A10E","yellow":"#C19C00","blue":"#0037DA","purple":"#881798","cyan":"#3A96DD","white":"#CCCCCC","brightBlack":"#767676","brightRed":"#E74856","brightGreen":"#16C60C","brightYellow":"#F9F1A5","brightBlue":"#3B78FF","brightPurple":"#B4009E","brightCyan":"#61D6D6","brightWhite":"#F2F2F2"},{"name":"Solarized Dark","foreground":"#FDF6E3","background":"#073642","black":"#073642","red":"#D30102","green":"#859900","yellow":"#B58900","blue":"#268BD2","purple":"#D33682","cyan":"#2AA198","white":"#EEE8D5","brightBlack":"#002B36","brightRed":"#CB4B16","brightGreen":"#586E75","brightYellow":"#657B83","brightBlue":"#839496","brightPurple":"#6C71C4","brightCyan":"#93A1A1","brightWhite":"#FDF6E3"},{"name":"Solarized Light","foreground":"#073642","background":"#FDF6E3","black":"#073642","red":"#D30102","green":"#859900","yellow":"#B58900","blue":"#268BD2","purple":"#D33682","cyan":"#2AA198","white":"#EEE8D5","brightBlack":"#002B36","brightRed":"#CB4B16","brightGreen":"#586E75","brightYellow":"#657B83","brightBlue":"#839496","brightPurple":"#6C71C4","brightCyan":"#93A1A1","brightWhite":"#FDF6E3"}]}

@mKay00
Copy link
Contributor

mKay00 commented May 17, 2019

What Font is Iosevka? This is not the default profiles.json, but looks like an old one instead, where you used a font that isn't installed on your machine anymore.

@DHowett-MSFT
Copy link
Contributor

The thing is, I never got to launch the app, therefore did not edit profiles.json file.

"C:\\Users\\Mertcan\\Downloads\\

It looks a lot like you've edited the profiles.json file . . .

and I'm going to guess that this is the problem:

"fontFace": "Iosevka",

Can you open the Iosevka font and see what its full name is? You might need to use its full name, which could be something like Iosevka Regular or Iosevka Medium.

@DHowett-MSFT DHowett-MSFT added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels May 17, 2019
@mertcanekiz
Copy link
Author

Well, this is embarassing. I take full blame for not reading through the profiles.json file...

However,

I truly haven't edited this file after formatting and rebuilding Windows Terminal. Does this app download settings from previous installs / cloud? I did in fact set the font to Iosevka before formatting, but had not done this in this install of Windows.

I can confirm that changing the font variable fixes this problem. I am keeping this open to confirm whether my profiles.json file is from an older install, a moderator can close this issue if they choose to do so. Thanks a lot for everyone's help and their time.

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels May 17, 2019
@DHowett-MSFT
Copy link
Contributor

@mertcanekiz We've seen a couple of these in the wild. Since we put the settings into the RoamingState directory, Windows holds on to them; this occasionally even happens across installs.

Glad we got it sorted! I'll close this, but we'll look at whether this is part of our long term strategy.
Regardless, things like this will be helped by #622.

@DHowett-MSFT DHowett-MSFT added Issue-Question For questions or discussion Resolution-Answered Related to questions that have been answered Product-Terminal The new Windows Terminal. Area-Settings Issues related to settings and customizability, for console or terminal labels May 17, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label May 17, 2019
@DHowett-MSFT DHowett-MSFT removed the Needs-Attention The core contributors need to come back around and look at this ASAP. label May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Issue-Question For questions or discussion Product-Terminal The new Windows Terminal. Resolution-Answered Related to questions that have been answered
Projects
None yet
Development

No branches or pull requests

5 participants