2009-11-16 85 views
0

我用下面的命令在WinDbg中狩獵內存泄漏

!heap –l 

隨着每次泄露的堆塊,我得到發現泄露的堆塊,我運行以下命令獲取堆棧跟蹤。

!heap -p -a leakedheapblock 

以下是此命令的結果:

address 1c841cc0 found in 
_HEAP @ 3930000 
    HEAP_ENTRY Size Prev Flags UserPtr UserSize - state 
    1c851cc0 0009 0000 [03] 1c851ce8 0000c - (busy) 
    Trace: 84f8 
    7c873c19 ntdll!RtlpDphNormalHeapAllocate+0x00000030 
    7c876870 ntdll!RtlpDebugPageHeapAllocate+0x00000335 
    7c8794a8 ntdll!RtlDebugAllocateHeap+0x0000002d 
    7c8531e4 ntdll!RtlAllocateHeapSlowly+0x00000041 
    7c83d97a ntdll!RtlAllocateHeap+0x00000e9f 
    1699d238 MyLibrary!malloc+0x0000007a 

我怎樣才能找到泄漏「在MyLibrary」的一段代碼。

+0

你gflags.exe /我yourApplication.exe +烏斯? – EFraim 2009-11-16 18:13:16

+0

是的,我啓用了用戶堆棧跟蹤 – Julian 2009-11-16 18:18:14

回答