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

Windows terminal attempts to start but then crashes without showing main window. #8358

Closed
PreetSangha opened this issue Nov 22, 2020 · 35 comments
Assignees
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-1 A description (P1) Product-Terminal The new Windows Terminal. Resolution-Fix-Available It's available in an Insiders build or a release Severity-Crash Crashes are real bad news.
Milestone

Comments

@PreetSangha
Copy link

PreetSangha commented Nov 22, 2020

Environment

Windows build number: 10.0.20226.0
Windows Terminal version (if applicable): 1.4.3243.0

Any other software? **please tell me how to gather that info and I'll send it to you**

Steps to reproduce

I've just noticed this today. Whenever I start terminal (either by gui or wt command line - admin or not) Terminal shows an icon in the taskbar but then crashes without showing window. I was able to use windows terminal earlier this week with no problem. The issue happened on the version v1.3.2651.0, which is where I noticed the error. I did an upgrade to the current version to ensure I had the latest binaries.

Expected behavior

Windows Terminal should start normally

Actual behavior

Terminal shows an icon in the taskbar but then crashes without showing window.

Faulting module name: ucrtbase.dll, version: 10.0.20226.1000, time stamp: 0x88427a69
Exception code: 0xc0000409
Fault offset: 0x000000000007cb9e
Faulting process id: 0xba20
Faulting application start time: 0x01d6c0640a4832d1
Faulting application path: C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.4.3243.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe
Faulting module path: C:\WINDOWS\System32\ucrtbase.dll
Report Id: 9108696c-1d8c-4343-bceb-6f75db8896c7
Faulting package full name: Microsoft.WindowsTerminal_1.4.3243.0_x64__8wekyb3d8bbwe
Faulting package-relative application ID: App``

````Fault bucket 2267956675769727742, type 5
Event Name: MoBEX
Response: Not available
Cab Id: 0

Problem signature:
P1: Microsoft.WindowsTerminal_1.4.3243.0_x64__8wekyb3d8bbwe
P2: praid:App
P3: 1.4.2011.19003
P4: 5fb70b02
P5: ucrtbase.dll
P6: 10.0.20226.1000
P7: 88427a69
P8: 000000000007cb9e
P9: c0000409
P10: 0000000000000007

Attached files:
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.67b2bbd3-7759-427e-9dfb-3c43cf740504.tmp.mdmp
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.e6c5fb30-ec96-4745-8fec-20cfda4ee56e.tmp.WERInternalMetadata.xml
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.0b74bb08-4be0-437a-840c-e872736cc6c0.tmp.xml
WPR_initiated_DiagTrackMiniLogger_OneTrace User Logger 20201119 1 Event Collector_0_inject.etl
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.5c351159-c0bc-4eea-a4ed-51b4cc7bb056.tmp.etl
WPR_initiated_DiagTrackMiniLogger_WPR System Collector_inject.etl
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.747a5642-aeff-4533-a0e4-35c385bb3111.tmp.etl
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.9de3551d-1f3c-47fd-995f-ece2da088de9.tmp.csv
\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER.a91c7939-254c-4ea0-a814-9d17053b2b94.tmp.txt

These files may be available here:
\\?\C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_Microsoft.Window_9caf26d4a58d33ffb8b9fb72dfc83bbe1722d_b0038913_d0e460cc-ff68-4dae-8ee6-0df080fced91

Analysis symbol: 
Rechecking for solution: 0
Report Id: 9108696c-1d8c-4343-bceb-6f75db8896c7
Report Status: 2147487744
Hashed bucket: f34e6a2b8b76f1998f796694993afafe
Cab Guid: 0

Have uploaded the contents of C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_Microsoft.Window_9caf26d4a58d33ffb8b9fb72dfc83bbe1722d_b0038913_d0e460cc-ff68-4dae-8ee6-0df080fced91 to secure@microsoft.com referenceing this issue. I cannot find the other files listed in the above error log event. I've repeated this a few times an each time the other files are not present.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Nov 22, 2020
@DHowett
Copy link
Member

