I am running a binary linked with tcmalloc and it is not generating a stack trace for leaks it is detecting.
The output says:
The 1 largest leaks:
Leak of 1401231 bytes in 82093 objects allocated from:
If the preceding stack traces are not enough to find the leaks, try running THIS shell command:
pprof ../../prog "/tmp/prog.15062.prog-end.heap" --inuse_objects --lines --heapcheck --edgefraction=1e-10 --nodefraction=1e-10 --gv
When I run pprof I get a message that there are no nodes to print.
I am enclosing code which has the suspected memory leak by
HeapLeakChecker checker("prog");
....
assert(checker.NoLeaks());
Any ideas as to how to debug this?
I would suggest trying to build the program with -fno-omit-frame-pointer (gcc), as frame pointers might be needed to get a stack trace in some setups.
tcmalloc usually uses libunwind to get the stack traces, but because of deadlock issues this is not usable everywhere.
An interesting information would be if the generated file (/tmp/prog.15062.prog-end.heap in this case) contains some adresses.
来源:https://stackoverflow.com/questions/10818825/tcmalloc-not-generating-stack-traces