Crash when tabbing (autocomplete)

Topics: User Forum
Jul 17, 2006 at 10:47 PM
(Cant include full callstacks due to limitation of the system)
When I hit TAB while in the cmd shell, DevEnv crashes.

When I try to attach with DevEnv in mixed mode, I get a hang.

Attaching with a native debugger gives an error which is not very useful.

Attaching with a managed debugger is a pain because for some reason the VS Cmd shell addin keeps getting NullReferenceExceptions in the callstack below marked Callstack2.

The actual error in managed code is an ArgumentOutOfRangeException occurring in String::InternalStringWithChecks().

The callstack is below, called Callstack1 and the top-fram which contain this addins code is in ShellTextBox::GetAutoCompleteDir().

> mscorlib.dll!string.InternalSubStringWithChecks(int startIndex, int length, bool fAlwaysCopy) Line 941 C#
Microsoft.VSPowerToys.VSCmdShell.dll!Microsoft.VSPowerToys.VSCmdShell.ShellTextBox.GetAutoCompleteDir(ref string argument) + 0x56 bytes
Microsoft.VSPowerToys.VSCmdShell.dll!Microsoft.VSPowerToys.VSCmdShell.ShellTextBox.CycleAutoComplete(bool forward = true) + 0xaf bytes
Microsoft.VSPowerToys.VSCmdShell.dll!Microsoft.VSPowerToys.VSCmdShell.ShellTextBox.HandleKeyDown(object sender, System.Windows.Forms.KeyEventArgs e) + 0x34c bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.OnKeyDown(System.Windows.Forms.KeyEventArgs e) Line 8791 C#

> Microsoft.VSPowerToys.VSCmdShell.dll!Microsoft.VSPowerToys.VSCmdShell.Connect.windowsEvents_WindowActivated(EnvDTE.Window GotFocus, EnvDTE.Window LostFocus) + 0x15 bytes
EnvDTE.dll!EnvDTE.dispWindowEventsSinkHelper.WindowActivated(EnvDTE.Window A1, EnvDTE.Window A2) + 0x18 bytes
Jul 18, 2006 at 1:23 AM
Does it always happen or does it only occur at certain times? Autocompleting in cmd.exe requires that you have the default prompt (ie: C:\Program Files\>), if it happens at certain times only it would help us a lot if you can send the current directory name and the entry you are trying to auto complete. A screenshot of the VSCmdShell window just before the crash would be really good as well.

Jul 18, 2006 at 7:08 AM
The directory happens to be:


The prompt is properly set (it displays the current directory).

I tab w/o typing anything, so I am expecting to get the first file entry.

This happens every time on the machine I am running vscmdshell on.
Jul 18, 2006 at 5:19 PM
I can't reproduce the behaviour on my system. It works fine with just pressing tab without typing anything. You can try to install debug version by building the source and try debugging it that way.

It should be enough to attach to devenv.exe process that you would be using VSCmdShell in to debug it. Please let us know if you find the location of the problem.

Jul 18, 2006 at 6:51 PM
You need a bunch of sw to build it. Can't polute the machines here with that stuff, and i dont have a readily available VPC with devenv on it.

Guess I will wait until somebody else sees it and fixes it.

(Maybe would be nice to also have released "Debug" versions).
Jul 21, 2006 at 5:26 PM
i can repro as well and had already logged an issue for this:
Sep 3, 2006 at 1:45 AM
Fixes for auto complete issues is going to be included in VSCmdShell 1.1 release which will come very soon.