2014-05-23 40 views
2

我正在调查使用System.DirectoryServices托管包装进行AD操作的.Net 4.0应用程序中的本机内存泄漏。在WinDbg中为.Net本机映像获取完整堆栈跟踪

我叫堆-l,得到了许多成果,其中包括这样的事情:

000007fdb4bb1e65: KERNELBASE!LocalAlloc+0x0000000000000071 
000007fdacb73794: adsldpc!AllocADsStr+0x000000000000004a 
000007fdacb8967c: adsldpc!Oids+0x00000000000000bc 
000007fdacb8a7d1: adsldpc!ObjectClassDescription+0x00000000000002bd 
000007fdacb8e72d: adsldpc!FillClassInfoArray+0x0000000000000135 
000007fdacb8f55c: adsldpc!ProcessSchemaInfo+0x000000000000008c 
000007fdacb8ff3d: adsldpc!LdapReadSchemaInfoFromServer+0x000000000000072d 
000007fdacb920da: adsldpc!LdapGetSchema+0x00000000000003fe 
000007fdacb86388: adsldpc!LdapGetSyntaxOfAttributeOnServerHelper+0x000000000000003c 
000007fdacb86e45: adsldpc!LdapGetSyntaxOfAttributeOnServer+0x0000000000000031 
000007fdacb7af1a: adsldpc!ADsGetColumn+0x000000000000043a 
000007fdabb5c0a8: adsldp!CLDAPGenObject::GetColumn+0x0000000000000050 
000007fd4769c15d: +0x000007fd4769c15d 

我们不会在我们的直接应用程序中使用任何本地代码,所以我猜000007fd4769c15d是在本地的System.DirectoryServices图像的地址,我已经叫IP2MD 000007fd4769c15d结果如下:

MethodDesc: 000007fd4773ab28 
Method Name: DomainBoundILStubClass.IL_STUB_CLRtoCOM(IntPtr, IntPtr, IntPtr) 
Class:  000007fd46b6a758 
MethodTable: 000007fd46b6a7d0 
mdToken:  0000000006000000 
Module:  000007fd46b60348 
IsJitted:  yes 
CodeAddr:  000007fd4769c090 
Transparency: Safe critical 

所以现在我有代码地址,但不知道该如何处理它。我想进一步解开堆栈跟踪,看看哪个代码调用了这个方法。我如何能够实现这样的事情?

+0

你试过Google搜索回答吗? http://msdn.microsoft.com/en-us/library/windows/hardware/ff540665(v=vs.85).aspx – Spook

回答

0

使用bu 000007fd4769c090在CodeAddr的值上设置断点。然后g继续。一旦命中断点,本地堆栈的kb和管理堆栈的!clrstack