DHowett commented Nov 22, 2020

Thanks. Unfortunately, I can't get the dumps from secure@microsoft.com. Would you mind sharing the same content with me? My Microsoft e-mail address is on my profile.

Thank you. 😄

@DHowett DHowett added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Nov 22, 2020
@PreetSangha
Copy link
Author

PreetSangha commented Nov 22, 2020 via email

@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 Nov 22, 2020
@DHowett
Copy link
Member

DHowett commented Nov 22, 2020

Thanks! Would you mind sharing your settings file? It's in %LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json

It should be fine to paste in here or in a gist

I managed to get a dump from your crash report (thank you for leaving crash reporting enabled!) that implicated settings handling, but it's been stripped of all fun and useful information 😄

@PreetSangha
Copy link
Author

Here you do @DHowett

// This file was initially generated by Windows Terminal 1.4.3243.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.

// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
    "$schema": "https://aka.ms/terminal-profiles-schema",

    "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",

    // You can add more global application settings here.
    // To learn more about global settings, visit https://aka.ms/terminal-global-settings

    // If enabled, selections are automatically copied to your clipboard.
    "copyOnSelect": false,

    // If enabled, formatted data is also copied to your clipboard
    "copyFormatting": false,

    // A profile specifies a command to execute paired with information about how it should look and feel.
    // Each one of them will appear in the 'New Tab' dropdown,
    //   and can be invoked from the commandline with `wt.exe -p xxx`
    // To learn more about profiles, visit https://aka.ms/terminal-profile-settings
    "profiles":
    {
        "defaults":
        {
            // Put settings here that you want to apply to all profiles.
        },
        "list":
        [
            {
                // Make changes here to the powershell.exe profile.
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "Windows PowerShell",
                "commandline": "powershell.exe",
                "hidden": false
            },
            {
                // Make changes here to the cmd.exe profile.
                "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
                "name": "Command Prompt",
                "commandline": "cmd.exe",
                "hidden": false
            },
            {
                "guid": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
                "hidden": false,
                "name": "Ubuntu-20.04",
                "source": "Windows.Terminal.Wsl"
            },
            {
                "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
                "hidden": false,
                "name": "Azure Cloud Shell",
                "source": "Windows.Terminal.Azure"
            }
        ]
    },

    // Add custom color schemes to this array.
    // To learn more about color schemes, visit https://aka.ms/terminal-color-schemes
    "schemes": [],

    // Add custom actions and keybindings to this array.
    // To unbind a key combination from your defaults.json, set the command to "unbound".
    // To learn more about actions and keybindings, visit https://aka.ms/terminal-keybindings
    "actions":
    [
        // Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
        // These two lines additionally bind them to Ctrl+C and Ctrl+V.
        // To learn more about selection, visit https://aka.ms/terminal-selection
        { "command": {"action": "copy", "singleLine": false }, "keys": "ctrl+c" },
        { "command": "paste", "keys": "ctrl+v" },

        // Press Ctrl+Shift+F to open the search box
        { "command": "find", "keys": "ctrl+shift+f" },

        // Press Alt+Shift+D to open a new pane.
        // - "split": "auto" makes this pane open in the direction that provides the most surface area.
        // - "splitMode": "duplicate" makes the new pane use the focused pane's profile.
        // To learn more about panes, visit https://aka.ms/terminal-panes
        { "command": { "action": "splitPane", "split": "auto", "splitMode": "duplicate" }, "keys": "alt+shift+d" }
    ]
}

@DHowett
Copy link
Member

DHowett commented Nov 22, 2020

Huh, alright. I'll need a bit to think about this.

We added some new crash handlers in 1.4 that will make it easier to get information from these crashes, but I need some time to write up the instructions. We've never used them before! 😁

@DHowett DHowett removed the Needs-Attention The core contributors need to come back around and look at this ASAP. label Nov 22, 2020
@DHowett DHowett self-assigned this Nov 22, 2020
@DHowett DHowett added Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-1 A description (P1) Product-Terminal The new Windows Terminal. Severity-Crash Crashes are real bad news. labels Nov 22, 2020
@PreetSangha
Copy link
Author

