7.02a reproducable crash with (long?) command lines
Moderators: white, Hacker, petermad, Stefan2
7.02a reproducable crash with (long?) command lines
I'm always having a crash when starting two commands out of the TC command line in a row.
How I can reproduce:
1. open new TC, where you are doesn't matter
2. enter "echo 1...about1500chars...5" without the quotes in the command line input field, I dont know if it matters what the sting is, or how long it is
3. repeat step 2, you can reuse the last command, or type it in again
4. you haven't noticed that TC closed itself?
How I can reproduce:
1. open new TC, where you are doesn't matter
2. enter "echo 1...about1500chars...5" without the quotes in the command line input field, I dont know if it matters what the sting is, or how long it is
3. repeat step 2, you can reuse the last command, or type it in again
4. you haven't noticed that TC closed itself?
Last edited by xrmb on 2007-09-20, 12:34 UTC, edited 1 time in total.
damn, I think I created the widest post ever... I'm to lazy to scroll to the edit button now...
Win2k does execute command correctly the first time, it does not cut of the string or something
Win2k does execute command correctly the first time, it does not cut of the string or something
I was born with Norton Commander, grew up with DCC, after school I played with Windows Commander, graduated, married and had kids with Total Commander and will die using whatever its called then Commander.
See http://support.microsoft.com/default.aspx?scid=kb;en-us;830473.
The maximum command line length in Windows XP or later is 8191 characters (which still does not explain fully
the strange 'File not found' message with the 'echo' command). In earlier versions of Windows the limit was 2047 characters.
Most probably, TC does not check the length of the command-line before passing it for execution. The 'File not found' message
could be caused by taking the tail of the command line, if it exceeds certain limit, because then the 'echo' part would be stripped
resulting in a very long string, which the OS would try to interpret as a file name, after making sure, that it is not an internal command.
I had to insert some newlines manually into the post to make it readable in such a wide thread
The maximum command line length in Windows XP or later is 8191 characters (which still does not explain fully
the strange 'File not found' message with the 'echo' command). In earlier versions of Windows the limit was 2047 characters.
Most probably, TC does not check the length of the command-line before passing it for execution. The 'File not found' message
could be caused by taking the tail of the command line, if it exceeds certain limit, because then the 'echo' part would be stripped
resulting in a very long string, which the OS would try to interpret as a file name, after making sure, that it is not an internal command.
I had to insert some newlines manually into the post to make it readable in such a wide thread
if you replace the echo with an existing command like cmd the "file not found" doesnt pop up, it opens the command line. If you increase the length of the command line over the limits posted by TLis you will get a "cant execute" error, which is ok.
I just saw that TC limits the lengths of the cmd to max length when you enter/paste strings.
I'll do some more research at work in the Win2k environment.
I just saw that TC limits the lengths of the cmd to max length when you enter/paste strings.
I'll do some more research at work in the Win2k environment.
I was born with Norton Commander, grew up with DCC, after school I played with Windows Commander, graduated, married and had kids with Total Commander and will die using whatever its called then Commander.
Here on Win2k SP4:
- => Output to console window:
- echo text
Fails - results in error dialog "File not found". - echo [1600 characters]
Fails - same result: dialog "File not found" - %COMSPEC% /k echo text
OK - works fine, opens cmd.exe and prints "text". - %COMSPEC% /k echo [1600 characters]
OK - works fine, opens cmd.exe and prints "text" (all 1600 characters).
=> Output to file: - echo test>file.ext
OK - works fine, outputs the text to "file.ext". - echo [1600 characters]>file.ext
Fails - does nothing, the file is not created.
- %COMSPEC% /c echo text>file.ext
OK - works fine, outputs "text" to "file.ext". - %COMSPEC% /c echo [1600 characters]>file.ext
- %COMSPEC% /k echo [1600 characters]>file.ext
Fails - does nothing, the file is not created.
=> Found the reason: here the command line is cut, too (">file.ext" on the end not included). This is not the case with output to screen instead of a file, in this case all 1600 chars are printed. Use /k instead of /c to see the used part of the command line.
Last edited by StatusQuo on 2007-09-20, 22:20 UTC, edited 1 time in total.
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
-- TC starter menu: Fast yet descriptive command access!
- ghisler(Author)
- Site Admin
- Posts: 48097
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Try
cmd /k echo <1600 chars>
Works for me on Win2k without any crashes, also mutiple times, but the command line is cut...
cmd /k echo <1600 chars>
Works for me on Win2k without any crashes, also mutiple times, but the command line is cut...
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
2ghisler(Author)
Indeed, the command line is cut here, too (Win2k SP4),
but only, if output is redirected to a file - strange:
Added 2 examples in my above posting...
Indeed, the command line is cut here, too (Win2k SP4),
but only, if output is redirected to a file - strange:
- %COMSPEC% /k echo [1600 characters]
- %COMSPEC% /k echo [1600 characters]>file.ext
%COMSPEC% /c echo [1600 characters]>file.ext
Added 2 examples in my above posting...
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
-- TC starter menu: Fast yet descriptive command access!
2xrmb
Do you get the crash with a new/clean WINCMD.INI file, too?
Same OS here, but no crash.sorry for not including OS details... I'm so used that everyone uses Win2k SP4 from work
Do you get the crash with a new/clean WINCMD.INI file, too?
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
-- TC starter menu: Fast yet descriptive command access!
update:
First finding why echo works for me, I've the GNU tools installed in the path, and there is an echo.exe included.
Now I started a new session of TC, attached with VC Express to the process and used my extreme command line twice... VC caught this exception:
Unhandled exception at 0x77facbb8 (NTDLL.DLL) in TOTALCMD.EXE: 0xC0000005: Access violation writing location 0x00030fcc.
And this is the callstack: (looks like a stack overflow/recursive call... or a VC bug
> NTDLL.DLL!_RtlDispatchException@8() + 0x6 bytes
NTDLL.DLL!_KiUserExceptionDispatcher@8() + 0xe bytes
TOTALCMD.EXE!0069e543()
[Frames below may be incorrect and/or missing, no symbols loaded for TOTALCMD.EXE]
NTDLL.DLL!ExecuteHandler@20() + 0x26 bytes
NTDLL.DLL!_RtlDispatchException@8() + 0x76 bytes
NTDLL.DLL!_KiUserExceptionDispatcher@8() + 0xe bytes
TOTALCMD.EXE!0069e543()
NTDLL.DLL!ExecuteHandler@20() + 0x26 bytes
NTDLL.DLL!_RtlDispatchException@8() + 0x76 bytes
NTDLL.DLL!_KiUserExceptionDispatcher@8() + 0xe bytes
TOTALCMD.EXE!0069e543()
...same block 100x...
NTDLL.DLL!ExecuteHandler@20() + 0x26 bytes
NTDLL.DLL!_RtlDispatchException@8() + 0x76 bytes
NTDLL.DLL!_KiUserExceptionDispatcher@8() + 0xe bytes
TOTALCMD.EXE!006f0077()
dump created with vs.net 2003
http://home.comcast.net/~xrmb/files/tc_crash_longcmd.zip (30kb)
First finding why echo works for me, I've the GNU tools installed in the path, and there is an echo.exe included.
Now I started a new session of TC, attached with VC Express to the process and used my extreme command line twice... VC caught this exception:
Unhandled exception at 0x77facbb8 (NTDLL.DLL) in TOTALCMD.EXE: 0xC0000005: Access violation writing location 0x00030fcc.
And this is the callstack: (looks like a stack overflow/recursive call... or a VC bug
> NTDLL.DLL!_RtlDispatchException@8() + 0x6 bytes
NTDLL.DLL!_KiUserExceptionDispatcher@8() + 0xe bytes
TOTALCMD.EXE!0069e543()
[Frames below may be incorrect and/or missing, no symbols loaded for TOTALCMD.EXE]
NTDLL.DLL!ExecuteHandler@20() + 0x26 bytes
NTDLL.DLL!_RtlDispatchException@8() + 0x76 bytes
NTDLL.DLL!_KiUserExceptionDispatcher@8() + 0xe bytes
TOTALCMD.EXE!0069e543()
NTDLL.DLL!ExecuteHandler@20() + 0x26 bytes
NTDLL.DLL!_RtlDispatchException@8() + 0x76 bytes
NTDLL.DLL!_KiUserExceptionDispatcher@8() + 0xe bytes
TOTALCMD.EXE!0069e543()
...same block 100x...
NTDLL.DLL!ExecuteHandler@20() + 0x26 bytes
NTDLL.DLL!_RtlDispatchException@8() + 0x76 bytes
NTDLL.DLL!_KiUserExceptionDispatcher@8() + 0xe bytes
TOTALCMD.EXE!006f0077()
dump created with vs.net 2003
http://home.comcast.net/~xrmb/files/tc_crash_longcmd.zip (30kb)
- ghisler(Author)
- Site Admin
- Posts: 48097
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
I could reproduce an access violation now, but not when trying to execute a command, but when trying to get the command from the command line history with Ctrl+Cursor down! are you sure that you get the error on ENTER?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
well, I use CTRL+E for last started cmd... I'm not sure if it crashes then or when I push enter (I'm pretty fast in doing this... 10+ years of TC usage). Maybe the CTRL+E just corrupts the memory and the enter gives it the rest?
I was born with Norton Commander, grew up with DCC, after school I played with Windows Commander, graduated, married and had kids with Total Commander and will die using whatever its called then Commander.