[PATCH] [lsan] Add an interface function for on-demand leak checking.

Alexey Samsonov vonosmas at gmail.com
Tue Apr 21 12:50:41 PDT 2015


LGTM!

I think that printing SUMMARY multiple times is fine. We do this in both TSan and (recoverable) UBSan, for instance. Leaking symbolization is an issue... Let me know if you want to investigate it, or delegate it to me.


================
Comment at: include/sanitizer/lsan_interface.h:61
@@ +60,3 @@
+  // affected by them.
+  int __lsan_do_extra_leak_check();
+
----------------
Bikeshedding suggestion from me:
  __lsan_do_recoverable_leak_check()

================
Comment at: lib/lsan/lsan_common.cc:333
@@ +332,3 @@
+static void ResetTagsCb(uptr chunk, void *arg) {
+  chunk = GetUserBegin(chunk);
+  LsanMetadata m(chunk);
----------------
Add
  void(arg)
to defeat unused-variable warning?

================
Comment at: lib/lsan/lsan_common.cc:443
@@ -426,1 +442,3 @@
+  bool have_leaks = CheckForLeaks();
+  if (have_leaks) {
     if (flags()->exitcode) {
----------------
  if (!have_leaks)
    return;
  <more code>

http://reviews.llvm.org/D9159

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list