[9.0b9] Compare tool crashes when closing

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Stefan2, white, sheep, Hacker

Post Reply
browny
Member
Member
Posts: 183
Joined: 2007-09-10, 13:19 UTC

[9.0b9] Compare tool crashes when closing

Post by *browny » 2016-08-15, 21:54 UTC

The latest 64-bit beta still has random crashes when exiting from comparison (WIndows 8.1 64-bit). It happened with previous versions too.
Not every time, but when comparing dozens of files it is almost certain to happen.
Nothing special was going on: open comparison and then do usual actions like move around with page up/page down, move to next/previous difference and so on - then exit.
At that moment it is possible to get crash dialog; and in Visual Studio debugger something like this could be seen.
This is stack:

Code: Select all

 	comctl32.dll!CUxScrollBar::Detach()	Unknown
 	uxtheme.dll!CThemeWnd::_DetachInstance(unsigned long dwDisposition) Line 2197	C++
 	uxtheme.dll!CThemeWnd::Detach(HWND__ * hwnd, unsigned long dwDisposition) Line 2143	C++
 	uxtheme.dll!ThemePostWndProc(HWND__ * hwnd, unsigned int uMsg, unsigned __int64 wParam, __int64 lParam, __int64 * plRes, void * * ppvParam) Line 615	C++
 	user32.dll!UserCallWinProcCheckWow()	Unknown
 	user32.dll!DispatchClientMessage()	Unknown
 	user32.dll!__fnNCDESTROY()	Unknown
 	ntdll.dll!KiUserCallbackDispatcherContinue()	Unknown
 	user32.dll!NtUserDestroyWindow()	Unknown
>	TOTALCMD64.EXE!0000000000916a03()	Unknown
This is part of procedure in TC where the call originated:

Code: Select all

00000000009169B0 55                   push        rbp  
00000000009169B1 48 89 E5             mov         rbp,rsp  
00000000009169B4 48 81 EC 20 01 00 00 sub         rsp,120h  
00000000009169BB 48 89 4D F0          mov         qword ptr [rbp-10h],rcx  
00000000009169BF 48 89 55 F8          mov         qword ptr [rbp-8],rdx  
00000000009169C3 4C 8D 45 D0          lea         r8,[rbp-30h]  
00000000009169C7 48 8D 55 80          lea         rdx,[rbp-80h]  
00000000009169CB 48 B9 01 00 00 00 00 00 00 00 mov         rcx,1  
00000000009169D5 E8 26 93 AF FF       call        000000000040FD00  
00000000009169DA 48 89 C1             mov         rcx,rax  
00000000009169DD E8 5E C0 AF FF       call        0000000000412A40  
00000000009169E2 48 89 85 78 FF FF FF mov         qword ptr [rbp-88h],rax  
00000000009169E9 85 C0                test        eax,eax  
00000000009169EB 75 16                jne         0000000000916A03  
00000000009169ED 48 8B 4D F8          mov         rcx,qword ptr [rbp-8]  
00000000009169F1 E8 AA E3 EF FF       call        0000000000814DA0  
00000000009169F6 48 89 45 E8          mov         qword ptr [rbp-18h],rax  
00000000009169FA 48 8B 4D E8          mov         rcx,qword ptr [rbp-18h]  
00000000009169FE E8 7D BB AE FF       call        0000000000402580  
0000000000916A03 E8 F8 96 AF FF       call        0000000000410100  <<
0000000000916A08 48 8B 85 78 FF FF FF mov         rax,qword ptr [rbp-88h]  
0000000000916A0F 48 85 C0             test        rax,rax  
0000000000916A12 74 6F                je          0000000000916A83  
0000000000916A14 48 B9 FF FF FF FF FF FF FF FF mov         rcx,0FFFFFFFFFFFFFFFFh  
0000000000916A1E E8 4D 99 AF FF       call        0000000000410370  
From the symptoms I would guess that TC fails somewhere in destructors, and randomly because of thread syncronization issues.
Last edited by browny on 2016-08-23, 07:22 UTC, edited 2 times in total.

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37410
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2016-08-16, 20:26 UTC

Not confirmed. From your trace it looks like a problem with your theme. Could you try the same with a different theme, please?
Author of Total Commander
http://www.ghisler.com

browny
Member
Member
Posts: 183
Joined: 2007-09-10, 13:19 UTC

Post by *browny » 2016-08-17, 07:31 UTC

Perhaps TC crashed only when comparison was used from directory synchronization or afterwards.

I don't remember 32-bit builds crashed that way.
Also tthe crash was seen in Windows 7 64-bit with XP classic theme.
The only difference with standard Windows theme in 8.1 should be background picture; sfc /scannow finds no errors.

All of the above makes questionable for me the idea of theme problem.

However, I set one of the default themes with no changes applied (Flowers); and will see how it goes.

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37410
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2016-08-17, 19:31 UTC

Something was apparently wrong with your configuration - you write that you used classic theme, but the log clearly shows that a theme was involved:
uxtheme.dll!CThemeWnd

The dll uxtheme.dll is used for drawing themed user interface elements. Please try to find a clear system state where you get this error, then send me step by step instructions to reproduce it. Otherwise I will unfortunately not be able to fix your problem, sorry.
Author of Total Commander
http://www.ghisler.com

browny
Member
Member
Posts: 183
Joined: 2007-09-10, 13:19 UTC

Post by *browny » 2016-08-18, 13:25 UTC

ghisler(Author) wrote:Something was apparently wrong with your configuration - you write that you used classic theme, but the log clearly shows that a theme was involved:
uxtheme.dll!CThemeWnd
I used classic theme in Windows 7 (still a theme, I guess).

Stack trace and disassembly in the first message were recoreded in WIndows 8.1.

The theme in 8.1 was called something like "unsaved theme", which is the default Widows theme plus my custom background picture; nothing else.
I am reasonably sure that a picture is not a breaking change.
In Windows 7 there was only background colour, not a picture, but the progam still crashed.
32-bit versions were not prone to crashes with the same theme settings.

I wish to know step by step sequence to reproduce, but this appears to be random. Otherwise you would get the steps.
ghisler(Author) wrote:The dll uxtheme.dll is used for drawing themed user interface elements.
Nothing was wrong with drawing ever; but it fails on exit.

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37410
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2016-08-19, 19:44 UTC

Nothing was wrong with drawing
But your log shows that it crashes in the THEME library. so it must be related to themes.
I used classic theme in Windows 7 (still a theme, I guess).
No, classis theme is the unthemed look of the windows controls - uxtheme.dll isn't used then.
Author of Total Commander
http://www.ghisler.com

browny
Member
Member
Posts: 183
Joined: 2007-09-10, 13:19 UTC

Post by *browny » 2016-08-21, 11:30 UTC

ghisler(Author) wrote:But your log shows that it crashes in the THEME library. so it must be related to themes.
Of course.
But program could pass invalid parameters to theme library function.

May I ask if there is an exception handler in thread procedure where comparison tool is executing?
ghisler(Author) wrote:But your log shows that it crashes in the THEME No, classis theme is the unthemed look of the windows controls - uxtheme.dll isn't used then.
In Windows 7 64-bit (virtualbox) I made sure the Classic theme is selected, launched 64-bit TC; and Process Explorer showed C:\WIndows\system32\uxtheme.dll in the lower pane for TC.
Classic theme should be using theme engine; not turning it off.
Last edited by browny on 2016-08-22, 11:54 UTC, edited 1 time in total.

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 37410
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) » 2016-08-22, 10:37 UTC

TC loads uxtheme.dll to check which theme is used. When you set classic theme, it reports that no theme is used.
Author of Total Commander
http://www.ghisler.com

browny
Member
Member
Posts: 183
Joined: 2007-09-10, 13:19 UTC

Post by *browny » 2016-08-23, 07:20 UTC

ghisler(Author) wrote:TC loads uxtheme.dll to check which theme is used. When you set classic theme, it reports that no theme is used.
Interesting.
When I turned off themes in XP, part of GUI features became unavailable (forgot which ones already).
So I guess that even when "no theme" was reported, theme engine might be still doing something in the background.

But please answer one question from my previous message.
If comparison dialog is executed in a separate thread, is there an exception handler in its thread procedure?
Because unhandled exception in thread procedure causes application crash.

Post Reply