[PATCH] [lsan] Add __lsan_disable() and __lsan_enable().

Sergey Matveev earthdok at google.com
Mon Jun 3 04:05:19 PDT 2013



================
Comment at: lib/lsan/lit_tests/TestCases/disabler.cc:4
@@ +3,3 @@
+// RUN: %clangxx_lsan -I %p/../../../../include %s -o %t
+// RUN: LSAN_OPTIONS=$LSAN_BASE %t 2>&1 | FileCheck %s
+
----------------
Kostya Serebryany wrote:
> again, I don't like tests that don't run with default options
Running this test with default options does not give us any useful information. OTOH, we would have to take precautions to keep the pointers from being written over (or the clean run would report leaks). In my opinion it would only complicate the test needlessly.

================
Comment at: lib/lsan/lit_tests/TestCases/disabler.cc:18
@@ +17,3 @@
+  *reinterpret_cast<void **>(p) = malloc(666);
+  void *q = malloc(1337);
+  return 0;
----------------
Kostya Serebryany wrote:
> this is risky. the compiler may nuke this expression, potentially even at O0. 
> Hide this from the compiler, e.g. using the break_optimization trick from (asan/lit_tests/stack-oob-frames.cc,CPP)
Honoring the principle of least astonishment, I put the same fprintf here as in other tests.


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

BRANCH
  feat/lsan/suppression-hooks

ARCANIST PROJECT
  compiler-rt



More information about the llvm-commits mailing list