EDN Admin
Well-known member
Hi,
My application got hung randomly. The callstack looks quite wired.
Among all these methods, the method DoCleanupWithGcProtection looks quite strange because this is a worker thread created by us. Anyone know the purpose of DoCleanupWithGcProtection ?0:014> !dumpstack
OS Thread Id: 0x8c8 (14)
Current frame: ntdll!NtWaitForMultipleObjects+0x15
ChildEBP RetAddr Caller,Callee
1835e2d0 752015e9 KERNELBASE!WaitForMultipleObjectsEx+0x100, calling ntdll!ZwWaitForMultipleObjects
1835e324 752015e9 KERNELBASE!WaitForMultipleObjectsEx+0x100, calling ntdll!ZwWaitForMultipleObjects
1835e334 755506eb user32!_PeekMessage+0x88, calling user32!NtUserPeekMessage
1835e36c 76b31a2c kernel32!WaitForMultipleObjectsExImplementation+0xe0, calling KERNELBASE!WaitForMultipleObjectsEx
1835e39c 7582cf85 ole32!CCliModalLoop::MyPeekMessage+0xd0 [d:w7rtmcomole32comdcomremcallctrl.cxx:1778], calling ole32!__SEH_epilog4 [d:winmainminkernelcrtscrtw32misci386sehprolg4.asm:116]
1835e3b4 7555086a user32!RealMsgWaitForMultipleObjectsEx+0x14d, calling kernel32!WaitForMultipleObjectsExImplementation
1835e408 75832bf1 ole32!CCliModalLoop::BlockFn+0xa1 [d:w7rtmcomole32comdcomremcallctrl.cxx:1222], calling user32!MsgWaitForMultipleObjectsEx
1835e434 75832d31 ole32!ModalLoop+0x5b [d:w7rtmcomole32comdcomremchancont.cxx:211], calling ole32!CCliModalLoop::BlockFn [d:w7rtmcomole32comdcomremcallctrl.cxx:1095]
1835e45c 7582d54f ole32!SwitchSTA+0x21 [d:w7rtmcomole32comdcomremchancont.cxx:252], calling ole32!ModalLoop [d:w7rtmcomole32comdcomremchancont.cxx:178]
1835e46c 7594a7c9 ole32!CRpcChannelBuffer::SwitchAptAndDispatchCall+0x135 [d:w7rtmcomole32comdcomremchannelb.cxx:4413], calling ole32!SwitchSTA [d:w7rtmcomole32comdcomremchancont.cxx:235]
1835e49c 7594cef0 ole32!CRpcChannelBuffer::SendReceive2+0xef [d:w7rtmcomole32comdcomremchannelb.cxx:4076], calling ole32!CRpcChannelBuffer::SwitchAptAndDispatchCall [d:w7rtmcomole32comdcomremchannelb.cxx:4294]
1835e4b8 752015e9 KERNELBASE!WaitForMultipleObjectsEx+0x100, calling ntdll!ZwWaitForMultipleObjects
1835e4f8 7742e36c ntdll!RtlpLowFragHeapAllocFromContext+0xaec, calling ntdll!_SEH_epilog4
1835e4fc 7742e0d2 ntdll!RtlAllocateHeap+0x206, calling ntdll!RtlpLowFragHeapAllocFromContext
1835e530 75849ba1 ole32!CClientCall::AddRef+0x16 [d:w7rtmcomole32comdcomremcall.cxx:1881], calling KERNELBASE!InterlockedIncrement
1835e57c 75832cba ole32!CCliModalLoop::SendReceive+0x1e [d:w7rtmcomole32comdcomremcallctrl.cxx:899]
1835e598 75849aa1 ole32!CAptRpcChnl::SendReceive+0x73 [d:w7rtmcomole32comdcomremcallctrl.cxx:583], calling ole32!CCliModalLoop::SendReceive [d:w7rtmcomole32comdcomremcallctrl.cxx:891]
1835e614 7582792b ole32!CCtxComChnl::SendReceive+0x95 [d:w7rtmcomole32comdcomremctxchnl.cxx:679], calling ole32!CAptRpcChnl::SendReceive [d:w7rtmcomole32comdcomremcallctrl.cxx:561]
1835e668 7594ce06 ole32!NdrExtpProxySendReceive+0x49 [d:w7rtmcomrpcndroleproxy.cxx:1932]
1835e684 7527414b rpcrt4!NdrpProxySendReceive+0xe
1835e690 752f0149 rpcrt4!NdrClientCall2+0x1a6
1835e6c8 75868e72 ole32!NdrpOleAllocate [d:w7rtmcomrpcndroleoleaux.cxx:612]
1835e6e8 76d87fb3 oleaut32!Variant_ValidateBuffer+0x34e, calling oleaut32!SafeBuffer::Increment
1835e74c 7525ffda rpcrt4!LRPC_BIND_CCALL::BasePrepareCallForCaching+0x44, calling rpcrt4!LogEvent
1835e760 752578df rpcrt4!LRPC_BASE_BINDING_HANDLE::FreeCallToCache+0x26, calling KERNELBASE!InterlockedCompareExchange
1835e788 75867d36 ole32!InterlockedDecRefCnt+0x44 [d:w7rtmcomole32comincrefcnt.cxx:102], calling KERNELBASE!InterlockedCompareExchange
1835e798 7585eb7f ole32!COleStaticMutexSem::Request+0x39 [d:w7rtmcomole32commonolesem.cxx:177]
1835e7a0 7586907f ole32!CAsyncCall::Release+0x17 [d:w7rtmcomole32comdcomremcall.cxx:881], calling KERNELBASE!InterlockedDecrement
1835e7b0 7586907f ole32!CAsyncCall::Release+0x17 [d:w7rtmcomole32comdcomremcall.cxx:881], calling KERNELBASE!InterlockedDecrement
1835e7c4 7594d1e0 ole32!CRpcChannelBuffer::FreeBuffer+0x65 [d:w7rtmcomole32comdcomremchannelb.cxx:2228]
1835e838 75274184 rpcrt4!NdrpProxyGetBuffer
1835e83c 7527413d rpcrt4!NdrpProxySendReceive
1835e8b0 7742e003 ntdll!RtlFreeHeap+0x105, calling ntdll!RtlpLowFragHeapFree
1835e8b4 75868e72 ole32!NdrpOleAllocate [d:w7rtmcomrpcndroleoleaux.cxx:612]
1835e8b8 758683b2 ole32!NdrpOleFree [d:w7rtmcomrpcndroleoleaux.cxx:636]
1835e8c8 76b314dd kernel32!HeapFree+0x14, calling ntdll!RtlFreeHeap
1835e9d4 75274184 rpcrt4!NdrpProxyGetBuffer
1835e9d8 7527413d rpcrt4!NdrpProxySendReceive
1835ea38 75832623 ole32!CPSHashTable::Compare+0xd [d:w7rtmcomole32comdcomrempstable.cxx:2443], calling ole32!CPolicySet::HashChainToPolicySet [d:w7rtmcomole32comdcomrempstable.hxx:226]
1835ea44 7585a144 ole32!CHashTable::Lookup+0x30 [d:w7rtmcomole32comdcomremhash.cxx:198]
1835ea68 758270ce ole32!CPSHashTable::Lookup+0x25 [d:w7rtmcomole32comdcomrempstable.hxx:319], calling ole32!CPolicySet::HashChainToPolicySet [d:w7rtmcomole32comdcomrempstable.hxx:226]
1835ea78 7585a3a2 ole32!CRWLock::ReleaseReaderLock+0x90 [o:w7rtm.obj.x86frecomole32commondaytonaobjfrei386rwlock_ole32.cxx:3798], calling KERNELBASE!InterlockedCompareExchange
1835eaa4 7594c8e2 ole32!ObjectStublessClient+0xa2 [d:w7rtmcomrpcndrolei386stblsclt.cxx:474], calling rpcrt4!NdrClientCall2
1835eac4 758498ad ole32!ObjectStubless+0xf [d:w7rtmcomrpcndrolei386stubless.asm:154], calling ole32!ObjectStublessClient [d:w7rtmcomrpcndrolei386stblsclt.cxx:389]
1835ead4 7582805c ole32!CObjectContext::InternalContextCallback+0x128 [d:w7rtmcomole32comdcomremcontext.cxx:4299]
1835eb5c 7581d4b4 ole32!CObjectContext::ContextCallback+0x92 [d:w7rtmcomole32comdcomremcontext.cxx:4184]
1835ebac 71d2b77b mscorwks!CtxEntry::EnterContextOle32BugAware+0x2b
1835ebf8 71d2c34b mscorwks!CtxEntry::EnterContext+0x325, calling mscorwks!CtxEntry::EnterContextOle32BugAware
1835ec24 71c87ed7 mscorwks!ReleaseTransitionHelper+0x14b, calling mscorwks!_SEH_epilog4
1835ec3c 71b3535b mscorwks!Thread::EnterRuntimeNoThrow+0xad, calling ntdll!RtlSetLastWin32Error
1835ec54 71b353a2 mscorwks!Thread::LeaveRuntimeNoThrow+0xd7, calling mscorwks!_EH_epilog3
1835ec6c 71b35380 mscorwks!Thread::EnterRuntime+0x1f, calling ntdll!RtlSetLastWin32Error
1835ece8 71c87fe5 mscorwks!SafeRelease+0x44, calling mscorwks!_EH_epilog3
1835ed18 71d2b89d mscorwks!IUnkEntry::MarshalIUnknownToStreamCallback2+0x3c, calling mscorwks!CtxEntry::EnterContext
1835ed2c 71d2ba84 mscorwks!IUnkEntry::UnmarshalIUnknownForCurrContextHelper+0x43, calling mscorwks!IUnkEntry::MarshalIUnknownToStreamCallback2
1835ed5c 71b399ec mscorwks!Thread::EnablePreemptiveGC+0xf, calling mscorwks!Thread::CatchAtSafePoint
1835ed74 71d2befe mscorwks!IUnkEntry::UnmarshalIUnknownForCurrContext+0x1cb, calling mscorwks!IUnkEntry::UnmarshalIUnknownForCurrContextHelper
1835edb8 71d2c058 mscorwks!IUnkEntry::GetIUnknownForCurrContext+0x31, calling mscorwks!IUnkEntry::UnmarshalIUnknownForCurrContext
1835edc4 71bdcb99 mscorwks!RCW::SafeQueryInterfaceRemoteAware+0x16, calling mscorwks!IUnkEntry::GetIUnknownForCurrContext
1835edd8 71c97c78 mscorwks!GetFastContextCookie+0x1b, calling ole32!CoGetContextToken [d:w7rtmcomole32comdcomremcoapi.cxx:1858]
1835edf0 71bd9d74 mscorwks!RCW::GetComIPForMethodTableFromCache+0x6b, calling mscorwks!RCW::SafeQueryInterfaceRemoteAware
1835ee34 71bd9dca mscorwks!RCW::GetComIPFromRCW+0x25, calling mscorwks!RCW::GetComIPForMethodTableFromCache
1835ee44 71bd9e0e mscorwks!ComObject::GetComIPFromRCW+0x40, calling mscorwks!RCW::GetComIPFromRCW
1835ee84 71bda1b0 mscorwks!ComObject::GetComIPFromRCWEx+0x66, calling mscorwks!ComObject::GetComIPFromRCW
1835eec8 71b494d7 mscorwks!StackingAllocator::Collapse+0x1e, calling mscorwks!StackingAllocator::Clear
1835eeec 71be24e6 mscorwks!ComObject::StaticGetComIPFromRCWEx+0x50, calling mscorwks!ComObject::GetComIPFromRCWEx
1835ef38 04774d22 04774d22, calling mscorwks!ComObject::StaticGetComIPFromRCWEx
1835efd8 71b494d7 mscorwks!StackingAllocator::Collapse+0x1e, calling mscorwks!StackingAllocator::Clear
1835eff4 71b92b57 mscorwks!DoCleanupWithGcProtection+0xa6, calling mscorwks!_EH_epilog3
1835f050 71b92b57 mscorwks!DoCleanupWithGcProtection+0xa6, calling mscorwks!_EH_epilog3
1835f054 04774b22 04774b22, calling mscorwks!DoCleanupWithGcProtection
View the full article
My application got hung randomly. The callstack looks quite wired.
Among all these methods, the method DoCleanupWithGcProtection looks quite strange because this is a worker thread created by us. Anyone know the purpose of DoCleanupWithGcProtection ?0:014> !dumpstack
OS Thread Id: 0x8c8 (14)
Current frame: ntdll!NtWaitForMultipleObjects+0x15
ChildEBP RetAddr Caller,Callee
1835e2d0 752015e9 KERNELBASE!WaitForMultipleObjectsEx+0x100, calling ntdll!ZwWaitForMultipleObjects
1835e324 752015e9 KERNELBASE!WaitForMultipleObjectsEx+0x100, calling ntdll!ZwWaitForMultipleObjects
1835e334 755506eb user32!_PeekMessage+0x88, calling user32!NtUserPeekMessage
1835e36c 76b31a2c kernel32!WaitForMultipleObjectsExImplementation+0xe0, calling KERNELBASE!WaitForMultipleObjectsEx
1835e39c 7582cf85 ole32!CCliModalLoop::MyPeekMessage+0xd0 [d:w7rtmcomole32comdcomremcallctrl.cxx:1778], calling ole32!__SEH_epilog4 [d:winmainminkernelcrtscrtw32misci386sehprolg4.asm:116]
1835e3b4 7555086a user32!RealMsgWaitForMultipleObjectsEx+0x14d, calling kernel32!WaitForMultipleObjectsExImplementation
1835e408 75832bf1 ole32!CCliModalLoop::BlockFn+0xa1 [d:w7rtmcomole32comdcomremcallctrl.cxx:1222], calling user32!MsgWaitForMultipleObjectsEx
1835e434 75832d31 ole32!ModalLoop+0x5b [d:w7rtmcomole32comdcomremchancont.cxx:211], calling ole32!CCliModalLoop::BlockFn [d:w7rtmcomole32comdcomremcallctrl.cxx:1095]
1835e45c 7582d54f ole32!SwitchSTA+0x21 [d:w7rtmcomole32comdcomremchancont.cxx:252], calling ole32!ModalLoop [d:w7rtmcomole32comdcomremchancont.cxx:178]
1835e46c 7594a7c9 ole32!CRpcChannelBuffer::SwitchAptAndDispatchCall+0x135 [d:w7rtmcomole32comdcomremchannelb.cxx:4413], calling ole32!SwitchSTA [d:w7rtmcomole32comdcomremchancont.cxx:235]
1835e49c 7594cef0 ole32!CRpcChannelBuffer::SendReceive2+0xef [d:w7rtmcomole32comdcomremchannelb.cxx:4076], calling ole32!CRpcChannelBuffer::SwitchAptAndDispatchCall [d:w7rtmcomole32comdcomremchannelb.cxx:4294]
1835e4b8 752015e9 KERNELBASE!WaitForMultipleObjectsEx+0x100, calling ntdll!ZwWaitForMultipleObjects
1835e4f8 7742e36c ntdll!RtlpLowFragHeapAllocFromContext+0xaec, calling ntdll!_SEH_epilog4
1835e4fc 7742e0d2 ntdll!RtlAllocateHeap+0x206, calling ntdll!RtlpLowFragHeapAllocFromContext
1835e530 75849ba1 ole32!CClientCall::AddRef+0x16 [d:w7rtmcomole32comdcomremcall.cxx:1881], calling KERNELBASE!InterlockedIncrement
1835e57c 75832cba ole32!CCliModalLoop::SendReceive+0x1e [d:w7rtmcomole32comdcomremcallctrl.cxx:899]
1835e598 75849aa1 ole32!CAptRpcChnl::SendReceive+0x73 [d:w7rtmcomole32comdcomremcallctrl.cxx:583], calling ole32!CCliModalLoop::SendReceive [d:w7rtmcomole32comdcomremcallctrl.cxx:891]
1835e614 7582792b ole32!CCtxComChnl::SendReceive+0x95 [d:w7rtmcomole32comdcomremctxchnl.cxx:679], calling ole32!CAptRpcChnl::SendReceive [d:w7rtmcomole32comdcomremcallctrl.cxx:561]
1835e668 7594ce06 ole32!NdrExtpProxySendReceive+0x49 [d:w7rtmcomrpcndroleproxy.cxx:1932]
1835e684 7527414b rpcrt4!NdrpProxySendReceive+0xe
1835e690 752f0149 rpcrt4!NdrClientCall2+0x1a6
1835e6c8 75868e72 ole32!NdrpOleAllocate [d:w7rtmcomrpcndroleoleaux.cxx:612]
1835e6e8 76d87fb3 oleaut32!Variant_ValidateBuffer+0x34e, calling oleaut32!SafeBuffer::Increment
1835e74c 7525ffda rpcrt4!LRPC_BIND_CCALL::BasePrepareCallForCaching+0x44, calling rpcrt4!LogEvent
1835e760 752578df rpcrt4!LRPC_BASE_BINDING_HANDLE::FreeCallToCache+0x26, calling KERNELBASE!InterlockedCompareExchange
1835e788 75867d36 ole32!InterlockedDecRefCnt+0x44 [d:w7rtmcomole32comincrefcnt.cxx:102], calling KERNELBASE!InterlockedCompareExchange
1835e798 7585eb7f ole32!COleStaticMutexSem::Request+0x39 [d:w7rtmcomole32commonolesem.cxx:177]
1835e7a0 7586907f ole32!CAsyncCall::Release+0x17 [d:w7rtmcomole32comdcomremcall.cxx:881], calling KERNELBASE!InterlockedDecrement
1835e7b0 7586907f ole32!CAsyncCall::Release+0x17 [d:w7rtmcomole32comdcomremcall.cxx:881], calling KERNELBASE!InterlockedDecrement
1835e7c4 7594d1e0 ole32!CRpcChannelBuffer::FreeBuffer+0x65 [d:w7rtmcomole32comdcomremchannelb.cxx:2228]
1835e838 75274184 rpcrt4!NdrpProxyGetBuffer
1835e83c 7527413d rpcrt4!NdrpProxySendReceive
1835e8b0 7742e003 ntdll!RtlFreeHeap+0x105, calling ntdll!RtlpLowFragHeapFree
1835e8b4 75868e72 ole32!NdrpOleAllocate [d:w7rtmcomrpcndroleoleaux.cxx:612]
1835e8b8 758683b2 ole32!NdrpOleFree [d:w7rtmcomrpcndroleoleaux.cxx:636]
1835e8c8 76b314dd kernel32!HeapFree+0x14, calling ntdll!RtlFreeHeap
1835e9d4 75274184 rpcrt4!NdrpProxyGetBuffer
1835e9d8 7527413d rpcrt4!NdrpProxySendReceive
1835ea38 75832623 ole32!CPSHashTable::Compare+0xd [d:w7rtmcomole32comdcomrempstable.cxx:2443], calling ole32!CPolicySet::HashChainToPolicySet [d:w7rtmcomole32comdcomrempstable.hxx:226]
1835ea44 7585a144 ole32!CHashTable::Lookup+0x30 [d:w7rtmcomole32comdcomremhash.cxx:198]
1835ea68 758270ce ole32!CPSHashTable::Lookup+0x25 [d:w7rtmcomole32comdcomrempstable.hxx:319], calling ole32!CPolicySet::HashChainToPolicySet [d:w7rtmcomole32comdcomrempstable.hxx:226]
1835ea78 7585a3a2 ole32!CRWLock::ReleaseReaderLock+0x90 [o:w7rtm.obj.x86frecomole32commondaytonaobjfrei386rwlock_ole32.cxx:3798], calling KERNELBASE!InterlockedCompareExchange
1835eaa4 7594c8e2 ole32!ObjectStublessClient+0xa2 [d:w7rtmcomrpcndrolei386stblsclt.cxx:474], calling rpcrt4!NdrClientCall2
1835eac4 758498ad ole32!ObjectStubless+0xf [d:w7rtmcomrpcndrolei386stubless.asm:154], calling ole32!ObjectStublessClient [d:w7rtmcomrpcndrolei386stblsclt.cxx:389]
1835ead4 7582805c ole32!CObjectContext::InternalContextCallback+0x128 [d:w7rtmcomole32comdcomremcontext.cxx:4299]
1835eb5c 7581d4b4 ole32!CObjectContext::ContextCallback+0x92 [d:w7rtmcomole32comdcomremcontext.cxx:4184]
1835ebac 71d2b77b mscorwks!CtxEntry::EnterContextOle32BugAware+0x2b
1835ebf8 71d2c34b mscorwks!CtxEntry::EnterContext+0x325, calling mscorwks!CtxEntry::EnterContextOle32BugAware
1835ec24 71c87ed7 mscorwks!ReleaseTransitionHelper+0x14b, calling mscorwks!_SEH_epilog4
1835ec3c 71b3535b mscorwks!Thread::EnterRuntimeNoThrow+0xad, calling ntdll!RtlSetLastWin32Error
1835ec54 71b353a2 mscorwks!Thread::LeaveRuntimeNoThrow+0xd7, calling mscorwks!_EH_epilog3
1835ec6c 71b35380 mscorwks!Thread::EnterRuntime+0x1f, calling ntdll!RtlSetLastWin32Error
1835ece8 71c87fe5 mscorwks!SafeRelease+0x44, calling mscorwks!_EH_epilog3
1835ed18 71d2b89d mscorwks!IUnkEntry::MarshalIUnknownToStreamCallback2+0x3c, calling mscorwks!CtxEntry::EnterContext
1835ed2c 71d2ba84 mscorwks!IUnkEntry::UnmarshalIUnknownForCurrContextHelper+0x43, calling mscorwks!IUnkEntry::MarshalIUnknownToStreamCallback2
1835ed5c 71b399ec mscorwks!Thread::EnablePreemptiveGC+0xf, calling mscorwks!Thread::CatchAtSafePoint
1835ed74 71d2befe mscorwks!IUnkEntry::UnmarshalIUnknownForCurrContext+0x1cb, calling mscorwks!IUnkEntry::UnmarshalIUnknownForCurrContextHelper
1835edb8 71d2c058 mscorwks!IUnkEntry::GetIUnknownForCurrContext+0x31, calling mscorwks!IUnkEntry::UnmarshalIUnknownForCurrContext
1835edc4 71bdcb99 mscorwks!RCW::SafeQueryInterfaceRemoteAware+0x16, calling mscorwks!IUnkEntry::GetIUnknownForCurrContext
1835edd8 71c97c78 mscorwks!GetFastContextCookie+0x1b, calling ole32!CoGetContextToken [d:w7rtmcomole32comdcomremcoapi.cxx:1858]
1835edf0 71bd9d74 mscorwks!RCW::GetComIPForMethodTableFromCache+0x6b, calling mscorwks!RCW::SafeQueryInterfaceRemoteAware
1835ee34 71bd9dca mscorwks!RCW::GetComIPFromRCW+0x25, calling mscorwks!RCW::GetComIPForMethodTableFromCache
1835ee44 71bd9e0e mscorwks!ComObject::GetComIPFromRCW+0x40, calling mscorwks!RCW::GetComIPFromRCW
1835ee84 71bda1b0 mscorwks!ComObject::GetComIPFromRCWEx+0x66, calling mscorwks!ComObject::GetComIPFromRCW
1835eec8 71b494d7 mscorwks!StackingAllocator::Collapse+0x1e, calling mscorwks!StackingAllocator::Clear
1835eeec 71be24e6 mscorwks!ComObject::StaticGetComIPFromRCWEx+0x50, calling mscorwks!ComObject::GetComIPFromRCWEx
1835ef38 04774d22 04774d22, calling mscorwks!ComObject::StaticGetComIPFromRCWEx
1835efd8 71b494d7 mscorwks!StackingAllocator::Collapse+0x1e, calling mscorwks!StackingAllocator::Clear
1835eff4 71b92b57 mscorwks!DoCleanupWithGcProtection+0xa6, calling mscorwks!_EH_epilog3
1835f050 71b92b57 mscorwks!DoCleanupWithGcProtection+0xa6, calling mscorwks!_EH_epilog3
1835f054 04774b22 04774b22, calling mscorwks!DoCleanupWithGcProtection
View the full article