UMDH not giving call stack

ⅰ亾dé卋堺 提交于 2019-12-25 07:24:49

问题


I'm using UMDH(x64) to test memory leak. My code is neither FPO optimized nor using customized allocators. It uses just "new" operator.

"Create User Mode stack trace Database" is enabled in the Gflags(x64) for the image that's being tested.

I have tracked my application using UMDH both in non-leaky case and leaky case and obtained the logs in both the cases.

And compared the logs with UMDH. It has picked the right pdb as evident from its comment lines in the top.

Problem:

The call stack doesn't show my code's stack. It just traces generic windows functions names. I have tried with both debug and release versions in x64. Am I missing something?

The code and diff trace obtained are below:

// code:
#include <iostream>
using namespace std;

void myFunc()
{
   int k;
   cin >> k;
   int* ii = new int[1998];

   if (k == 0) delete[] ii;
}

int main()
{
   myFunc();
   return 0;
}


// stack trace obtained:
+     390 (   390 -     0)      1 allocs    BackTraceAC905E8D
+       1 (     1 -     0)  BackTraceAC905E8D   allocations

ntdll!RtlpCallInterceptRoutine+0000003F
ntdll!RtlpAllocateHeapInternal+0000069F
ntdll!TppWorkerThread+00000ADB
KERNEL32!BaseThreadInitThunk+00000022
ntdll!RtlUserThreadStart+00000034
.....
.....
...

回答1:


As described in Using UMDH to Find a User-Mode Memory Leak (MSDN), you need to define the environment variable _NT_SYMBOL_PATH before using UMDH.

If you run it from command line, use

set _NT_SYMBOL_PATH=c:\mysymbols;srv*c:\mycache*https://msdl.microsoft.com/download/symbols 


来源:https://stackoverflow.com/questions/40231877/umdh-not-giving-call-stack

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!