9.21a: Crash unpacking XZ-packed Linux archives [solved]

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
karlchen
Power Member
Power Member
Posts: 4601
Joined: 2003-02-06, 22:23 UTC
Location: Germany

9.21a: Crash unpacking XZ-packed Linux archives [solved]

Post by *karlchen »

Hello, Christian.

I assume a similar bug might affect your xz-plugin 1.0 under T.C. 9.21a, for which you had posted 2 fixed T.C. DLLs here: 21: Crash unpacking XZ-packed ZIP archives (and fix!)

Note:
Using the same xz-plugin on T.C. 9.12 no problem occurs. The .xz archive can be opened and unpacked.

Environment:
  • Linux Mint 18.3 32-bit (based on Ubuntu 16.04.5 32-bit)
  • Wine 1.6.2 32-bit
  • Total Commander 9.21a 32-bit
  • xz-plugin 1.0
Sample file to reproduce the problem:
e.g. this .deb file mdm_2.0.17+serena_i386.deb, size 1.9 MB. Inside the .deb archive the archive data.tar.xz is what will trigger the crash on T.C. 9.21a, not control.tar.gz

How to reproduce:
Open the file mdm_2.0.17+serena_i386.deb. Double-click on data.tar.gz.
Screenshot: TC921a-az-archive-crash.png

Code: Select all

[PackerPlugins]
aes=93,%COMMANDER_PATH%\Plugins\aes\aes.wcx
bz2=251,%COMMANDER_PATH%\Plugins\bzip2\bzip2dll.wcx
7z=223,%COMMANDER_PATH%\Plugins\7zip\7zip.wcx
deb=4,%COMMANDER_PATH%\plugins\deb\deb.wcx
diskdir=21,%COMMANDER_PATH%\plugins\diskdir\diskdir.wcx
lzma=187,%COMMANDER_PATH%\plugins\lzma\lzma.wcx
bat=279,%COMMANDER_PATH%\plugins\makebat\makebat.wcx
cpio=0,%COMMANDER_PATH%\plugins\rpm\cpio.wcx
rpm=20,%COMMANDER_PATH%\plugins\rpm\rpm.wcx
z=11,%COMMANDER_PATH%\plugins\Z\z.wcx
xz=187,%COMMANDER_PATH%\Plugins\xz\xz.wcx
T.C. 9.12 uses exactly the same packer plugins and exactly the same settings as T.C. 9.12a.
T.C. 9.12 is a backup clone of the Totalcmd folder, created right before upgrading Totalcmd from 9.12 to 9.21a.

In case I have to provide more information, please, let me now.

Best regards,
Karl
Last edited by karlchen on 2018-10-05, 17:25 UTC, edited 1 time in total.
MX Linux 21.3 64-bit xfce, Total Commander 10.52 64-bit
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
User avatar
karlchen
Power Member
Power Member
Posts: 4601
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Re: 9.21a: Crash unpacking XZ-packed Linux archives

Post by *karlchen »

Hello, Christian.

Might be that the reported issue is caused by the ancient Wine 1.6.2 version.

Just tried to reproduce the issue on
  • Windows 7 SP1 64-bit
  • Total Commander 9.21a 32-bit+64-bit
  • xz-plugin 1.0
and failed. No crash, no complaint, data.tar.xz can be opened. This is true for both, T.C. 9.21a 32-bit and T.C. 9.21a 64-bit.

Will try on Ubuntu 18.04.1, where Wine is 3.0, and find out whether the issue occurs or not. Will report back.

Best regards,
Karl
--
Confusing that on Wine 1.6.2 and T.C. 9.12, data.tar.xz can still be opened without any issues. (No complaint)
--
Just for completeness sake:
On all Total Commander 9.21a installations I had applied the tcmdlzma patch.
MX Linux 21.3 64-bit xfce, Total Commander 10.52 64-bit
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
User avatar
karlchen
Power Member
Power Member
Posts: 4601
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Re: 9.21a: Crash unpacking XZ-packed Linux archives

Post by *karlchen »

Hello, Christian.

Problem reproduced on
Environment:
  • Ubuntu 18.04.1 Mate32-bit
  • Wine 3.0 32-bit
  • Total Commander 9.21a 32-bit
  • xz-plugin 1.0
Still suggests that the root cause must be in Wine, rather than in Total Commander 9.21a, because the issue has not been reproduced on Windows 7 SP1 64-bit.

Best regards,
Karl
MX Linux 21.3 64-bit xfce, Total Commander 10.52 64-bit
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: 9.21a: Crash unpacking XZ-packed Linux archives

Post by *ghisler(Author) »

I cannot reproduce the problem on Windows 10 either, so it must be a Wine issue.

