+[8.50 beta 1] Crash report (Alt+F7)

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

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

+[8.50 beta 1] Crash report (Alt+F7)

Post by *MarcinW »

I can reproduce this crash on one machine instantly (with clean wincmd.ini) and cannot on other machine.

Steps to reproduce:
1) launch TC
2) immediately(!) after launching use Alt+F7 and start searching just by pressing Enter - inside any directory that contains at least one file.

Additional info: exception C0000092 is STATUS_FLOAT_STACK_CHECK. As I checked with a debugger, during exception all 8 FPU registers (ST0..ST7) are already used and TC tries to load another value on the FPU stack.

In case of problems with reproducing I can make an additional research.

Code: Select all

---------------------------
Total Commander 8.50b1
---------------------------
Invalid floating point operation.
Invalid floating point operation
Windows 2000 SP4 5.0 (Build 2195)

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

Windows exception: C0000092
Stack trace:
006EFF06
447429  447DA6  4252C4  447367  41730D  4176E0
5B031F  5AC985  445F8C  435F57  445E55  445D93
4492D2  447429  447DA6  >4252C4  447367  4252C4
42A85C  42AA18  5A77A7  54C5FF  58AD0C  57CF8B
4488E3  447429  447DA6  4252C4  447367  4252C4
42AA18  6F684F  
Raw:
447367  4252C4  4252C4  4472D5  4252C4  6E006D
445E55  448075  43720E  4473B7  447429  447DA6
447DC9  4252C4  447367  4020A2  402226  402249
417680  41730D  4176E0  6AA190  5AFC28  5B031F
650067  650067  417797  6B53C4  6B53DB  446C9C
446CDB  446DAA  446DC6  446E0D  43748A  445E55
448075  6F47EF  43720E  447DB2  447DC9  4252C4
6E006D  6F3A07  6EC5DC  490046  41E902  41E93D
6F37EF  41EB74  6F45DF  6F45DF  448075  427B31
6E006D  4472D5  4252C4  44811F  445E55  448075

Press Ctrl+C to copy this report!
Continue execution?
---------------------------
Tak   Nie   
---------------------------
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48093
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Can you try again with beta 2, please? I cannot reproduce the error, but I'm now trying to clear floating point errors from dll code in many places, so it may have gone away. If not, please post another report for beta 2.
Author of Total Commander
https://www.ghisler.com
User avatar
Gral
Power Member
Power Member
Posts: 1467
Joined: 2005-01-26, 15:12 UTC

Post by *Gral »

2 MarcinW
Can you test behavior described in these two threads:

http://www.ghisler.ch/board/viewtopic.php?t=37831
http://www.ghisler.ch/board/viewtopic.php?t=37832

Did you receive error in such a cases?
If i get error in one case, no occurs anymore in others - only one error for launch.

Also - is this other machine with older (non-NT based) system?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48093
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

No, I don't get any error in either case.
Author of Total Commander
https://www.ghisler.com
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

Fixed in 8.50 beta 2, but may still cause problems.

I found a cause of this problem - the initialization code of the Unrar.dll. I tested three versions with TC 8.50 beta 1:
- Unrar.dll 4.20.1.488 (from TC 8.01) - no problem
- Unrar.dll 5.0.2.851 (from TC 8.50 beta 1) - problem exists
- Unrar.dll 5.0.100.965 (from TC 8.50 beta 2) - problem exists

This problem can be reproduced with an old AMD Duron processor.

When the user starts searching with Alt+F7, TC loads Unrar.dll (even when "Search archives" is not checked). After TC calls LoadLibrary('Unrar.dll'), FPU stack becomes destroyed (i.e. all FPU registers, ST0..ST7, become occupied). After this, the first floating point instruction can raise the exception STATUS_FLOAT_STACK_CHECK.

The code that causes the problem looks like this (Unrar.dll 5.0.100.965):

Code: Select all

