microsoft / terminal

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

Unable to open Windows Terminal any more #16747

Closed cmarkwick365 closed 6 months ago

cmarkwick365 commented 7 months ago

Windows Terminal version

1.19.10302.0

Windows build number

10.0.22631.3155

Other Software

No response

Steps to reproduce

I'm getting a similar issue as #16730 . I don't have macType. I just click on terminal from the start menu and nothing happens. The dialog doesn't even flash up, and nothing in the event log.

Expected Behavior

Should open

Actual Behavior

The odd thing is that if I open Powershell (x64) it will open. But if I try to open a new tab, it crashes with this:

Faulting application name: WindowsTerminal.exe, version: 1.19.2401.30002, time stamp: 0x65b9ada4 Faulting module name: Windows.UI.Xaml.dll, version: 10.0.22621.3155, time stamp: 0xa0b6eeba Exception code: 0xc000027b Fault offset: 0x0000000000873530 Faulting process id: 0x0x71E8 Faulting application start time: 0x0x1DA65063E2CFEFC Faulting application path: C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.19.10302.0_x648wekyb3d8bbwe\WindowsTerminal.exe Faulting module path: C:\Windows\System32\Windows.UI.Xaml.dll Report Id: 49a8f447-eb8c-4473-94b1-5c94f3088e53 Faulting package full name: Microsoft.WindowsTerminal_1.19.10302.0_x648wekyb3d8bbwe Faulting package-relative application ID: App

github-actions[bot] commented 7 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

cmarkwick365 commented 7 months ago

Btw I already tried repairing and uninstalling/re-installing.

carlos-zamora commented 7 months ago

Thanks for filing. Could you capture a trace using Feedback Hub? This'll help us look into the issue further.

/feedback

zadjii-msft commented 7 months ago

\

Hi there!

Can you please send us feedback with the Feedback Hub with this issue? Make sure to click the "Start recording" button, then reproduce the issue before submitting the feedback. Once it's submitted, paste the link here so we can more easily find your crash information on the back end?

Thanks!

image

image

image

cmarkwick365 commented 7 months ago

Captured on Feedback Hub

c0ony commented 7 months ago

I am having the same issue on a fresh win 11. It was working on this computer with no issues before a bad GPU install wrecked everything and I was forced to do a full reinstall of win11. Now, the terminal won't open at all, even though I can open PowerShell and Command Prompt with no issues.

carlos-zamora commented 7 months ago

Captured on Feedback Hub

Thanks! Would you mind sharing the link so we could look at it?

Exsshly commented 7 months ago

Reinstall Terminal, try to turn off Settings-Rendering-Use the new text renderer("AtlasEngine") may help.

cmarkwick365 commented 7 months ago

@Samary1999 I already had renderer("AtlasEngine") set.

cmarkwick365 commented 7 months ago

Waiting for feedback. Still an issue.

zadjii-msft commented 7 months ago

@cmarkwick365 When you filed feedback, you need to click this button: https://user-images.githubusercontent.com/18221333/62478649-6de55400-b760-11e9-806e-5aab7e085a9f.png

And paste the link it generates here. Otherwise, it's impossible for us to find the feedback you filed. Thanks!

cmarkwick365 commented 7 months ago

@zadjii-msft Here is the feedback link https://aka.ms/AApeuqb

zadjii-msft commented 7 months ago

open-feedback 368f2413-72d0-40a5-a2c2-300af71872cd

{
 "version": 7,
 "providerName": "Microsoft.Windows.Terminal.App",
 "hresult": "2147942402",
 "fileName": "C:\\__w\\1\\s\\src\\cascadia\\TerminalApp\\AppActionHandlers.cpp",
 "lineNumber": "459",
 "module": "TerminalApp.dll",
 "failureType": "2",
 "message": "",
 "threadId": "11248",
 "callContext": "",
 "originatingContextId": "0",
 "originatingContextName": "",
 "originatingContextMessage": "",
 "currentContextId": "0",
 "currentContextName": "",
 "currentContextMessage": ""
},
{
 "version": 7,
 "providerName": "Microsoft.Windows.Terminal.App",
 "hresult": "2147942402",
 "fileName": "C:\\__w\\1\\s\\src\\cascadia\\TerminalApp\\TabManagement.cpp",
 "lineNumber": "92",
 "module": "TerminalApp.dll",
 "failureType": "1",
 "message": "winrt::hresult_error: The system cannot find the file specified.",
 "threadId": "11248",
 "callContext": "",
 "originatingContextId": "0",
 "originatingContextName": "",
 "originatingContextMessage": "",
 "currentContextId": "0",
 "currentContextName": "",
 "currentContextMessage": ""
},