I don't know if it means anything but I'm using Oh My Posh and powershell is the the default shell I use.

@DHowett
Copy link
Member

DHowett commented Nov 22, 2020

Alright, this is a long shot.

  1. Can you download this file (https://gist.githubusercontent.com/DHowett/2636e8bf86a837ffa16293acf803bb52/raw/15fd93e628e620578a7595408c88c8bce2fda4a6/Terminal.wprp), raw, and save it as Terminal.wprp?
  2. As an administrator, run wpr -start C:\Path\To\Terminal.wprp!Terminal (the !Terminal part is important)
  3. Launch terminal and crash it.
  4. As an administrator, run wpr -stop C:\Users\MyUserName\Desktop\terminal.etl
  5. E-mail me a copy of terminal.etl

It should only contain information generated by Terminal, so it's fairly minimal. 😄

@DHowett
Copy link
Member

DHowett commented Nov 22, 2020

I apologize -- I just updated Terminal.wprp for something I forgot.

@DHowett
Copy link
Member

DHowett commented Nov 22, 2020

Alright, so this is a really strange crash. Can you add "fontFace": "Consolas" to the Windows PowerShell profile in your settings? I've never seen this before, but the text renderer is failing to find a font (our default font, Cascadia Mono, which comes with the application(!)) and actually failing because of it. That's totally new.

@DHowett
Copy link
Member

DHowett commented Nov 22, 2020

Error info:

{2291683331; ; 0; TerminalApp.dll; 1;
winrt::hresult_error: A font file could not be opened because the
file, directory, network location, drive, or other storage location
does not exist or is unavailable.; 39812; ; 0; ; ; 0; ; }

@PreetSangha
Copy link
Author

That worked. Thank you do much for you efforts and so quickly.

So where would the font be :-D

@PreetSangha
Copy link
Author

Ok I reinstalled the fonts. But it still doesn't work if I remove the "fontFace": "Consolas" from the profile.

@KalleOlaviNiemitalo
Copy link

The Untrusted Font Blocking policy setting comes to mind, but Windows Terminal appears to use DirectWrite rather than GDI, so I'm not sure the setting matters at all.

@DHowett
Copy link
Member

DHowett commented Nov 23, 2020

Quick question -- can you run sc.exe query FontCache?

@KalleOlaviNiemitalo Good thinking! I gave blocking a shot but was unable to repro this, unfortunately. You're right that it doesn't seem to apply here 😄

@DHowett
Copy link
Member

DHowett commented Nov 23, 2020

Since we've isolated the issue to being DirectWrite-related (that error code is in the DWrite error namespace 😄), if you're feeling up to it I would love to get a DirectWrite ETL from you during the crash!

  1. this file -> DirectWrite.wprp
  2. wpr -start DirectWrite.wprp
  3. crash Terminal!
  4. wpr -stop dwrite.etl
  5. mail up a copy of dwrite.etl 😁

If I can't figure this one out, I'll forward it straight on to my friends over in DWrite.

@PreetSangha
Copy link
Author

Ok step 1:
image

@PreetSangha
Copy link
Author

PreetSangha commented Nov 24, 2020

Step 2: I commented ou tthe default font face of consolas
image

However Terminal no longer crashes.

If we can work what I need to do to get it that state again (:-D) I'm happy to create etl for you.

@DHowett DHowett removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Nov 24, 2020
@greg-hammond
Copy link

greg-hammond commented Dec 12, 2020

I have the same problem, and does not appear to be related to fontFace setting as described above.
Version: 1.4.3243.0
Description: Open wt => it opens, seemingly normally, then the window just vaporizes anywhere from 2-10 seconds later (without doing any typing or mouse clicks inside the window)
I changed settings to use cmd as the default window.
I've never seen this before today, and use wt most days.
Windows 10 2004 19041.685

attempted resolution steps:

  • tried "repair", no luck
  • tried "reset", no luck
  • after the reset, went into settings.json and added "fontFace": "Consolas" under the "defaults", no luck.

I am going to send you an etl file using your instructions above.

TIA for your help!

Update 6/27/21: 6 months later. still crashing, still not resolved. maybe different causes/mechanisms, but i'm not spending any more time triaging this stuff. it's a terminal program. #uninstall #cmd-works-for-me #bash-works-for-me.

@watfordsuzy
Copy link

@DHowett I'm receiving the same crash as @PreetSangha. Adding the fontFace to every terminal I use fixed it for me.

Of note:

  • Terminal was active on Monday (2021-05-24), and I used it all day
  • I was out-of-office yesterday (2021-05-25)
  • I came back in today (2021-05-26) to find Terminal is no longer open (no crash event in Event Viewer on the 24th or 25th)
  • Attempts to relaunch it failed with the crash in ucrtbase

For posterity:

Faulting application name: WindowsTerminal.exe, version: 1.8.2105.24004, time stamp: 0x60ac2e94
Faulting module name: ucrtbase.dll, version: 10.0.19041.789, time stamp: 0x2bd748bf
Exception code: 0xc0000409
Fault offset: 0x000000000007286e
Faulting process id: 0x43fc
Faulting application start time: 0x01d7524345d1c165
Faulting application path: C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.8.1444.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe
Faulting module path: C:\Windows\System32\ucrtbase.dll
Report Id: b3ff4c65-b83c-416e-b836-059fad70f14c
Faulting package full name: Microsoft.WindowsTerminal_1.8.1444.0_x64__8wekyb3d8bbwe
Faulting package-relative application ID: App

I've emailed you the WER package.

@DHowett
Copy link
Member

DHowett commented May 26, 2021

Thanks for this -- that is a really useful data point.

@SpitFire-666
Copy link

SpitFire-666 commented May 26, 2021

Same here. Worked yesterday, rebooted computer, now WT won't launch.

Faulting application name: WindowsTerminal.exe, version: 1.8.2105.24004, time stamp: 0x60ac2e94
Faulting module name: ucrtbase.dll, version: 10.0.19041.789, time stamp: 0x2bd748bf
Exception code: 0xc0000409
Fault offset: 0x000000000007286e
Faulting process ID: 0x2858
Faulting application start time: 0x01d75284d2841d36
Faulting application path: C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.8.1444.0_x64__8wekyb3d8bbwe\WindowsTerminal.exe
Faulting module path: C:\WINDOWS\System32\ucrtbase.dll
Report ID: 738df3c9-37ab-4ad0-b704-666f6e33a2c1
Faulting package full name: Microsoft.WindowsTerminal_1.8.1444.0_x64__8wekyb3d8bbwe
Faulting package-relative application ID: App

I tried adding the fontface lines to the profiles in the .json, but no luck:
image

@DHowett
Copy link
Member

DHowett commented May 26, 2021

If you're impacted by this after the 1.8 update, can you go into Settings > Applications > All Applications, choose Windows Terminal and then Repair? We've heard that this helps.

@SpitFire-666
Copy link

@DHowett yep that worked! Thanks.

@Simran-B
Copy link

Just ran into the same issue. Terminal was working fine yesterday, today it wouldn't launch. If I add "fontFace": "Consolas" in settings.json under profiles.defaults then it starts just fine. However, resetting the app also worked for me. I will send the diagnostic files just in case.

@watfordsuzy
Copy link

@campbellkerr as a quick note your JSON was missing commas after the source property and before the fontFace property, which would have been an impact.

@x86txt
Copy link

x86txt commented May 29, 2021

I started experiencing this, but only on one profile on my machine. It still works perfectly on the other. I've tried the reset, repair, restoring the .backup profile, and even adding the default font consolas setting. Nothing works for me, it opens and crashes with the same MobEx error. It stopped working a few days ago, FWIW. It had worked perfectly fine up until then.

@riprwwa
Copy link

riprwwa commented May 31, 2021

Same here, working on Friday, not working on Monday, with similar event viewer details:

Faulting application name: WindowsTerminal.exe, version: 1.9.2105.24005, time stamp: 0x60ac3929
Faulting module name: ucrtbase.dll, version: 10.0.19041.789, time stamp: 0x2bd748bf
Exception code: 0xc0000409
Fault offset: 0x000000000007286e
Faulting process id: 0x4f24
Faulting application start time: 0x01d755b84ae7db8d
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: 8673480e-1061-4c66-a519-e437e727e907
Faulting package full name: Microsoft.WindowsTerminalPreview_1.9.1445.0_x64__8wekyb3d8bbwe
Faulting package-relative application ID: App

Repairing did help.

@NeKJ
Copy link

NeKJ commented Jun 1, 2021

Alright, so this is a really strange crash. Can you add "fontFace": "Consolas" to the Windows PowerShell profile in your settings? I've never seen this before, but the text renderer is failing to find a font (our default font, Cascadia Mono, which comes with the application(!)) and actually failing because of it. That's totally new.

This worked for me too. I added the "fontFace": "Consolas", on all my profiles (profiles.list array) and voila it worked. Now I need to find out how to restore my settings after numerous uninstallers/repairs and resets...

@zadjii-msft
Copy link
Member

If folks are coming to this thread after the update to 1.8.1444 or 1.9.1445 - the original issue in this thread probably isn't the root cause you're actually hitting right now. That's more likely #10211.

That being said, they're both caused by the same thing - failing to open the font as we're creating the window, and then us throwing an exception instead of logging the error and letting font fallback do it's thing.

@DHowett We never did get a solid repro on OP's issue, but I'm guessing that #10260 will fix this as well. Sanity check that?

@DHowett
Copy link
Member

DHowett commented Jun 1, 2021 via email

@Rafagd
Copy link

Rafagd commented Jun 1, 2021

Just ran into the same issue. Terminal was working fine yesterday, today it wouldn't launch. If I add "fontFace": "Consolas" in settings.json under profiles.defaults then it starts just fine. However, resetting the app also worked for me. I will send the diagnostic files just in case.

Restart, Reset, Repair and Uninstall/Reinstall did not work for me. But this instantly solved the problem.

@x86txt
Copy link

x86txt commented Jun 1, 2021

If folks are coming to this thread after the update to 1.8.1444 or 1.9.1445 - the original issue in this thread probably isn't the root cause you're actually hitting right now. That's more likely #10211.

That being said, they're both caused by the same thing - failing to open the font as we're creating the window, and then us throwing an exception instead of logging the error and letting font fallback do it's thing.

@DHowett We never did get a solid repro on OP's issue, but I'm guessing that #10260 will fix this as well. Sanity check that?

I randomly tried again today and it's working. I'm on version 1.8.1444.0. As per a comment in #10211 - I too did reboot my machine in between, so perhaps that is what it needed for the font to be recognized?

Either way, it's sooo nice to have it back. I forgot how much of a PITA cmd.exe was compared to it. Nice job, folks.

@Talmanes
Copy link

Talmanes commented Jun 2, 2021

Same problem fixed by adding the fontFace. Realized not all Cascadia Code fonts were imported, just the most basic one from Terminal install. Installed all from https://github.com/microsoft/cascadia-code/releases/tag/v2105.24, specifically the OTF files. Can now remove fontFace and it loads normally.

@x86txt
Copy link

x86txt commented Jun 4, 2021

Problem came back after I adjusted the font settings for cmd and WSL. Attached is the settings.json that are broken.

Renaming it to .old, logging out, and then back in fixes it.
settings.json.old.zip

@zadjii-msft
Copy link
Member

Looking through this thread, the mitigation in #10260 should prevent this from happening in future builds. Of course, if it starts happening again, feel free to let us know.

@zadjii-msft zadjii-msft added the Resolution-Fix-Available It's available in an Insiders build or a release label Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-1 A description (P1) Product-Terminal The new Windows Terminal. Resolution-Fix-Available It's available in an Insiders build or a release Severity-Crash Crashes are real bad news.
Projects
None yet
Development

No branches or pull requests