Its generally been by design that tblgen leaks. Might be nice to fix one day but it's been that way for a while now so don't expect it to be fixed soon.<br><br>If thats the suppression mechanism of choice (I would've expected a build flag option) for lsan, I'd say go for it.<br>
<br>(Maybe there's some existing build flag handling for valgrind so as not to leak check tblgen, but that would be a runtime flag, not build time)<p dir="ltr"></p>
<p dir="ltr">On Wednesday, December 25, 2013 7:08:27 AM, Kostya Serebryany <<a href="mailto:kcc@google.com">kcc</a><a href="mailto:kcc@google.com">@</a><a href="mailto:kcc@google.com">google.com</a>> wrote:</p>
<blockquote><p dir="ltr">Hi, <br></p>
<p dir="ltr">We are trying to enable LeakSanitizer on our asan/msan llvm bootstrap bot</p>
<p dir="ltr">(<a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/">http://</a><a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/">lab.llvm.org</a><a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/">:8011/builders/sanitizer-x86_64-</a><a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/">linux</a><a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/">-bootstrap/</a>).</p>
<p dir="ltr">In clang itself there are two leaks </p>
<p dir="ltr">(<a href="http://llvm.org/bugs/show_bug.cgi?id=18318">http://</a><a href="http://llvm.org/bugs/show_bug.cgi?id=18318">llvm.org</a><a href="http://llvm.org/bugs/show_bug.cgi?id=18318">/bugs/show_bug.cgi?id=18318</a>, <a href="http://llvm-reviews.chandlerc.com/D2472">http://llvm-reviews.chandlerc.com/D2472</a>) </p>
<p dir="ltr">and one lsan-hostile feature (<a href="http://llvm.org/bugs/show_bug.cgi?id=18320">http://llvm.org/bugs/show_bug.cgi?id=18320</a>),</p>
<p dir="ltr">all of which are easy to fix.<br></p>
<p dir="ltr">And there are also lots of leaks in TableGen.</p>
<p dir="ltr">Would anyone be interested in fixing TableGen leaks?</p>
<p dir="ltr">I'd guess not since TableGen is not a user-facing utility, leaks there are not too harmful.</p>
<p dir="ltr">If so, I'd like to disable lsan for TableGen so that </p>
<p dir="ltr">we can enable lsan on the bootstrap bot soon. Objections? <br></p>
<p dir="ltr">--kcc <br></p>
<p dir="ltr">Index: utils/TableGen/TableGen.cpp</p>
<p dir="ltr">===================================================================</p>
<p dir="ltr">--- utils/TableGen/TableGen.cpp (revision 198007)</p>
<p dir="ltr">+++ utils/TableGen/TableGen.cpp (working copy)</p>
<p dir="ltr">@@ -180,3 +180,7 @@</p>
<p dir="ltr"> </p>
<p dir="ltr"> return TableGenMain(argv[0], &LLVMTableGenMain);</p>
<p dir="ltr"> }</p>
<p dir="ltr">+</p>
<p dir="ltr">+extern "C" {</p>
<p dir="ltr">+int __lsan_is_turned_off() { return 1; }</p>
<p dir="ltr">+} // extern "C"</p>
<p dir="ltr">Index: tools/clang/utils/TableGen/TableGen.cpp</p>
<p dir="ltr">===================================================================</p>
<p dir="ltr">--- tools/clang/utils/TableGen/TableGen.cpp (revision 198007)</p>
<p dir="ltr">+++ tools/clang/utils/TableGen/TableGen.cpp (working copy)</p>
<p dir="ltr">@@ -248,3 +248,7 @@</p>
<p dir="ltr"> </p>
<p dir="ltr"> return TableGenMain(argv[0], &ClangTableGenMain);</p>
<p dir="ltr"> }</p>
<p dir="ltr">+</p>
<p dir="ltr">+extern "C" {</p>
<p dir="ltr">+int __lsan_is_turned_off() { return 1; }</p>
<p dir="ltr">+} // extern "C"<br><br></p>
</blockquote>
<p dir="ltr"><br>
</p>