at the bottom of TerminalPage::_OpenNewTab

https://github.com/microsoft/terminal/blob/563b7312b62fd68596ccb4a66af6217852f77ed9/src/cascadia/TerminalApp/TabManagement.cpp#L92

{
 "version": 7,
 "providerName": "Microsoft.Windows.Terminal.Connection",
 "hresult": "2147942402",
 "fileName": "C:\\__w\\1\\s\\src\\inc\\til\\env.h",
 "lineNumber": "132",
 "module": "TerminalConnection.dll",
 "failureType": "1",
 "message": "",
 "threadId": "11248",
 "callContext": "",
 "originatingContextId": "0",
 "originatingContextName": "",
 "originatingContextMessage": "",
 "currentContextId": "0",
 "currentContextName": "",
 "currentContextMessage": ""
},
{
 "version": 7,
 "providerName": "Microsoft.Windows.Terminal.Connection",
 "hresult": "2147942402",
 "fileName": "",
 "lineNumber": "0",
 "module": "TerminalConnection.dll",
 "failureType": "1",
 "message": "C:\\__w\\1\\s\\src\\inc\\til\\env.h(150)\\TerminalConnection.dll!00007FFD4FBF9160: (caller: 00007FFD4FBE7049) Exception(1) tid(2bf0) 80070002 The system cannot find the file specified.\r\n",
 "threadId": "11248",
 "callContext": "",
 "originatingContextId": "0",
 "originatingContextName": "",
 "originatingContextMessage": "",
 "currentContextId": "0",
 "currentContextName": "",
 "currentContextMessage": ""
}

https://github.com/microsoft/terminal/blob/9acb15b626571f145c551cca93407954592e40bd/src/inc/til/env.h#L150

interesting...

zadjii-msft commented 7 months ago

Wild. Pretty sure this is around

https://github.com/microsoft/terminal/blob/9acb15b626571f145c551cca93407954592e40bd/src/inc/til/env.h#L423-L428

can you run conhost -- cmd from the Run dialog, then run set, and copy-paste the output here[^1]? Looks like there's some env var somewhere in there that's blowing up our env var loader/?

Alternatively, testing if this repros the same in 1.20 preview

[^1]: this may have some amount of PII in it

lhecker commented 7 months ago

Hm. The dump files indicate that you've been using Windows Terminal 1.18. Are you sure you were on version 1.19?

As an aside, your dumps also show that your Intel graphics driver (igdkmd64.sys specifically) is using outdated APIs and is causing kernel crashes every once in a while. I'm not sure if newer drivers are available to you, but please try updating them.

zadjii-msft commented 7 months ago

Specifically the dumps reference Terminal v1.18.3181.0. There was one last 1.18 servicing release, Terminal v1.18.10301.0, which had a couple additional fixes in it, but nothing that immediately stands out.

cmarkwick365 commented 7 months ago

image

zadjii-msft commented 7 months ago

Weird, but okay 🤷 feedback hub is wack sometimes. The env vars might still be helpful.

cmarkwick365 commented 7 months ago

Still waiting for a resolution.

mhjartstrom commented 7 months ago

Reinstall Terminal, try to turn off Settings-Rendering-Use the new text renderer("AtlasEngine") may help.

Not quite sure I'm seeing the exact same issue, but turning off "AtlasEngine" seems to help me... My WindowsTerminal has crashed frequently the last week or so, sometimes e.g. when doing git log but also when rescaling the window, creating crash dumps and logs quite similar to the original poster's crash log above.

I can't tell when the "AtlasEngine" was enabled by default, but I'm running 1.19.10573.0 and according to https://devblogs.microsoft.com/commandline/windows-terminal-preview-1-20-release/ the "AtlasEngine" was enabled by default in the 1.20 preview release? Hence I should not have been affected by this, still I am (or at least was until now)...

I've not had a crash all day, since I disabled it. Before that, Windows Terminal had become useless and I had to run wsl.exe from the Command Prompt instead.

cmarkwick365 commented 7 months ago

@mhjartstrom Thanks for the suggestion. It did not make a difference.

jmpecx commented 7 months ago

Reinstall Terminal, try to turn off Settings-Rendering-Use the new text renderer("AtlasEngine") may help.重新安装终端,尝试关闭设置-渲染-使用新的文本渲染器(“AtlasEngine”)可能会有所帮助。

you save me a lot

zadjii-msft commented 6 months ago

Another idea:

