none
How to find out the stack trace of an allocation with WinDbg? RRS feed

  • Question

  • Hi,

    I'm trying to detect a memory leak with WinDbg, with "address -summary" command, I found "RegionUsageHeap" is increasing;

    I try to find the memory leak, following the WinDbg samples:

    1. Enable "Create user mode stack trace database" and page hape (gflags.exe /i Mapp.exe +ust +hpa)

    2. In my case, the size of the leak is a48, so I use "!heap -flt s a48" to list all blocks

    _HEAP @ 4ee0000
          HEAP_ENTRY Size Prev Flags    UserPtr UserSize - state
            04ee4e90 014a 0000  [01]   04ee4e98    00a48 - (busy)

    3. Do a "!heap -p -a 04ee4e90"

    address 04ee4e90 found in
        _HEAP @ 4ee0000
          HEAP_ENTRY Size Prev Flags    UserPtr UserSize - state
            04ee4e90 014a 0000  [01]   04ee4e98    00a48 - (busy)

     

    Then I don't know how to do "dt ntdll!_DPH_HEAP_BLOCK StackTrace" and "dds" ,

    If I execute "dt ntdll!_DPH_HEAP_BLOCK StackTrace 04ee4e90" then get  "+0x024 StackTrace : 0x00000005 _RTL_TRACE_BLOCK"

     

    Please guide how to get the stack trace, this memory leak could be a unmanaged heap leak but it's really hard to find it out.

     

    Thanks.

    Friday, April 22, 2011 7:09 AM

Answers

All replies

  • seems restart application can solve the problem,

    now I can get the trace:

    address 18429030 found in
        _HEAP @ 5ea0000
          HEAP_ENTRY Size Prev Flags    UserPtr UserSize - state
            18429030 014c 0000  [07]   18429038    00a48 - (busy)
            Trace: 25a8
            7c96fbca ntdll!RtlDebugAllocateHeap+0x000000e1
            7c94b244 ntdll!RtlAllocateHeapSlowly+0x00000044
            7c919c0c ntdll!RtlAllocateHeap+0x00000e64
            5ca4f8f ippcore_7_0!ippGetLibVersion+0x00000bbf

     

    but when perform "dt ntdll!_DPH_HEAP_BLOCK StackTrace", get an error "Memory read error 000025cc"

    Friday, April 22, 2011 10:07 AM
  • Maybe this forum is better,
    http://social.msdn.microsoft.com/Forums/en/vsdebug/threads

    Hard hard work, Day day up!
    • Marked as answer by xhuan8 Saturday, October 29, 2011 5:46 AM
    Tuesday, April 26, 2011 10:09 AM