我正在使用一组多线程C ++应用程序,它们通过COM接口进行通信。目前看来,我的一个应用程序挂起了,我不知道该如何继续。
我请客户对已挂起的应用程序进行完整的内存转储,并在Windbg中打开它时,!locks
命令提到某些线程正在(b)锁定其他线程的执行。
这样的(b)锁定线程具有以下调用堆栈:
Not Flagged > 8958 0 Worker Thread ntdll.dll!TppWorkerThread [Inline Frame] combase.dll!CRpcChannelBuffer::ServerGetBuffer
ntdll.dll!NtAlpcCreateSectionView()
rpcrt4.dll!AlpcAllocateView(void *,unsigned __int64,void *,void * *,unsigned __int64 *)
rpcrt4.dll!PrepareSectionForUse(class LRPC_CACHED_SECTION *,void *,void * *)
rpcrt4.dll!LRPC_SECTION_CACHE::PrepareSectionForUse(class LRPC_CACHED_SECTION *,class SectionReadyForUseInfo *,void * *)
rpcrt4.dll!LRPC_SECTION_CACHE::GetSectionAndView(unsigned __int64,int (*)(class LRPC_CACHED_SECTION *,void *,void * *),void *,struct _CLIENT_ID,void * *,void * *,unsigned __int64 *)
rpcrt4.dll!LRPC_SASSOCIATION::AlpcAllocateSectionAndView(unsigned __int64,struct _CLIENT_ID,void * *,void * *,unsigned __int64 *)
rpcrt4.dll!LRPC_SCALL::GetBuffer(struct _RPC_MESSAGE *,struct _GUID *)
rpcrt4.dll!I_RpcGetBufferWithObject()
[Inline Frame] combase.dll!CRpcChannelBuffer::ServerGetBuffer(tagRPCOLEMESSAGE *) Line 3769
[Inline Frame] combase.dll!CRpcChannelBuffer::GetBuffer(tagRPCOLEMESSAGE *) Line 2720
[Inline Frame] combase.dll!CAptRpcChnl::GetBuffer(tagRPCOLEMESSAGE *) Line 637
combase.dll!CCtxComChnl::GetBuffer(tagRPCOLEMESSAGE * pMessage=0x0000008cd187f3e8, const _GUID & riid={...}) Line 555
combase.dll!NdrExtStubGetBuffer(void * pvThis, void * pvChannel=0x0000008a3d7e72e8, _MIDL_STUB_MESSAGE * pStubMsg=0x000000905287e0b0) Line 1953
rpcrt4.dll!NdrStubCall2()
rpcrt4.dll!NdrStubCall3()
combase.dll!CStdStubBuffer_Invoke(IRpcStubBuffer * This, tagRPCOLEMESSAGE * prpcmsg, IRpcChannelBuffer * pRpcChannelBuffer) Line 1507
combase.dll!SyncStubInvoke(tagRPCOLEMESSAGE * pMsg, const _GUID & riid, CIDObject * pID, void * pVtableAddress, IRpcChannelBuffer * pChnl, IRpcStubBuffer * pStub, void * pInterface, unsigned long * pdwFault) Line 1664
[Inline Frame] combase.dll!StubInvoke(tagRPCOLEMESSAGE * pMsg=0x0000008cd187f3e8, CStdIdentity *) Line 1957
combase.dll!CCtxComChnl::ContextInvoke(tagRPCOLEMESSAGE * pMessage=0x0000008cd187f3e8, IRpcStubBuffer * pStub=0x0000008a3d7e5290, tagIPIDEntry * pIPIDEntry=0x0000008a3d7e7840, unsigned long * pdwFault=0x000000905287ed00) Line 1377
[Inline Frame] combase.dll!DefaultInvokeInApartment(tagRPCOLEMESSAGE *) Line 2716
combase.dll!AppInvoke(CMessageCall * pCall=0x0000008cd187f340, CRpcChannelBuffer * pChannel=0x0000008a3d7e72e8, IRpcStubBuffer * pStub=0x0000008a3d7e5290, void * pv, void * pStubBuffer=0x0000008e8cfda1f8, tagIPIDEntry * pIPIDEntry=0x0000008a3d7e7840, WireLocalThis * pLocalb=0x0000008e8cfda1e8) Line 1481
combase.dll!ComInvokeWithLockAndIPID(CMessageCall * pCall, tagIPIDEntry * pIPIDEntry) Line 2313
combase.dll!ThreadInvoke(_RPC_MESSAGE * pMessage=0x0000008a465355b0) Line 5539
rpcrt4.dll!DispatchToStubInCNoAvrf()
rpcrt4.dll!RPC_INTERFACE::DispatchToStubWorker(struct _RPC_MESSAGE *,unsigned int,int,long *)
rpcrt4.dll!LRPC_SCALL::DispatchRequest(int *)
rpcrt4.dll!LRPC_SCALL::HandleRequest(struct _PORT_MESSAGE *,struct _PORT_MESSAGE *,void *,unsigned __int64)
rpcrt4.dll!LRPC_SASSOCIATION::HandleRequest(struct _PORT_MESSAGE *,struct _PORT_MESSAGE *,void *,unsigned __int64,int,class RPCP_ALPC_TOKEN_ATTR *,class RPCP_ALPC_HANDLE_ATTR *)
rpcrt4.dll!LRPC_ADDRESS::ProcessIO(void *)
rpcrt4.dll!LrpcIoComplete(struct _TP_CALLBACK_INSTANCE *,void *,struct _TP_ALPC *,void *)
ntdll.dll!TppAlpcpExecuteCallback()
ntdll.dll!TppWorkerThread()
kernel32.dll!BaseThreadInitThunk()
ntdll.dll!RtlUserThreadStart()
所有其他(b)锁定线程都具有类似的调用堆栈,但是似乎还有其他线程在执行NtAlpcCreateSectionView()
时没有(b)锁定程序的执行。
我对COM内部一无所知。有人可以给我任何指示,以指示我应该在哪里寻找解决方案,解决方法,说明...吗?
非常感谢