[asan] alloc_dealloc_mismatch=0 by default on Android.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Tue, 13 Sep 2016 22:25:44 +0000 (22:25 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Tue, 13 Sep 2016 22:25:44 +0000 (22:25 +0000)
All known (to me) Android deployments are disabling this flag anyway.
The in-tree script (asan_device_setup) does that, too.

llvm-svn: 281410

compiler-rt/lib/asan/asan_flags.inc
compiler-rt/lib/asan/scripts/asan_device_setup
compiler-rt/test/asan/TestCases/Linux/new_delete_mismatch.cc

index 9496a47..ea63383 100644 (file)
@@ -102,7 +102,7 @@ ASAN_FLAG(bool, poison_array_cookie, true,
 // https://github.com/google/sanitizers/issues/309
 // TODO(glider,timurrrr): Fix known issues and enable this back.
 ASAN_FLAG(bool, alloc_dealloc_mismatch,
-          (SANITIZER_MAC == 0) && (SANITIZER_WINDOWS == 0),
+          !SANITIZER_MAC && !SANITIZER_WINDOWS && !SANITIZER_ANDROID,
           "Report errors on malloc/delete, new/free, new/delete[], etc.")
 
 ASAN_FLAG(bool, new_delete_type_mismatch, true,
index 52794b1..b906c86 100755 (executable)
@@ -300,9 +300,7 @@ if [[ -n "$ASAN_RT64" ]]; then
   cp "$ASAN_RT_PATH/$ASAN_RT64" "$TMPDIR/"
 fi
 
-# FIXME: alloc_dealloc_mismatch=0 prevents a failure in libdvm startup,
-# which may or may not be a real bug (probably not).
-ASAN_OPTIONS=start_deactivated=1,alloc_dealloc_mismatch=0,malloc_context_size=0
+ASAN_OPTIONS=start_deactivated=1,malloc_context_size=0
 
 function generate_zygote_wrapper { # from, to, asan_rt
   local _from=$1
index 1cfc0ef..8ae9df5 100644 (file)
@@ -1,8 +1,8 @@
 // Check that we report new[] vs delete as alloc-dealloc-mismatch and not as
 // new-delete-type-mismatch when -fsized-deallocation is enabled.
 
-// RUN: %clangxx_asan -g %s -o %t && not %run %t |& FileCheck %s
-// RUN: %clangxx_asan -fsized-deallocation -g %s -o %t && not %run %t |& FileCheck %s
+// RUN: %clangxx_asan -g %s -o %t && %env_asan_opts=alloc_dealloc_mismatch=1 not %run %t |& FileCheck %s
+// RUN: %clangxx_asan -fsized-deallocation -g %s -o %t && %env_asan_opts=alloc_dealloc_mismatch=1 not %run %t |& FileCheck %s
 
 #include <stdlib.h>