bearjb / gperftools

Automatically exported from code.google.com/p/gperftools
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

no symbol information in stack trace produced when leak detected at program exit (in local mode) #652

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.invoke leak checker with HEAPCHECK=local, for a binary compiled statically 
with libtcmalloc_and_profiler.a
2.simulate a leak and let the program exit
3. at program exit the heap checker displays the following output pasted below

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
gperftools-2.0

Please provide any additional information below.

when running pprof pn the profile it correctly displays the symbol information 
at the top of the stack. 
My question is why am i not seeing the stack trace on the leak when the program 
exits. Why is it no able to resolve the symbols. PPROF_PATH is set to the path 
of the pprof binary =/tmp/pprof

Also why the offline analysis tool pprof itself only displays the top of the 
stack and not the full stack trace information. Any information /patches would 
be very helpful.

---------

Leak check lsboot-leaks detected leaks of 10000 bytes in 1 objects
The 1 largest leaks:
Leak of 10000 bytes in 1 objects allocated from:
        @ b6dcde16 
        @ b42f6583 
        @ b42f7604 
        @ b42f6858 
        @ b42f77bd 
        @ b42dad69 
        @ b5b9a0fe 
        @ b4383153 
        @ b438432f 
        @ b43850d6 
        @ b4384a97 
        @ b4384d8b 
        @ b7026723 
        @ b508d39b 
        @ b433f516 
        @ b433f852 
        @ b433f9c1 
        @ b433fca5 
        @ b433ffdf 
        @ b424896b 
        @ b425299f 
        @ 415c4140 
        @ 415278ce 

If the preceding stack traces are not enough to find the leaks, try running 
THIS shell command:

/tmp/pprof /isan/bin/svc_sam_dme "/tmp/svc_sam_dme.32044.lsboot-leaks-end.heap" 
--inuse_objects --lines --heapcheck  --edgefraction=1e-10 --nodefraction=1e-10 
--gv

If you are still puzzled about why the leaks are there, try rerunning this 
program with HEAP_CHECK_TEST_POINTER_ALIGNMENT=1 and/or with 
HEAP_CHECK_MAX_POINTER_OFFSET=-1
If the leak report occurs in a small fraction of runs, try running with 
TCMALLOC_MAX_FREE_QUEUE_SIZE of few hundred MB or with 
TCMALLOC_RECLAIM_MEMORY=false, it might hel
----------------

Original issue reported on code.google.com by krmay...@gmail.com on 2 Oct 2014 at 6:42

GoogleCodeExporter commented 9 years ago
it appears to be by design of "local" heapchecker mode. I.e. every 
HeapLeakChecker  instance is simply writing result to file for pprof to analyze.

It seems to be possible to add NoLeak equivalent that enabled "symbolyze". I.e. 
see 
https://code.google.com/p/gperftools/source/browse/src/gperftools/heap-checker.h
#137

Original comment by alkondratenko on 10 Jan 2015 at 10:07

GoogleCodeExporter commented 9 years ago

Original comment by alkondratenko on 10 Jan 2015 at 10:07

GoogleCodeExporter commented 9 years ago
and btw if you simply use HEAPCHECK=normal your stack traces should have 
symbols (but keep in mind that PPROF_PATH may have to be set)

Original comment by alkondratenko on 10 Jan 2015 at 10:08