[solved] Crash when comma is used after em_command with parameter

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

Moderators: white, Hacker, petermad, Stefan2

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

[solved] Crash when comma is used after em_command with parameter

Post by *petermad »

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
Last edited by petermad on 2021-05-29, 21:16 UTC, edited 1 time in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Post by *ts4242 »

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: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

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 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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

Post by *ghisler(Author) »

This should be fixed in beta 5 now (resulting in an error message).
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

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 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

It seems that I disabled a bit too much. I will try to reenable it somehow in the next beta.
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This should be fixed now in beta 6, please test it!
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

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 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

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 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply