Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
alk opened this issue Aug 23, 2015 · 3 comments

Comments

@alk
Copy link
Contributor

alk commented Aug 23, 2015

Originally reported on Google Code with ID 652

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
----------------

Reported by krmayank on 2014-10-02 06:42:08

@alk
Copy link
Contributor Author

alk commented Aug 23, 2015

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

Reported by alkondratenko on 2015-01-10 22:07:20

@alk
Copy link
Contributor Author

alk commented Aug 23, 2015

Reported by alkondratenko on 2015-01-10 22:07:45

@alk
Copy link
Contributor Author

alk commented Aug 23, 2015

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)

Reported by alkondratenko on 2015-01-10 22:08:33

@alk alk closed this as completed Feb 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant