[9.0b13] TC Hang on close

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

Moderators: Hacker, petermad, Stefan2, white

krasusczak
Senior Member
Senior Member
Posts: 284
Joined: 2011-09-23, 10:35 UTC

[9.0b13] TC Hang on close

Post by *krasusczak »

Hi, I have found a problem at XP 32 when you close TC it will stay in process forever...

To get this error you need:

1. Run for ex. Firefox
2. Run TC
3. Focus view at Firefox
4. right-click at TC "icon" (or whatever it is..) at start menu bar & choose close (don't focus at TC)
5. TC stay in process & takes whole core


If you won't focus at different window program TC will close normally, if you use X also..


From what I see b12 don't have this bug
siealex
Senior Member
Senior Member
Posts: 304
Joined: 2009-03-22, 16:36 UTC

Post by *siealex »

Does it occur ONLY in Windows XP? I can't confirm this on Windows 10.
We are not so S.M.A.R.T. as we imagine...
krasusczak
Senior Member
Senior Member
Posts: 284
Joined: 2011-09-23, 10:35 UTC

Post by *krasusczak »

I don't know.. I don't have access to windows 10, I tested this at XPx32 & I can reproduce this almost every time even with clean ini,
I don't have time to install b13 at my 7x64 to test it but it's diff arch so may works ok..
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50550
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Not confirmed, just tried it.

It could be caused by a shell extension or plugin.

Please try this:
1. Create a new, empty directory
2. Switch to that directory on both sides
3. Close Total Commander
4. Kill all TC processes via task manager
5. Open Total Commander. It should open with that empty directory on both sides
6. Close Total Commander
7. Check whether it is still running
Author of Total Commander
https://www.ghisler.com
krasusczak
Senior Member
Senior Member
Posts: 284
Joined: 2011-09-23, 10:35 UTC

Post by *krasusczak »

Still have this problem TC hang with 50% processor..

This works with clean ini + empty dir with b13
reinstalled b12 works ok



Sometimes works ok but mostly hangs, I also replace Firefox with different app & the same problem. I don't have any new or strange app in background, newer notice such problem at previously versions..



One more time:
- start firefox
- start tc
- focuse = click at firefox window (tc in background - but not minimized!- if minimized tc won't hang, so this is something related with tc window appearance..)
- right-click at tc icon at start-downbar & close
browny
Senior Member
Senior Member
Posts: 361
Joined: 2007-09-10, 13:19 UTC

Post by *browny »

I have virtualbox XP SP3 32-bit for various purposes.
Unpacked TC b13 into c:\wc (not installed)
Made sure there is no HKLM/Software/Ghisler key in the registry.
Copied old firefox from old XP installation into c:\program files\mozilla\firefox.
As instruction says, started firefox, started tc, clicked firefox, right-clicked taskbar's TC button and selected close.
Checked in task manager - TC is there and uses 99% of virtual CPU.
So I launched VC, attached to the process and tried to see what goes on.
It was deep in system dlls, I traced it back to TC code and tried stepping through it.

Code: Select all

00636222 53                   push        ebx
00636223 56                   push        esi
00636224 57                   push        edi
00636225 89 45 FC             mov         dword ptr [ebp-4],eax
00636228 8D 75 F4             lea         esi,[ebp-0Ch]
0063622B 8B 45 FC             mov         eax,dword ptr [ebp-4]
0063622E C6 80 9B 0D 00 00 00 mov         byte ptr [eax+0D9Bh],0
00636235 8B 45 FC             mov         eax,dword ptr [ebp-4]
00636238 C6 80 98 0D 00 00 01 mov         byte ptr [eax+0D98h],1
0063623F 8B 45 FC             mov         eax,dword ptr [ebp-4]
00636242 C6 80 99 0D 00 00 00 mov         byte ptr [eax+0D99h],0
00636249 8B 45 FC             mov         eax,dword ptr [ebp-4]
0063624C C7 80 94 0D 00 00 9C mov         dword ptr [eax+0D94h],0FFFFFF9Ch
00636256 33 C0                xor         eax,eax
00636258 55                   push        ebp
00636259 68 39 63 63 00       push        636339h
0063625E 64 FF 30             push        dword ptr fs:[eax]
00636261 64 89 20             mov         dword ptr fs:[eax],esp
00636264 E9 B6 00 00 00       jmp         0063631F
00636269 8B 45 FC             mov         eax,dword ptr [ebp-4]
0063626C 8B 40 24             mov         eax,dword ptr [eax+24h]
0063626F 89 06                mov         dword ptr [esi],eax
00636271 68 FF 00 00 00       push        0FFh
00636276 6A FF                push        0FFh
00636278 6A 00                push        0
0063627A 56                   push        esi
0063627B 6A 01                push        1
0063627D E8 8E 00 DD FF       call        00406310
00636282 8B D8                mov         ebx,eax
00636284 83 FB 01             cmp         ebx,1
00636287 75 05                jne         0063628E
00636289 E8 92 C8 DE FF       call        00422B20
0063628E 4B                   dec         ebx
0063628F 75 0C                jne         0063629D
00636291 8B 45 FC             mov         eax,dword ptr [ebp-4]
00636294 80 B8 98 0D 00 00 00 cmp         byte ptr [eax+0D98h],0
0063629B 75 CC                jne         00636269
0063629D 8B 45 FC             mov         eax,dword ptr [ebp-4]
006362A0 80 B8 98 0D 00 00 00 cmp         byte ptr [eax+0D98h],0
006362A7 0F 84 82 00 00 00    je          0063632F
006362AD 80 3D D4 F5 73 00 00 cmp         byte ptr ds:[73F5D4h],0
006362B4 0F 9F C0             setg        al
006362B7 E8 D8 DF DE FF       call        00424294
006362BC 8B 45 FC             mov         eax,dword ptr [ebp-4]
The call at 0063627D did not return.

Call stack when I pressed break again:

Code: Select all

NTDLL! 7c90e4f4()
USER32! 7e3695f9()
USER32! 7e3696a8()
TOTALCMD! 00636282()
TOTALCMD! 0041925e()
TOTALCMD! 0040364a()
Maybe that will help to locate the problem.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50550
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

The function you found is just a background thread waiting infinitely for commands (WaitForMultipleObjects). This doesn't cost any CPU cycles.

Please get the free tool "what is hang" from here:
http://www.nirsoft.net/utils/what_is_hang.html

It allows to create a report of all the threads, so we should also get the busy main thread.

When you do this, please write which version of Total Commander you used for the test!
Author of Total Commander
https://www.ghisler.com
krasusczak
Senior Member
Senior Member
Posts: 284
Joined: 2011-09-23, 10:35 UTC

Post by *krasusczak »

Well "what is hang" don't give me anything...

TC hang & take one full core but "what is hang" is completely empty./.


TC not really hang but doing something.. from AceHelper I get:
0B14 | Below(0) | 42% | Ready | 144301 | Executive | TOTALCMD.EXE (00403620)

State changes: Ready-Running-Ready-Running-Ready- & so on.......
Also Context switch increase..



Context switch also increase here:
0B24 | Normal(-2) | 0% | Wait | 108987 | WrUserRequest | TOTALCMD.EXE (0073D77C)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50550
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Maybe you can find that busy thread with VC? You can pause the program and look at different threads. It should probably be the main thread which is busy doing something. Just find a stack where the running code is in TOTALCMD...
Author of Total Commander
https://www.ghisler.com
krasusczak
Senior Member
Senior Member
Posts: 284
Joined: 2011-09-23, 10:35 UTC

Post by *krasusczak »

Not really, not at this machine, I don't have VC at this lap & this is very old notebook 10' win no space at hdd, installing VC will akhm// kill already very slowly pc..

I also lost access to all my test machines because I reinstall everything some time ago.., so no virtual machine at this time


You can't reproduce this error in any way?
browny
Senior Member
Senior Member
Posts: 361
Joined: 2007-09-10, 13:19 UTC

Post by *browny »

ghisler(Author) wrote:The function you found is just a background thread Please get the free tool "what is hang"
The program shows nothing. TC is not hung, it is looping.
Process explorer is a better bet.
That should be the thread in question.

Code: Select all

ntkrnlpa.exe+0x6a812
ntkrnlpa.exe+0x29c88
hal.dll+0x6c0e
ntkrnlpa.exe+0x665cf
ntdll.dll+0xe4f4
kernel32.dll+0x2542
TOTALCMD.EXE+0x17390a
TOTALCMD.EXE+0x1925e
TOTALCMD.EXE+0x364a
kernel32.dll+0xb713
And minidump: TOTALCMD.7z
ghisler(Author) wrote:When you do this, please write which version of Total Commander you used for the test!
TC 9.0 beta 13.
browny
Senior Member
Senior Member
Posts: 361
Joined: 2007-09-10, 13:19 UTC

Post by *browny »

Same problem with TC 9.0 beta 14

Code: Select all

ntkrnlpa.exe+0x6a7af
ntkrnlpa.exe+0xf6ee8
ntkrnlpa.exe+0x26ae1
hal.dll+0x6c0e
ntdll.dll+0xf6a5
ntdll.dll+0xf63c
kernel32.dll+0x940c
kernel32.dll+0x2e176
kernel32.dll+0x2542
TOTALCMD.EXE+0x16e512
TOTALCMD.EXE+0x192b2
TOTALCMD.EXE+0x364a
kernel32.dll+0xb713
TOTALCMD_tc9b14.7z
User avatar
j7n
Member
Member
Posts: 192
Joined: 2005-08-07, 21:56 UTC

Post by *j7n »

I observed this problem on Windows XP sp1, Server 2003 sp2, Server 2008 sp2, and Seven sp1 (configured with 7+ Taskbar Tweaker to show classic window control menu) – all 32-bit. If I right-click on the taskbar and choose Close, TC 9 Beta 14 hangs, thread Totalcmd.exe+0x3620 with priority 7 consumes all CPU.

The Stack provided by Process Explorer shows the following on Seven:

Code: Select all

ntdll.dll!RtlNtStatusToDosErrorNoTeb+0x6a
ntdll.dll!RtlNtStatusToDosError+0x32
KERNELBASE.dll!WaitForMultipleObjectsEx+0xd4
KERNELBASE.dll!IsDBCSLeadByteEx+0x10b
kernel32.dll!WaitForSingleObjectEx+0x43
kernel32.dll!WaitForSingleObject+0x12
TOTALCMD.EXE+0x16e512
TOTALCMD.EXE+0x192b2
TOTALCMD.EXE+0x364a
kernel32.dll!BaseThreadInitThunk+0x12
ntdll.dll!RtlInitializeExceptionChain+0xef
ntdll.dll!RtlInitializeExceptionChain+0xc2
On WinXP it shows the following Stack:

Code: Select all

ntoskrnl.exe+0x1db60
ntdll.dll!RtlNtStatusToDosErrorNoTeb+0x4
kernel32.dll!ReleaseMutex+0x25
kernel32.dll!WaitForSingleObject+0xf
TOTALCMD.EXE+0x192b2
TOTALCMD.EXE+0x364a
kernel32.dll!RegisterWaitForInputIdle+0x43

I do not need to launch or focus any software for this to happen. Firefox hasn't been run in the current Windows session at all. The problem happened more rarely on Windows 7: I suspect that the speed of the computer might be a factor. Other software running at the time might be slowing it down, and letting the problem occur sometimes.

TC always closes reliably if I choose Files -> Quit, or rightclick its title bar, and call the same control menu from there.
#148174 Personal license
Running Total Commander v8.52a
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50550
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

The reported addresses are all in background threads waiting idly for jobs. Could you try to get a stack trace for the main thread?

You can ignore all threads waiting in WaitForSingleObject or WaitForMultipleObjects.

kernel32.dll+0x2542 is in WaitForMultipleObjects.
Author of Total Commander
https://www.ghisler.com
User avatar
j7n
Member
Member
Posts: 192
Joined: 2005-08-07, 21:56 UTC

Post by *j7n »

My knowledge on the subject is limited: I do not know which is the main thread.

Here is the state I see in Process Explorer in two events of hanging on Seven and Svr 2003. I don't know if they show the same situation, as the readings look different from one case to another, and as I continue browsing process explorer.

http://pastebin.com/aAjyQFqM
#148174 Personal license
Running Total Commander v8.52a
Post Reply