I have an application that is hanging, apparently because a thread is not detaching:
000a:Call kernel32.ExitThread(00000000) ret=4077907f 000a:Call ntdll.LdrShutdownThread() ret=40376278 000a:Call PE DLL (proc=0x40ea2024,module=0x40ea0000 L"midimap.drv",reason=THREAD_DETACH,res=(nil)) 000a:Ret PE DLL (proc=0x40ea2024,module=0x40ea0000 L"midimap.drv",reason=THREAD_DETACH,res=(nil)) retval=1 000a:Call PE DLL (proc=0x40d4a02c,module=0x40d40000 L"msacm.drv",reason=THREAD_DETACH,res=(nil)) 000a:Ret PE DLL (proc=0x40d4a02c,module=0x40d40000 L"msacm.drv",reason=THREAD_DETACH,res=(nil)) retval=1 000a:Call PE DLL (proc=0x40d1405c,module=0x40d10000 L"wineoss.drv",reason=THREAD_DETACH,res=(nil)) 000a:Ret PE DLL (proc=0x40d1405c,module=0x40d10000 L"wineoss.drv",reason=THREAD_DETACH,res=(nil)) retval=1 000a:Call PE DLL (proc=0x407dc1d8,module=0x407d0000 L"user32.dll",reason=THREAD_DETACH,res=(nil)) 000a:Call ntdll.RtlAllocateHeap(401e0000,00000000,00000080) ret=4080a08c 000a:Ret ntdll.RtlAllocateHeap() retval=4026cfd8 ret=4080a08c err:ntdll:RtlpWaitForCriticalSection section 0x403f2580 "syslevel.c: Win16Mutex" wait timed out in thread 000b, blocked by 000a, retrying (60 sec) err:ntdll:RtlpWaitForCriticalSection section 0x408849c0 "../../windows/user.c: USER_SysLevel" wait timed out in thread 000a, blocked by 000b, retrying (60 sec)
The place it is happening is in WIN_GetPtr(), in the call to USER_Lock(). It is getting to RtlpWaitForCriticalSection() and hanging forever:
000a:Call PE DLL (proc=0x407dc1d8,module=0x407d0000 L"user32.dll",reason=THREAD_DETACH,res=(nil)) trace:ntdll:RtlEnterCriticalSection Here trace:ntdll:RtlEnterCriticalSection finished SpinCount trace:ntdll:RtlEnterCriticalSection done trace:ntdll:RtlEnterCriticalSection Here trace:ntdll:RtlEnterCriticalSection finished SpinCount trace:ntdll:RtlEnterCriticalSection done trace:win:WIN_DestroyThreadWindows Destroying windows 000a:Call ntdll.RtlAllocateHeap(401e0000,00000000,00000080) ret=4080a08c trace:ntdll:RtlEnterCriticalSection Here trace:ntdll:RtlEnterCriticalSection finished SpinCount trace:ntdll:RtlEnterCriticalSection done 000a:Ret ntdll.RtlAllocateHeap() retval=4026cff8 ret=4080a08c trace:win:WIN_DestroyThreadWindows Start trace:win:WIN_DestroyThreadWindows 0 : 0x10022 trace:win:WIN_IsCurrentThread here trace:win:WIN_GetPtr here trace:win:WIN_GetPtr 1 trace:syslevel:_EnterSysLevel (0x40885ae0, level 2): thread a count before 0 trace:ntdll:RtlEnterCriticalSection Here trace:ntdll:RtlEnterCriticalSection finished SpinCount trace:ntdll:RtlpWaitForCriticalSection Here err:ntdll:RtlpWaitForCriticalSection section 0x403f2580 "syslevel.c: Win16Mutex" wait timed out in thread 000b, blocked by 000a, retrying (60 sec)
Any clues on what should be happening here?