[llvm-commits] [compiler-rt] r172394 - in /compiler-rt/trunk/lib/asan: asan_rtl.cc tests/asan_test.cc

Alexey Samsonov samsonov at google.com
Mon Jan 14 02:18:39 PST 2013


Author: samsonov
Date: Mon Jan 14 04:18:38 2013
New Revision: 172394

URL: http://llvm.org/viewvc/llvm-project?rev=172394&view=rev
Log:
ASan: Disable alloc/dealloc-mismatch checker on Mac for now (it produces weird false positives on googletest)

Modified:
    compiler-rt/trunk/lib/asan/asan_rtl.cc
    compiler-rt/trunk/lib/asan/tests/asan_test.cc

Modified: compiler-rt/trunk/lib/asan/asan_rtl.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_rtl.cc?rev=172394&r1=172393&r2=172394&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_rtl.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_rtl.cc Mon Jan 14 04:18:38 2013
@@ -144,7 +144,9 @@
   f->fast_unwind_on_fatal = true;
   f->fast_unwind_on_malloc = true;
   f->poison_heap = true;
-  f->alloc_dealloc_mismatch = true;
+  // Turn off alloc/dealloc mismatch checker on Mac for now.
+  // TODO(glider): Fix known issues and enable this back.
+  f->alloc_dealloc_mismatch = (ASAN_MAC == 0);
   f->use_stack_depot = true;  // Only affects allocator2.
 
   // Override from user-specified string.

Modified: compiler-rt/trunk/lib/asan/tests/asan_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/asan_test.cc?rev=172394&r1=172393&r2=172394&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/asan_test.cc (original)
+++ compiler-rt/trunk/lib/asan/tests/asan_test.cc Mon Jan 14 04:18:38 2013
@@ -2060,13 +2060,14 @@
   Ident(NoAddressSafety)();
 }
 
+// TODO(glider): Enable this test on Mac when alloc/dealloc mismatch is
+// fixed there.
+#ifndef __APPLE__
 static string MismatchStr(const string &str) {
   return string("AddressSanitizer: alloc-dealloc-mismatch \\(") + str;
 }
 
-// This test is disabled until we enable alloc_dealloc_mismatch by default.
-// The feature is also tested by lit tests.
-TEST(AddressSanitizer, DISABLED_AllocDeallocMismatch) {
+TEST(AddressSanitizer, AllocDeallocMismatch) {
   EXPECT_DEATH(free(Ident(new int)),
                MismatchStr("operator new vs free"));
   EXPECT_DEATH(free(Ident(new int[2])),
@@ -2080,6 +2081,7 @@
   EXPECT_DEATH(delete [] (Ident((int*)malloc(2 * sizeof(int)))),
                MismatchStr("malloc vs operator delete \\[\\]"));
 }
+#endif  // __APPLE__
 
 // ------------------ demo tests; run each one-by-one -------------
 // e.g. --gtest_filter=*DemoOOBLeftHigh --gtest_also_run_disabled_tests





More information about the llvm-commits mailing list