[llvm-dev] Docs for leak checker (and other sanitizers)?

Greg Stark via llvm-dev llvm-dev at lists.llvm.org
Sat Nov 7 11:55:47 PST 2015


I'm having trouble finding any documentation of the sanitizers,
especially the leak checker -- apparently because of the move from
code.google.com to github. Every doc has a link for "more information"
which goes to code.google.com which just redirects to github and
points to a placeholder doc that says lots of links are broken. I
haven't found the docs using any google-fu or greps over the source
tree so I'm hoping I'm just missing something.

In particular I'm looking for a few specific pieces of API:

1) I have a server that runs in a loop but I want to use the leak
checker to check that each trip through the loop (or more likely every
1,000 trips or so) hasn't leaked memory. There are obviously
allocations prior to the main loop that are "leaked" and for that
matter I want to skip the first few thousand trips or else various
data structures that grow gradually will show up as leaks. So I need
to be able to control when the leak checker actually starts looking at
allocations and which it checks. Ideally I would want to print the
reports and only abort if its growing consistently or by more than
some amount but that may not be necessary if I can track down where
the growth is currently.

2) I want to use the poison/unpoison macros and function calls for
asan and msan. However I haven't been able to find any documentation
on this api. In particular msan and asan seem to have different
thoughts on whether these functions should be called directly or
through macros so I'm not sure which is the stable api. Also I have no
idea when to call __msan_allocated_memory() and company but I suspect
it's relevant for giving msan enough information about a pool
allocator to find leaks...

-- 
greg


More information about the llvm-dev mailing list