-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Neofetch in wsl2(debian) crashes the terminal #4254
Comments
I'm having this same issue with crashing Windows Terminal when running Neofetch in WSL (Ubuntu 16.04) Event Viewer log's
WSL starts as expected (with neofetch) when launching from start menu, or when started with "wsl" or "bash" commands from cmd.exe ("legacy" command prompt) |
Happening to me also, on two separate machines (machine A: WSL2/Ubuntu 19.10, machine B: WSL1/Ubuntu 18.04). On the machine A, I get what looks like the first row of characters in the Ubuntu logo before Terminal freezes for a second and crashes. On machine B, it seems to crash immediately. More details: Machine A: Terminal installed from MS Store. EDIT: for the record, I just installed neofetch natively on Windows via scoop and ran it in Powershell -- it works perfectly. |
I can't seem to reproduce it on my openSUSE distro (Yeah I'm more of a SUSE guy now). It's kind of surprising if this is actually related to distro, though. EDIT: Ignore the distro thing. This is a regression. Last Store build 0.7.3451.0 is good. Current master 6d6fb7f is bad |
I encountered this issue too with the latest release version, Ubuntu 18.04 WSL (1) (Microsoft Windows [Version 10.0.18362.356]). |
@nizmow since you’ve built it from source, you should be able to produce far better debugging information than somebody who installed it from the store. Would you mind? |
I have the same issue when I connect from my Win terminal with ssh to another box (pure linux). After entering a correct pass the app crashes. Reading the comments I may add that after I log into another box I get a neofetch info... |
I just bisected the commits and it seems that #4125 caused this regression. |
This is the result of a
In theory that exception should have been caught, which would still be wrong, but at least not crashing. However, it seems that |
Just to be clear, that's not really the cause. That just fixed an error in the passthrough implementation that was hiding the problem. |
Looks like debugging might not be necessary, but when I get in front of a machine next I’ll give it a shot if still required. Figured it must be an escape sequence. |
Welp, looks like we need #4144 in so we can get going on #4153 and apply the saturating math here. |
As another example of this problem, you can kill conhost in a similar way with the
I know #4144/#4153 should fix many of these issues eventually, but I think it's a serious enough problem that it's worth reverting the state machine clamping ASAP as a quick fix. Either way, I think we should be defining |
I didn't know that was an option. Let's file an issue to consider changing GSL Terminate to GSL Throw. Also, I just merged #4144 now. We could fix this one particular crash by using the saturating math without waiting for all locations to be fixed as a part of #4153. |
I'm not sure what you had in mind, but if you are just planning to fix it in |
I don't have a specific fix in mind. You just said that it used to be clamped and now it isn't. So I supposed we would use clamping math to fix it. Even if that has to be on both sides of the interface. |
I'm not objecting to the use of the new clamping math. I was just suggesting we handle that clamping at the state machine level since that would be the quickest short term solution. If you think it'll be easy to fix everywhere else instead, that'd be great, since that is ultimately what we want - I just thought that would be a lot of work. |
Same thing happened to me while trying neofetch with the Terminal (preview) from Chocolatey, latest version. But yeah it seems independent of the distro you run WSL with |
## Summary of the Pull Request This PR clamps the parameter values in the VT `StateMachine` parser to 32767, which was the initial limit prior to PR #3956. This fixes a number of overflow bugs (some of which could cause the app to crash), since much of the code is not prepared to handle values outside the range of a `short`. ## References #3956 - the PR where the cap was changed to the range of `size_t` #4254 - one example of a crash caused by the higher range ## PR Checklist * [x] Closes #5160 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [x] Tests added/passed * [ ] Requires documentation to be updated * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx ## Detailed Description of the Pull Request / Additional comments The DEC STD 070 reference recommends supporting up to at least 16384 for parameter values, so 32767 should be more than enough for any standard VT sequence. It might be nice to increase the limit to 65535 at some point, since that is the cap used by both XTerm and VTE. However, that is not essential, since there are very few situations where you'd even notice the difference. For now, 32767 is the safest choice for us, since anything greater than that has the potential to overflow and crash the app in a number of places. ## Validation Steps Performed I had to make a couple of modifications to the range checks in the `OutputEngineTest`, more or less reverting to the pre-#3956 behavior, but after that all of the unit tests passed as expected. I manually confirmed that this fixes the hanging test case from #5160, as well as overflow issues in the cursor operations, and crashes in `IL` and `DL` (see #4254 (comment)).
## Summary of the Pull Request This PR clamps the parameter values in the VT `StateMachine` parser to 32767, which was the initial limit prior to PR #3956. This fixes a number of overflow bugs (some of which could cause the app to crash), since much of the code is not prepared to handle values outside the range of a `short`. ## References #3956 - the PR where the cap was changed to the range of `size_t` #4254 - one example of a crash caused by the higher range ## PR Checklist * [x] Closes #5160 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [x] Tests added/passed * [ ] Requires documentation to be updated * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx ## Detailed Description of the Pull Request / Additional comments The DEC STD 070 reference recommends supporting up to at least 16384 for parameter values, so 32767 should be more than enough for any standard VT sequence. It might be nice to increase the limit to 65535 at some point, since that is the cap used by both XTerm and VTE. However, that is not essential, since there are very few situations where you'd even notice the difference. For now, 32767 is the safest choice for us, since anything greater than that has the potential to overflow and crash the app in a number of places. ## Validation Steps Performed I had to make a couple of modifications to the range checks in the `OutputEngineTest`, more or less reverting to the pre-#3956 behavior, but after that all of the unit tests passed as expected. I manually confirmed that this fixes the hanging test case from #5160, as well as overflow issues in the cursor operations, and crashes in `IL` and `DL` (see microsoft/terminal#4254 (comment)).
Does anyone have the procedure for removing neofetch so that I don't have to reconfigure everything? |
@mikelyons you're commenting on a bug with a crash that was fixed 9 months ago. What are you seeing? |
@DHowett I'm just still seeing WSL terminal crashing immediately on launch after a windows update, latest windows updates don't fix it. |
Please file a new bug. It would also help if you follow the feedback hub steps that (I think) are in the bug template. |
You know, there was discussion of some other related crashes (namely in |
Environment
Steps to reproduce
Expected behavior
To show the output of neofetch
Actual behavior
Terminal crashes without any output
The text was updated successfully, but these errors were encountered: