You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Neofetch in wsl2(debian) crashes the terminal #4254
Windows build number: 19041.21
Windows Terminal version (if applicable): 0.8.10091.0
Any other software?
Debian in WSL2
Steps to reproduce
Open terminal (has wsl2 as default shell)
run neofetch
Expected behavior
To show the output of neofetch
Actual behavior
Terminal crashes without any output
Reacted by Andrew Tinekov, Dmitry Kuznetsov, Othmane, Chester Liu, David Duque, Nick Ntantidakis, Debdut Biswas, Alexey Sosnin, Владислав i++, Matcha and 18 more
Reacted by ByoungHoon Yoon, Sadoff and Adam Mescher
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.
Machine B: Terminal built from source and deployed locally.
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
Neil Houghton (@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.
The error happens at TerminalDispatch::CursorBackward at TerminalDispatch.cpp Line 63. Specifically, narrow_cast() throws since it's unable to cast distance, which has a weird value (9999999) at this point, into short.
This is the result of a CUB escape sequence with a distance of 9999999. I've mentioned this as an issue before - it used to be clamped in the state machine, but that was changed in PR #3956. And the result is it throws an exception in the narrow cast in the TerminalDispatch::CursorBackward handler here:
In theory that exception should have been caught, which would still be wrong, but at least not crashing. However, it seems that GSL_TERMINATE_ON_CONTRACT_VIOLATION is set, so the throw_exception call actually just kills the app.
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.
Dustin L. Howett (@DHowett) I'm just still seeing WSL terminal crashing immediately on launch after a windows update, latest windows updates don't fix it.
You know, there was discussion of some other related crashes (namely in printf "\e[999999999L") in this thread, but those look like they've been fixed in the meantime as well. Unclear when exactly. But the OP, and the follow-up crashes have been fixed, so I'm gonna close this one out.
Activity
aoahonen commentedon Jan 16, 2020
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)
nizmow commentedon Jan 16, 2020
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.
Machine B: Terminal built from source and deployed locally.
EDIT: for the record, I just installed neofetch natively on Windows via scoop and ran it in Powershell -- it works perfectly.
skyline75489 commentedon Jan 16, 2020
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
zadjii-msft commentedon Jan 16, 2020
Wow yea that just crashed the Terminal for me too, pretty immediately, with Ubuntu.
Maybe this is related to the #1360/#4150 class of issues, Michael Niksa (@miniksa) could you verify for me?
armak commentedon Jan 16, 2020
I encountered this issue too with the latest release version, Ubuntu 18.04 WSL (1) (Microsoft Windows [Version 10.0.18362.356]).
DHowett-MSFT commentedon Jan 16, 2020
Neil Houghton (@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?
ntnlabs commentedon Jan 16, 2020
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...
ZhaoMJ commentedon Jan 16, 2020
I just bisected the commits and it seems that #4125 caused this regression.
The error happens at
TerminalDispatch::CursorBackwardat TerminalDispatch.cpp Line 63. Specifically,narrow_cast()throws since it's unable to castdistance, which has a weird value (9999999) at this point, intoshort.j4james commentedon Jan 16, 2020
This is the result of a
CUBescape sequence with a distance of 9999999. I've mentioned this as an issue before - it used to be clamped in the state machine, but that was changed in PR #3956. And the result is it throws an exception in thenarrowcast in theTerminalDispatch::CursorBackwardhandler here:terminal/src/cascadia/TerminalCore/TerminalDispatch.cpp
Line 63 in 701b421
In theory that exception should have been caught, which would still be wrong, but at least not crashing. However, it seems that
GSL_TERMINATE_ON_CONTRACT_VIOLATIONis set, so thethrow_exceptioncall actually just kills the app.j4james commentedon Jan 16, 2020
Just to be clear, that's not really the cause. That just fixed an error in the passthrough implementation that was hiding the problem.
nizmow commentedon Jan 16, 2020
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.
41 remaining items
DHowett commentedon Oct 15, 2020
Mike Lyons (@mikelyons) you're commenting on a bug with a crash that was fixed 9 months ago. What are you seeing?
mikelyons commentedon Dec 4, 2020
Dustin L. Howett (@DHowett) I'm just still seeing WSL terminal crashing immediately on launch after a windows update, latest windows updates don't fix it.
DHowett commentedon Dec 4, 2020
Please file a new bug. It would also help if you follow the feedback hub steps that (I think) are in the bug template.
zadjii-msft commentedon Jul 13, 2021
You know, there was discussion of some other related crashes (namely in
printf "\e[999999999L") in this thread, but those look like they've been fixed in the meantime as well. Unclear when exactly. But the OP, and the follow-up crashes have been fixed, so I'm gonna close this one out.