TC has stopped working - Lister and encoding bug

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
PawelSroczynski
Junior Member
Junior Member
Posts: 6
Joined: 2015-10-24, 11:37 UTC

TC has stopped working - Lister and encoding bug

Post by *PawelSroczynski »

Hi,

I've found one issue that is connected with lister and encoding and copying the file content. :o
It's repeatable, so it's easy to find what is wrong.

The scenario:
1. Preview the file with specific content and encoding, so press F3 (the file is attached in this post)
2. Options > 7 UTF-8 or press 7
3. Select all and copy: Ctrl+a, Ctrl+c

Bum! Total commander has stopped working.
Confirmed by my friend also.

The file that is a cause of an issue:
drive[dot]google[dot]com / file / d /0B5NjQ0lF47OLSkdCWlgyRTFLNkU/view?usp=sharing

Hope it can help you with a fix for it.
User avatar
Dalai
Power Member
Power Member
Posts: 9393
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

I can not confirm this issue. My TC doesn't crash with your file. Do you have any Lister plugins installed? If so, does TC crash when you avoid loading them by launching Lister via Alt+Shift+F3?

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
PawelSroczynski
Junior Member
Junior Member
Posts: 6
Joined: 2015-10-24, 11:37 UTC

Post by *PawelSroczynski »

No - I don't have any plugins.
To be sure that this is a bug in tc I just installed clean / fresh total commander without any plugins.


To be sure I must say that i'm viewing txt file by the lister in following way

- F3
- 7
- Ctrl+A
- Ctrl+C

Crushed!

A video that i recorded to show the steps:
youtu[dot]be/-P52lBwQp6Q
User avatar
milo1012
Power Member
Power Member
Posts: 1158
Joined: 2012-02-02, 19:23 UTC

Post by *milo1012 »

On which OS are you testing?

There are some control characters in the text.
When using the UTF-8 view, TC will probably recode the text via MultiByteToWideChar,
which is known to work differently on different OSes.

Also: which TC version (32-bit or x64)?
TC plugins: PCREsearch and RegXtract
PawelSroczynski
Junior Member
Junior Member
Posts: 6
Joined: 2015-10-24, 11:37 UTC

Post by *PawelSroczynski »

I have Windows 10.
My friend have Windows 7.

TC versions:
8.51a 64-bit
8.52a 64-bit
User avatar
milo1012
Power Member
Power Member
Posts: 1158
Joined: 2012-02-02, 19:23 UTC

Post by *milo1012 »

Now I can confirm a crash on TC x64 and Win7.
The 32-bit version is not affected.
TC plugins: PCREsearch and RegXtract
PawelSroczynski
Junior Member
Junior Member
Posts: 6
Joined: 2015-10-24, 11:37 UTC

Post by *PawelSroczynski »

Great! :-)
As I understand It can be fixed in one of the next versions?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

It seems to happen because the file doesn't contain valid UTF-8. I will check why it crashes.
Author of Total Commander
https://www.ghisler.com
PawelSroczynski
Junior Member
Junior Member
Posts: 6
Joined: 2015-10-24, 11:37 UTC

Post by *PawelSroczynski »

Exactly, but It shouldn't crash even then.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

The problem was that the conversion from UTF-8 to UTF-16 failed and returned "-1" as length. This was interpreted as 2GB-1byte by TC 64-bit. When trying to set the 0 byte at the end, it crashed with an access violation. Nothing dangerous because the system was not allowing to write there. I will change it so it will be possible to handle also incomplete UTF-8 codes.
Author of Total Commander
https://www.ghisler.com
PawelSroczynski
Junior Member
Junior Member
Posts: 6
Joined: 2015-10-24, 11:37 UTC

Post by *PawelSroczynski »

Very nice! :-) Thanks
Post Reply