<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 7, 2015 at 11:55 AM, Greg Stark via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" onclick="window.open('https://mail.google.com/mail/?view=cm&tf=1&to=llvm-dev@lists.llvm.org&cc=&bcc=&su=&body=','_blank');return false;">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I'm having trouble finding any documentation of the sanitizers,<br>
especially the leak checker -- apparently because of the move from<br>
<a href="http://code.google.com" rel="noreferrer" target="_blank">code.google.com</a> to github.</blockquote><div>Yea. We hope to clean these up in Dec. </div><div>Help is welcome! </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> Every doc has a link for "more information"<br>
which goes to <a href="http://code.google.com" rel="noreferrer" target="_blank">code.google.com</a> which just redirects to github and<br>
points to a placeholder doc that says lots of links are broken. I<br>
haven't found the docs using any google-fu or greps over the source<br>
tree so I'm hoping I'm just missing something.<br></blockquote><div><br></div><div>Most likely, you need <a href="https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer">https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer</a></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
In particular I'm looking for a few specific pieces of API:<br>
<br>
1) I have a server that runs in a loop but I want to use the leak<br>
checker to check that each trip through the loop (or more likely every<br>
1,000 trips or so) hasn't leaked memory. There are obviously<br>
allocations prior to the main loop that are "leaked" and for that<br>
matter I want to skip the first few thousand trips or else various<br>
data structures that grow gradually will show up as leaks. So I need<br>
to be able to control when the leak checker actually starts looking at<br>
allocations and which it checks. Ideally I would want to print the<br>
reports and only abort if its growing consistently or by more than<br>
some amount but that may not be necessary if I can track down where<br>
the growth is currently.<br></blockquote><div><br></div><div>I don't think lsan supports this mode directly, </div><div>but why do you think that the init-time allocations are going to be "leaked"? </div><div>If there is some object still pointing to those allocations lsan will not complain. </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
2) I want to use the poison/unpoison macros and function calls for<br>
asan and msan. However I haven't been able to find any documentation<br>
on this api. In particular msan and asan seem to have different<br>
thoughts on whether these functions should be called directly or<br>
through macros so I'm not sure which is the stable api.</blockquote><div><br></div><div>The best documentation you can find is the the headers, [am]san_interface.h</div><div>Macros are given for convenience, you don't have to use them. </div><div>api is pretty stable </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> Also I have no<br>
idea when to call __msan_allocated_memory() and company but I suspect<br>
it's relevant for giving msan enough information about a pool<br>
allocator to find leaks...<br></blockquote><div><br></div><div>msan and lsan do not work together yet, so there is not reason to call msan api if you want to increase lsan sensitivity. </div><div>asan does work with lsan, and marking some stale memory as poisoned in asan mode gives some advantages: </div><div>E.g. see <a href="https://github.com/google/sanitizers/wiki/AddressSanitizerContainerOverflow">https://github.com/google/sanitizers/wiki/AddressSanitizerContainerOverflow</a> (at the bottom)</div><div> </div><div><br></div><div>hth, </div><div><br></div><div>--kcc </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span class=""><font color="#888888"><br>
--<br>
greg<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" onclick="window.open('https://mail.google.com/mail/?view=cm&tf=1&to=llvm-dev@lists.llvm.org&cc=&bcc=&su=&body=','_blank');return false;">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</font></span></blockquote></div><br></div></div>