-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Access violation exception thrown in ConhostV2.dll #162
Comments
Yea I think it's probably fine to post the repro steps. It's only conhost, so it shouldn't be that big of a deal. |
The basic steps to reproduce are:
At this point I think the heap will already be corrupted (or whatever it is that's gone wrong), and just doing something like a directory listing - essentially anything that writes to the screen - should eventually cause a crash. But for an immediate result, I've found that sending the RIS escape sequence works best. So my Python test case looked like this:
But note that this only causes the exception in the Windows cmd shell, and not the WSL bash shell (at least I couldn't get it to crash there). And just to confirm that it wasn't anything specific to Python, I also hacked together an equivalent batch file (the funny characters in this code should be ESC characters):
As I mentioned before, the exact location of the exception can vary, but when run from a newly opened shell, I often got: And in case it helps, this is the stack trace I saw in an attached debugger:
And the exact line in the assembly was:
But hopefully it should be easy for you to reproduce. It happens for me every time. |
I KNEW IT. As soon as you said there was some weird crash, I knew it was this issue. I'd seen it at home a couple times, usually when an ssh session disconnects while I had tmux open, it would crash after switching back to the main buffer, but I'd only ever seen it a few times, and always forgotten about it before I got to work. THANK YOU for reminding me to actually take a look at this, and provide a simple repro and stack. IIRC we did a bunch of work to get rid of our |
I figured this out today and have a fix going to PR. I'll update when it's on the way up and out to Insiders. |
It looks like this went out with 1809. Thanks! |
Microsoft Windows [Version 10.0.16299.371]
I've found that a certain combination of escapes sequences and input consistently causes the console to crash. I suspect it's some kind of heap corruption, because the actual location of the exception can vary depending on what else I've been doing prior to triggering the crash, but it usually occurs in ConhostV2.dll.
Interestingly it only happens in the Windows cmd shell - I can't reproduce the problem in a WSL bash shell. I have reproduced it on multiple machines, though, so I don't think it's something specific to my computer and should hopefully be easy to reproduce.
Before I provide the exact steps to trigger the exception, I just want to double check that it's OK for me to post those details here? I'm always a little concerned that an easily triggerable exception might have security implications, but it's not like it's a BSOD - it's only the shell that crashes.
The shell shouldn't crash. ;)
The text was updated successfully, but these errors were encountered: