2014-05-23 46 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