lhecker commented 6 months ago

@mhjartstrom @jmpecx The option to disable AtlasEngine will go away in the future. Could you please assist me in figuring out why it crashes? To do so, please enable AtlasEngine again and send me a crash dump. You can find my email address in my GitHub profile. Here's how to enable crash dumps: https://github.com/microsoft/terminal/wiki/Troubleshooting-Tips#capture-automatically

cmarkwick365 commented 6 months ago

@lhecker Email sent with dump file.

mhjartstrom commented 6 months ago

@lhecker Email sent with dump file.

lhecker commented 6 months ago

@mhjartstrom Thanks for the dump! Unfortunately I can't quite pinpoint the origin of the heap corruption. Would you be willing to help me further test this?

If so, one thing I'd like to test is whether Windows Terminal Canary crashes for you. You can install it here: https://aka.ms/terminal-canary-installer After installing it, make sure it has imported all your settings from your regular Windows Terminal. (Otherwise open the settings file with Ctrl+Shift+, in both applications and copy it over.)

mhjartstrom commented 6 months ago

@lhecker OK, I've sent another crash dump for when using Windows Terminal Canary.

cmarkwick365 commented 6 months ago

@lhecker resent dump file. Canary had the same behavior.

cmarkwick365 commented 6 months ago

@lhecker I take it that you noticed this in the dump I sent? FAILURE_BUCKET_ID: STOWED_EXCEPTION_XAML_TEXT_Class_not_registered_80040154_Microsoft.UI.Xaml.dll!winrt::hresult_error::hresult_error

lhecker commented 6 months ago

@cmarkwick365 For others it's crashing due to a heap corruption, but your terminal is crashing in an entirely different place. I believe your system may be corrupted, because I can see:

*** WARNING: Check Image - Checksum mismatch - Dump: 0x12261cd, File: 0x1226255 - C:\Symbols\sym\Windows.UI.Xaml.dll\E6498AA71226000\Windows.UI.Xaml.dll

I would suggest checking your system with chkdsk, dism and sfc. For instance:

chkdsk C: /f
dism /Online /Cleanup-image /Restorehealth
sfc /scannow

If it is a corruption of Windows.UI.Xaml.dll, it may be necessary to reinstall Windows. I'm not 100% sure if it's a corruption though - I certainly haven't seen this warning before.


@mer30hamid @mhjartstrom I'll address you both in this comment, because I've asked both of you for dumps and both of you have heap corruptions.

Coincidentally, you also both use 8+ year old Intel Graphics drivers. Can you check if there's a newer driver available for you? You can find instructions on how to find the latest drivers here: https://www.intel.com/content/www/us/en/support/articles/000005629/graphics/processor-graphics.html

In theory it should be one of these 2 drivers: https://www.intel.com/content/www/us/en/search.html#sort=relevancy&f:@tabfilter=[Downloads]&f:@stm_10385_en=[Graphics,Processor%20Graphics,Intel%C2%AE%20HD%20Graphics%20Family]&f:@operatingsystem_en=[Windows%2011%20Family*] (I know I selected Windows 11 there, but I think this is fine. If you go to each of the driver's pages it'll say that it's compatible with Windows 10.)

mer30hamid commented 6 months ago

@cmarkwick365 For others it's crashing due to a heap corruption, but your terminal is crashing in an entirely different place. I believe your system may be corrupted, because I can see:

*** WARNING: Check Image - Checksum mismatch - Dump: 0x12261cd, File: 0x1226255 - C:\Symbols\sym\Windows.UI.Xaml.dll\E6498AA71226000\Windows.UI.Xaml.dll

I would suggest checking your system with chkdsk, dism and sfc. For instance:

chkdsk C: /f
dism /Online /Cleanup-image /Restorehealth
sfc /scannow

If it is a corruption of Windows.UI.Xaml.dll, it may be necessary to reinstall Windows. I'm not 100% sure if it's a corruption though - I certainly haven't seen this warning before.

@mer30hamid @mhjartstrom I'll address you both in this comment, because I've asked both of you for dumps and both of you have heap corruptions.

Coincidentally, you also both use 8+ year old Intel Graphics drivers. Can you check if there's a newer driver available for you? You can find instructions on how to find the latest drivers here: https://www.intel.com/content/www/us/en/support/articles/000005629/graphics/processor-graphics.html

