Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Terminal Crash/Hangs when closing second-last tab quickly #4132

Closed
TBBle opened this issue Jan 7, 2020 · 8 comments
Closed

Terminal Crash/Hangs when closing second-last tab quickly #4132

TBBle opened this issue Jan 7, 2020 · 8 comments
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal. Severity-Crash Crashes are real bad news.
Milestone

Comments

@TBBle
Copy link

TBBle commented Jan 7, 2020

Feedback Hub Link: https://aka.ms/AA6xn1u

Environment

Windows build number: Microsoft Windows NT 10.0.18363.0
Windows Terminal version (if applicable): 0.7.3451.0

Any other software?

Two shells have been involved in reproductions.
* PowerShell Core 7.0.0-rc1 auto-added as a shell. This is my default.
* MSYS has been added as a shell per https://github.com/microsoft/terminal/issues/1669#issuecomment-562082594

Steps to reproduce

Open Terminal, with alwaysShowTabs: false and showTabsInTitlebar: false.
Hit Control-Shift-1, Control-Shift-Tab, Control-Shift-W in sequence repeatedly until terminal crashes.

Note sure if it's the same problem, it showed up when I was trying to repro this more reliably.

Open Terminal, with alwaysShowTabs: false and showTabsInTitlebar: false.
Hit Control-Shift-1 (PowerShell Core my this case), then Control-Shift-W repeatedly until terminal hangs.

Expected behavior

Closing a tab should not crash Terminal.

Actual behavior

Closing a tab occasionally hangs or crashes terminal.

The behaviour of "Open Terminal, Start a different shell, Close the existing shell" is something I do frequently, and I see this crash once or twice in a work-day.

I think it generally happens when I'm just starting a session, but I cannot say with absolute certainty that it hasn't happened when closing a long-lived tab.

I also don't recall having ever triggered it by mouse activity, just Control-Shift-W.

@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 Jan 7, 2020
@DHowett-MSFT DHowett-MSFT added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Severity-Crash Crashes are real bad news. labels Jan 9, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jan 9, 2020
@DHowett-MSFT DHowett-MSFT removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Jan 9, 2020
@DHowett-MSFT DHowett-MSFT added this to the Terminal v1.0 milestone Jan 9, 2020
@mkitzan
Copy link
Contributor

mkitzan commented Jan 14, 2020

Tried a repro, and couldn't get the crash (and I can input pretty fast). @TBBle, is it possible that when you're inputting during a hang it might miss inputs to launch a new tab but receive the inputs correctly to close a tab (causing an extra tab to be closed without launching a new one)? This could close the window if the only remaining tab is closed.

@TBBle
Copy link
Author

TBBle commented Jan 17, 2020

I doubt that's it, because I was definitely getting Application errors in my Event Viewer, and sometimes it would hang Terminal rather than closing it.

That said, a new version of Terminal was just released which fixed #3908 in Terminal v0.8.10091.0, so it's possible I was hitting that, and if you happened to already have that update, then it wouldn't repro. So I'll try and repro it with the version I listed above, if I still have it, and then update to the newer version and try again.

@TBBle
Copy link
Author

TBBle commented Jan 17, 2020

Turns out both the machines I have here have auto-updated to the new version of Terminal, and didn't reproduce the issue on brief testing. So if I'm lucky and my home box has not updated, I can try there. Otherwise, I'll probably have to close this as "Probably #3908 until proven otherwise".

@mkitzan
Copy link
Contributor

mkitzan commented Jan 17, 2020

I just noticed the version in your issue! Yeah, that PR fixed some crashes which repro-ed by opening-closing tabs quickly. It's highly likely that your crash was covered by that PR (or another related PR).

@TBBle
Copy link
Author

TBBle commented Jan 17, 2020

Repro is a little hard, because I often get stopped due to triggering this with my repro steps:
image

I suspect this dialog is really a PowerShell Core bug (I just installed 7.0.0-rc2, perhaps it's new), complaining about STATUS_DLL_INIT_FAILED because the terminal it was expecting to write to has disappeared.

@TBBle
Copy link
Author

TBBle commented Jan 17, 2020

Okay, sounds good. Closing this provisionally as "Fixed by #3908"/"Duplicate of #2947", unless I trigger it again.

For anyone who comes across this later, I didn't originally trigger this by fast-open-close loops, it was just sometimes happening on fast "Start Terminal, start non-default shell, close default shell".

@TBBle TBBle closed this as completed Jan 17, 2020
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Jan 17, 2020
@mkitzan
Copy link
Contributor

mkitzan commented Jan 17, 2020

The PS App Error is a PS thing - I think. If you open and close quickly a stand alone PS shell it does this (if I remember correctly when I tried it last).

@zadjii-msft
Copy link
Member

For the record, I think the 0xc0000142 dialog is because the conhost.exe process that we're spawning to host pwsh.exe closes before pwsh is able to successfully connect. I see this a good amount whenever I write code that accidentally causes conhost to crash immediately on startup :P. In this case, closing the tab this quickly is just closing the conhost too fast.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal. Severity-Crash Crashes are real bad news.
Projects
None yet
Development

No branches or pull requests

4 participants