2karlchen
Could you try with a newer Wine version, maybe on a different Linux installation?
Author of Total Commander
https://www.ghisler.com
User avatar
karlchen
Power Member
Power Member
Posts: 4601
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Re: 9.21a: Crash unpacking XZ-packed Linux archives

Post by *karlchen »

Hello, Christian.

Newer Wine version? Newer than 3.0?
Initially the problem had occurred on Wine 1.6.2 =>[1];
yet on Ubuntu 18.04.1 it happened on Wine 3.0 as well =>[2].

Regards,
Karl
MX Linux 21.3 64-bit xfce, Total Commander 10.52 64-bit
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: 9.21a: Crash unpacking XZ-packed Linux archives

Post by *ghisler(Author) »

Sorry, I read that you only had this on Wine 1.6.2. I will try to reproduce it.
Author of Total Commander
https://www.ghisler.com
User avatar
karlchen
Power Member
Power Member
Posts: 4601
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Re: 9.21a: Crash unpacking XZ-packed Linux archives

Post by *karlchen »

No problem, Christian. We all miss a well hidden detail in a thread from time to time. Me too. :)
MX Linux 21.3 64-bit xfce, Total Commander 10.52 64-bit
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: 9.21a: Crash unpacking XZ-packed Linux archives

Post by *ghisler(Author) »

I can reproduce the error, but indeed only in Wine, not on Windows, and only with your xz file! I tried several other xz files, no problem. This will need extensive checks.
Author of Total Commander
https://www.ghisler.com
User avatar
karlchen
Power Member
Power Member
Posts: 4601
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Re: 9.21a: Crash unpacking XZ-packed Linux archives

Post by *karlchen »

Hello, Christian.

This is interesting indeed. And thank you very much for taking the time of investigating the issue.
I had given one of the mdm*.deb files as an example, which could be used to reproduce the problem. The common factor of all mdm*.deb files: They all are published only for Linux Mint on the Linux Mint software repository website, packages.linuxmint.com.
So what I can do are 2 things:
  • pick other random .deb packages from the Mint software repos and find out whether they cause the same problem.
  • pick random .deb. packages from the Ubuntu software repos (Mint is based on Ubuntu) and find out whether they cause the same problem.
In case the problem should be limited to the mdm*.deb packages, the issue may be ignored, because the software package mdm is a dying species on Mint, because it has been replaced by lightdm on recent Mint versions.
In case the problem should be limited to Mint .deb packages (not only mdm*.deb), then this might be something to ask the Mint makers about.
In case the problem should be found in Ubuntu .deb packages and Mint .deb packages, there might be a confusion about the specification of how .xz archives are implemented. Confusion on whose side I do not know.

Best regards,
Karl
--
P.S.:
For the next few days my internet access will be too unreliable and the bandwidth too limited in order to download a larger number of random .deb packages, which will be needed to find out the scope of the problem. So my next post on this topic may be delayed by more than a week.
MX Linux 21.3 64-bit xfce, Total Commander 10.52 64-bit
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: 9.21a: Crash unpacking XZ-packed Linux archives

Post by *ghisler(Author) »

The problem is solved, and the reason is very unusual: The .deb plugin displays the xz file with a date in 2006, but unpacking sets a date to the year 2106! This is outside the Unix date range. This causes the localtime() function to fail and return a NULL pointer. If you unpack the xz file first, and then set the current date as the archive date, the error will not occur when opening the archive.

I now use GetFileTime() instead, which can actually handle this date. I also updated the lzma DLLs from https://tukaani.org/xz/.

The new plugin version 1.1 is available on our homepage:
https://www.ghisler.com/plugins.htm
Author of Total Commander
https://www.ghisler.com
User avatar
karlchen
Power Member
Power Member
Posts: 4601
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Re: 9.21a: Crash unpacking XZ-packed Linux archives

Post by *karlchen »

Hello, Christian.

Wow. This is great. :D

Using your updated plugin xz v1.1, Total Commander 9.21a 32-bit on Wine 1.6.2 / Linux Mint 18.1 32-bit can successfully extract all inner archives in the sample .deb file mdm_2.0.17+serena_i386.deb. No more error message, when the inner archive data.tar.xz is double-clicked. It opens.
Happened to have another .deb file on my local disk, inxi_2.3.56-1_all.deb, which holds 2 .xz archives,

Code: Select all

control.tar.xz	864	20.01.2006 06:01	-a--
data.tar.xz	141.700	20.01.2006 06:01	-a--
Both now open without issue as well.

No idea why first a filedate from 2006 is used, which then is converted into a filedate from 2106. Really weird way of operating.

Thank you very much for analyzing this issue and for making your .xz plugin handle the weird filedates gracefully. :)

Best regards,
Karl
MX Linux 21.3 64-bit xfce, Total Commander 10.52 64-bit
The people of Alderaan keep on bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine.
The Prophet's Song
Post Reply