[PATCH] Tests and interface for LeakSanitizer.

Sergey Matveev earthdok at google.com
Mon May 13 06:24:50 PDT 2013


  I also removed lsan_testing_interface.h from this CL. I'm about to submit lsan_common.h, where those declarations duly belong, so I might as well merge those headers now.


================
Comment at: lib/lsan/tests/lsan_test.cc:38
@@ +37,3 @@
+// TODO(smatveev): Ensure that this is bigger than maxsize in primary allocator.
+uptr kLargeAllocSize = 1 << 20;
+
----------------
Kostya Serebryany wrote:
> replace with 1<<25 and remove TODO (add a comment saying that this is always larger than maxsize)
done

================
Comment at: lib/lsan/tests/lsan_tls_loadable.cc:21
@@ +20,3 @@
+
+extern "C" void **store(void *p) {
+  huge_thread_local_array[0] = p;
----------------
Kostya Serebryany wrote:
> I think the name is too short. StoreToHugeTLSArray?
renamed to StoreToTLS

================
Comment at: lib/lsan/tests/lsan_test.cc:65
@@ +64,3 @@
+  *p = malloc(kSmallAllocSize);
+  EXPECT_NOT_LEAKED(*p, baseline);
+  EXPECT_LEAKED(*p, baseline & ~source);
----------------
Kostya Serebryany wrote:
> are you intentionally calling EXPECT_NOT_LEAKED twice? 
> If yes, please comment. 
Commented. It's less useful now that I can disable stacks as pointer sources, but I feel safer with an extra check and don't see a good reason to remove it.


http://llvm-reviews.chandlerc.com/D677

BRANCH
  lsan_interface_and_tests

ARCANIST PROJECT
  compiler-rt



More information about the llvm-commits mailing list