In theory it should be one of these 2 drivers: https://www.intel.com/content/www/us/en/search.html#sort=relevancy&f:@tabfilter=[Downloads]&f:@stm_10385_en=[Graphics,Processor%20Graphics,Intel%C2%AE%20HD%20Graphics%20Family]&f:@operatingsystem_en=[Windows%2011%20Family*] (I know I selected Windows 11 there, but I think this is fine. If you go to each of the driver's pages it'll say that it's compatible with Windows 10.)

I tried to update my intel graphic driver but no update available for it, I have dual graphic processor and switched to NVIDIA and problem is gone!

image

mhjartstrom commented 6 months ago

@lhecker There is no newer Intel graphics card driver as far as I can tell. But it's working splendidly without the AtlasEngine, so I take it that this is caused by something that you do, not that Intel does?

lhecker commented 6 months ago

It's unfortunate to hear that the newer drivers don't work for you! I was hoping you two would be using a 6th gen Intel CPU or newer, because then you could use the 30.* series drivers that I've linked above.

But it's working splendidly without the AtlasEngine, so I take it that this is caused by something that you do, not that Intel does?

Graphics drivers run in user-mode nowadays, within each process (within WindowsTerminal.exe). If the driver has a bug then this can cause the application to crash. Normally, I wouldn't assume that it's a driver bug, but given that @mer30hamid can resolve this issue by simply switching to his Nvidia GPU, it makes me very, very suspicious of your Intel GPU drivers. AtlasEngine has no vendor-specific code, so no matter whether you use your Intel or any other GPU, the exact same code with the exact same inputs should be running. If it's crashing with one GPU driver but not the other then this is somewhat suspicious.

The reason it works when AtlasEngine is disabled is because the older text renderer is based on Direct2D which uses older and simpler graphics APIs. However, AtlasEngine has an internal mode to use Direct2D as well, which is currently only activated when it runs on very old GPUs.

So my idea to resolve your issue is to simply add a setting to Windows Terminal that forces it to use Direct2D for rendering. @mhjartstrom If you want to help test my idea can you try running these commands?

d3dconfig apps --add WindowsTerminal.exe
d3dconfig device feature-level-limit=9_3

Afterwards, restart Windows Terminal. Does it still crash then?

When you're done with testing I would recommend running

d3dconfig --reset --confirm

and disabling AtlasEngine again.

mer30hamid commented 6 months ago

can you try running these commands?

d3dconfig apps --add WindowsTerminal.exe
d3dconfig device feature-level-limit=9_3

Yes!

Afterwards, restart Windows Terminal. Does it still crash then?

No ! no crash anymore even I enabled the "AtlasEngine" option

After running this command: d3dconfig --reset --confirm windows terminal crashed again by resizing, so I disabled "AtlasEngine" again.

mhjartstrom commented 6 months ago

... @mhjartstrom If you want to help test my idea can you try running these commands?

d3dconfig apps --add WindowsTerminal.exe
d3dconfig device feature-level-limit=9_3

Afterwards, restart Windows Terminal. Does it still crash then?

I would very much like to help out, as I'm eager to have this issue resolved, but now I'm on vacation two weeks starting today... I'll be sure to try this out as soon as I'm back - if you still want me to, or are you on a deadline for this?

mhjartstrom commented 6 months ago

... @mhjartstrom If you want to help test my idea can you try running these commands?

d3dconfig apps --add WindowsTerminal.exe
d3dconfig device feature-level-limit=9_3

Afterwards, restart Windows Terminal. Does it still crash then?

I would very much like to help out, as I'm eager to have this issue resolved, but now I'm on vacation two weeks starting today... I'll be sure to try this out as soon as I'm back - if you still want me to, or are you on a deadline for this?

For reference, it indeed does seem to resolve the issue to use the mentioned d3dconfig commands.

cmarkwick365 commented 6 months ago

Windows Terminal started working again for me again. Whatever was in the latest release must have fixed it.

zhangbaozhe commented 4 months ago

Reinstall Terminal, try to turn off Settings-Rendering-Use the new text renderer("AtlasEngine") may help.

This worked. I opened Windows Terminal in Admin mode and changed the settings. It worked. Thanks!

cmarkwick365 commented 4 months ago

Reinstall Terminal, try to turn off Settings-Rendering-Use the new text renderer("AtlasEngine") may help.

This worked. I opened Windows Terminal in Admin mode and changed the settings. It worked. Thanks!

That wasn't the issue. It resolved itself after an update.

lhecker commented 4 months ago

Many of you are probably using MacType which had a bug that made us crash (to be clear, it's not a bug in Windows Terminal). Since this comes up relatively often, we have recently added some code to detect the outdated MacType versions here: #17369

The latest MacType version contains the fix: https://github.com/snowie2000/mactype/releases