Crash when comma is used after em_command with parameter

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

Moderators: sheep, Hacker, Stefan2, white

Post Reply
User avatar
petermad
Power Member
Power Member
Posts: 8993
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Crash when comma is used after em_command with parameter

Post by *petermad » 2018-05-25, 20:21 UTC

To reproduce try this button:

Code: Select all

TOTALCMD#BAR#DATA
cm_SrcByDateTime 1,

wciconex.dll,7
ALERT! - Crashes your TC


-1
as compared to this:

Code: Select all

TOTALCMD#BAR#DATA
cm_SrcByDateTime 1

wciconex.dll,7
Sort by Date, Oldest First


-1
ot this:

Code: Select all

TOTALCMD#BAR#DATA
cm_SrcByDateTime,

wciconex.dll,7
Toggle Oldest / Neswest Files First


-1
or this:

Code: Select all

TOTALCMD#BAR#DATA
cm_SrcByDateTime 1,cm_GoToFirstFile,cm_SrcByName 1

wciconex.dll,7
Go to oldest file


-1
But not this one:

Code: Select all

TOTALCMD#BAR#DATA
cm_SrcByDateTime 1,cm_GoToFirstFile,cm_SrcByName 1,

wciconex.dll,7
ALERT! - Crashes your TC


-1
1
License #524 (1994)
Danish Total Commander Translator
TC 9.5b8 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 (1909) 64bit, 'Everything' 1.4.1.935 (x64)
TC 3.0b12 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Post by *ts4242 » 2018-05-26, 01:53 UTC

Confirmed!

TC x64 only popup this error

Code: Select all

---------------------------
Total Commander 9.20ß4
---------------------------
Unknown Run-Time error : 202.
Unknown Run-Time error : 202
Windows 7 SP1 Ultimate 6.1 (Build 7601), base: 0400000

Please report this error to the Author, with a description
of what you were doing when this error occurred!

Stack trace (x64):413DFA
4141A8 412D1E 40C1F0 40CC7A 41A1F0 40C8AC 41EC55 41F9C2
798B68 798E28 798EAF 798EAF 798EAF 798EAF 798EAF 798EAF

Press Ctrl+C to copy this report!
Continue execution?
---------------------------
Yes   No   
---------------------------

User avatar
petermad
Power Member
Power Member
Posts: 8993
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Post by *petermad » 2018-05-26, 04:17 UTC

2ts4242
Yes, and if you press "No" TC crashes
If you press "Yes" you can continue, but then if you click the button again TC crashes. (Windows 7)
License #524 (1994)
Danish Total Commander Translator
TC 9.5b8 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 (1909) 64bit, 'Everything' 1.4.1.935 (x64)
TC 3.0b12 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 38451
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2018-05-28, 14:30 UTC

Confirmed, it results in an infinite loop. I will detect it as an error and not even execute the first command, that's what happens when you use just:
cm_SrcByDateTime,
Author of Total Commander
http://www.ghisler.com

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 38451
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2018-05-30, 16:56 UTC

This should be fixed in beta 5 now (resulting in an error message).
Author of Total Commander
http://www.ghisler.com

User avatar
petermad
Power Member
Power Member
Posts: 8993
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Post by *petermad » 2018-05-30, 21:18 UTC

I do get an error message (File not found!), but part of the message is always in Danish regardless of the used TC language, and it says "Den angivne fil blev ikke fundet." ("The stated file was not found.") - but that string does not even exist in the Danish language file!!!

Furthermore it is no longer possible to execute combined cm_commands like: cm_SrcByDateTime,cm_GoToFirstFile - only the first command is executed :roll:
License #524 (1994)
Danish Total Commander Translator
TC 9.5b8 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 (1909) 64bit, 'Everything' 1.4.1.935 (x64)
TC 3.0b12 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 38451
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2018-05-31, 08:56 UTC

It seems that I disabled a bit too much. I will try to reenable it somehow in the next beta.
Author of Total Commander
http://www.ghisler.com

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 38451
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2018-06-06, 16:45 UTC

This should be fixed now in beta 6, please test it!
Author of Total Commander
http://www.ghisler.com

User avatar
petermad
Power Member
Power Member
Posts: 8993
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Post by *petermad » 2018-06-07, 12:46 UTC

Confirmed that multiple commands now works again, and that a trailing comma after an em_command parameter doesn't crash TC 9.20b6.

But I am puzzled by different behaviour or these two commands:
1. cm_SrcByDateTime 1,
2. cm_SrcByDateTime 1,cm_GoToFirstFile,cm_SrcByName 1,

The first one is treated as if the parameter 1 and the comma isn't there and toggles the sort direction.

The second one acts as if the comma isn't there but respects the parameter for the cm_SrcByName command.

I think the first example should be treated like the second one - i.e. the trailing comma should be ignored but the parameter should be respected also for single commands.
License #524 (1994)
Danish Total Commander Translator
TC 9.5b8 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 (1909) 64bit, 'Everything' 1.4.1.935 (x64)
TC 3.0b12 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 38451
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2018-06-08, 10:18 UTC

This is because TC doesn't detect the comma as such, but a comma followed by another command. If there is no command after the comma, TC assumes that the comma is part of the parameters passed to the command.

This is necessary because em_xyz and internal commands may accept the comma in the parameter itself. Multiple commands per command line were added later, so I had to keep this for backwards compatibility.

Since "1," isn't a valid sort order, the parameter is ignored.
Author of Total Commander
http://www.ghisler.com

User avatar
petermad
Power Member
Power Member
Posts: 8993
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Post by *petermad » 2018-06-08, 10:25 UTC

Multiple commands per command line were added later, so I had to keep this for backwards compatibility.
OK, that makes sense.

I consider the problem fixed in TC 9.20b6 then :-)
License #524 (1994)
Danish Total Commander Translator
TC 9.5b8 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 (1909) 64bit, 'Everything' 1.4.1.935 (x64)
TC 3.0b12 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

Post Reply