.text:1002BB00 FPU_PROBLEM     proc near
.text:1002BB00                 push    esi
.text:1002BB01                 mov     esi, 0A54FF53Ah
.text:1002BB06                 mov     eax, 6A09E667h
.text:1002BB0B                 mov     ecx, 0BB67AE85h
.text:1002BB10                 mov     edx, 3C6EF372h
.text:1002BB15                 movd    xmm0, esi
.text:1002BB19                 movd    xmm1, edx
.text:1002BB1D                 movd    xmm2, ecx
.text:1002BB21                 movd    xmm3, eax
.text:1002BB25                 pop     esi
.text:1002BB26                 punpckldq xmm2, xmm0
.text:1002BB2A                 punpckldq xmm3, xmm1
.text:1002BB2E                 punpckldq xmm3, xmm2
.text:1002BB32                 movdqa  xmmword_100326C0, xmm3
.text:1002BB3A                 retn
.text:1002BB3A FPU_PROBLEM     endp

I can also reproduce the crash described here with TC 8.50 beta 1 and can't with TC 8.50 beta 2:
http://www.ghisler.ch/board/viewtopic.php?t=37831

I can also reproduce the crash described here with TC 8.50 beta 1 and also with TC 8.50 beta 2:
http://www.ghisler.ch/board/viewtopic.php?t=37832

I don't know what changed in TC beta 2, but - as I checked with a debugger - the correct solution of this problem is to reinitialize FPU after loading Unrar.dll. To do this, call this function after LoadLibrary('Unrar.dll'):

Code: Select all

procedure FPUInit;
{$IFDEF VER90} {Delphi 2}
const
  Default8087CW : Word = $1332;
{$ENDIF}
asm
  FNINIT
  FWAIT
  FLDCW Default8087CW
end;
Regards
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48093
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

A user who reported this problem has tried a test version with the above fix - it seems to work, thanks!

Btw, I have contacted the RAR author Eugene Roshal about this problem, and he has agreed to have a look at it. It seems to be caused by the BLAKE2 checksum function. He recommends that I check also an archive with such a checksum. Does anyone know how to create such a RAR archive?

Edit:
He has sent me an e-mail that there is a new version of unrar.dll on www.rarlab.com now which should fix the problem. However, he cannot test it because he doesn't have an AMD processor without SSE2 instructions. So can those with this error please test the new unrar.dll, please?
Author of Total Commander
https://www.ghisler.com
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

I copied the newest Unrar.dll (still 5.0.100.965, but digital signature has date 5 Sep 2013) to the TC 8.50 beta 1 and problems with Alt+F7 and with opening RAR archives disappeared. This works also properly with TC 8.50 beta 2.

So the problem has been fixed.
Biozynotiker
Member
Member
Posts: 164
Joined: 2011-03-22, 09:57 UTC
Location: Germany

Post by *Biozynotiker »

ghisler(Author) wrote:It seems to be caused by the BLAKE2 checksum function. He recommends that I check also an archive with such a checksum. Does anyone know how to create such a RAR archive?
You can create such archive by using this parameter:
rar.exe a -htb archive.rar file2add.txt

(Specify -htb switch for BLAKE2sp and -htc for CRC32 hash function.)

The attached rar archive in this thread, using blake2 btw.
#92832
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48093
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks for your feedback! So could someone with an AMD processor check the file with the BLAKE2 checksum from the above link, please?
Author of Total Commander
https://www.ghisler.com
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

I checked the archive from the link above (deduplication.rar) with TC 8.50 beta 2 + newest Unrar.dll (5.0.100.965, digital signature date 5 Sep 2013). I can confirm that on AMD Duron processor opening and unpacking from this archive don't cause any FPU exceptions. To be more precise, these exports from Unrar.dll work properly:

- RAROpenArchiveEx
- RARReadHeaderEx
- RARProcessFile
- RARProcessFileW
- RARCloseArchive
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48093
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks! The newest unrar.dll is now included in beta 3.
Author of Total Commander
https://www.ghisler.com
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

Fixed in TC 8.50 beta 3.
Post Reply