7.02a reproducable crash with (long?) command lines

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

User avatar
xrmb
Junior Member
Junior Member
Posts: 63
Joined: 2003-04-05, 16:54 UTC

7.02a reproducable crash with (long?) command lines

Post by *xrmb »

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?
Last edited by xrmb on 2007-09-20, 12:34 UTC, edited 1 time in total.
User avatar
Hacker
Moderator
Moderator
Posts: 13073
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

you haven't noticed that TC closed itself?
Nope, just the "File not found!" dialog.
What OS are you using? I am using XP Home.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

"File not found"

Same here (Vista).

But after inserting the string multiple times, the end of the line is filled with blanks. :shock:

When you quit TC, an error occurs and Vista starts to search for a solution.

[Command line history] in wincmd.ini isn't updated after restart.

Holger
User avatar
xrmb
Junior Member
Junior Member
Posts: 63
Joined: 2003-04-05, 16:54 UTC

Post by *xrmb »

sorry for not including OS details... I'm so used that everyone uses Win2k SP4 from work ;)

I just tried it in WinXP and Win2k3 Server... doesn't crash there, gives as you stated a "file not found" error instead.

TC doesnt create dump files or some other trace of a crash?
User avatar
xrmb
Junior Member
Junior Member
Posts: 63
Joined: 2003-04-05, 16:54 UTC

Post by *xrmb »

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
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.
User avatar
TLis
Member
Member
Posts: 111
Joined: 2004-06-02, 16:48 UTC
Location: Szczecin, Poland

Post by *TLis »

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 :)
User avatar
xrmb
Junior Member
Junior Member
Posts: 63
Joined: 2003-04-05, 16:54 UTC

Post by *xrmb »

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 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.
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

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.
EDIT: Additional examples for output to a file (not possible here with 1600 chars):
  • %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!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48097
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Try
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
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

2ghisler(Author)
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]
works, but
  • %COMSPEC% /k echo [1600 characters]>file.ext
    %COMSPEC% /c echo [1600 characters]>file.ext
cuts the command line... :?:

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!
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

2xrmb
sorry for not including OS details... I'm so used that everyone uses Win2k SP4 from work
Same OS here, but no crash.
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!
User avatar
xrmb
Junior Member
Junior Member
Posts: 63
Joined: 2003-04-05, 16:54 UTC

Post by *xrmb »

to StatusQuo: I'll gather more details tomorrow at work, I may take a video if it helps :)

Is there a way under win2k to get the crash address or a dump?
User avatar
xrmb
Junior Member
Junior Member
Posts: 63
Joined: 2003-04-05, 16:54 UTC

Post by *xrmb »

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)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48097
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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
User avatar
xrmb
Junior Member
Junior Member
Posts: 63
Joined: 2003-04-05, 16:54 UTC

Post by *xrmb »

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.
Post Reply