Page 1 of 1

[10.52] Access violation on open 7z file with TC7Z64.DLL (v23.01 from TC11b10)

Posted: 2023-07-06, 08:56 UTC
by MaxX
TC 10.52 x64 + new TC7Z64.DLL (ver.23.01 = from TC 11 beta 10 package).
Just try to open 7z file...


---------------------------
Total Commander 10.52
---------------------------
Access violation.
Access violation
Windows 11 Professional 10.0 (Build 22621), base: 0400000

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

Stack trace (x64):B23154
36B386B
Press Ctrl+C to copy this report!
Continue execution?
---------------------------
Так Ні
---------------------------

Re: [10.52] Access violation

Posted: 2023-07-06, 09:16 UTC
by Hacker
Yup, this is fixed in TC 11.00b10.

Roman

Re: [10.52] Access violation

Posted: 2023-07-06, 09:28 UTC
by ghisler(Author)
It's a really strange problem: The 7zip dll needs a stream object of the archive file as a parameter. Total Commander passes this stream object to the dll, and the dll reads from the object to access the 7zip archive. So far so good until version 22.01.

In version 23.01, the dll immediately calls "Release" on the stream object when called, so the object closes the file and releases the pointer. But then the dll tries to read from that same object, which is now NULL -> crash.

My workaround is to call "AddRef" (the counterpart to "Release") before passing the object to the 7zip library, so when 7zip calls "Release", it just decreases a counter and doesn't release the stream. Afterwards I can call "Release" myself to free the stream.

Re: [10.52] Access violation on open 7z file with TC7Z64.DLL (v23.01 from TC11b10)

Posted: 2023-07-06, 23:07 UTC
by MaxX
2Hacker
Em.. May be yes and no. I have both totalcmd64*.exe (release 10.52 and 11 beta) in one folder. Previous TC7Z64.DLL (from beta 1...9 packages) worked fine. Have problem only with new dll.

2ghisler(Author)
Can be there any solution that does not break TC 10.52? Or should I use this new dll only with 11.0 b10 or newer?

Re: [10.52] Access violation on open 7z file with TC7Z64.DLL (v23.01 from TC11b10)

Posted: 2023-07-07, 08:58 UTC
by Hacker
MaxX,
history.txt wrote:05.07.23 Release Total Commander 11.00 beta 10
04.07.23 Fixed: Updated 7zip unpacker dlls (TC7Z.DLL/TC7Z64.DLL) to version 23.01, fixed crash in 64-bit caused by the new dll (32/64)
Well, the history.txt entry literally says that the new DLL causes a crash. So you either have to use an older DLL, use TCv11b10 or newer, or wait until a fixed DLL is released by Igor Pavlov.

Roman

Re: [10.52] Access violation on open 7z file with TC7Z64.DLL (v23.01 from TC11b10)

Posted: 2023-07-07, 09:39 UTC
by ghisler(Author)
2MaxX
You cannot use the newer dll with TC 10.52 because it causes a crash, so unless you fix the dll code and compile the dll yourself, you cannot use the newer dll with TC 10.52.

Re: [10.52] Access violation on open 7z file with TC7Z64.DLL (v23.01 from TC11b10)

Posted: 2023-07-07, 11:28 UTC
by MaxX
Understood. Thanks.