[PATCH] D28480: ASAN activate/deactive controls thread_local_quarantine_size_kb option.
Aleksey Shlyapnikov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 9 16:00:15 PST 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL291511: ASAN activate/deactive controls thread_local_quarantine_size_kb option. (authored by alekseyshl).
Changed prior to commit:
https://reviews.llvm.org/D28480?vs=83690&id=83728#toc
Repository:
rL LLVM
https://reviews.llvm.org/D28480
Files:
compiler-rt/trunk/lib/asan/asan_flags.cc
compiler-rt/trunk/test/asan/TestCases/Linux/thread_local_quarantine_size_kb.cc
Index: compiler-rt/trunk/lib/asan/asan_flags.cc
===================================================================
--- compiler-rt/trunk/lib/asan/asan_flags.cc
+++ compiler-rt/trunk/lib/asan/asan_flags.cc
@@ -169,6 +169,11 @@
(ASAN_LOW_MEMORY) ? 1 << 6 : FIRST_32_SECOND_64(1 << 8, 1 << 10);
f->thread_local_quarantine_size_kb = kDefaultThreadLocalQuarantineSizeKb;
}
+ if (f->thread_local_quarantine_size_kb == 0 && f->quarantine_size_mb > 0) {
+ Report("%s: thread_local_quarantine_size_kb can be set to 0 only when "
+ "quarantine_size_mb is set to 0\n", SanitizerToolName);
+ Die();
+ }
if (!f->replace_str && common_flags()->intercept_strlen) {
Report("WARNING: strlen interceptor is enabled even though replace_str=0. "
"Use intercept_strlen=0 to disable it.");
Index: compiler-rt/trunk/test/asan/TestCases/Linux/thread_local_quarantine_size_kb.cc
===================================================================
--- compiler-rt/trunk/test/asan/TestCases/Linux/thread_local_quarantine_size_kb.cc
+++ compiler-rt/trunk/test/asan/TestCases/Linux/thread_local_quarantine_size_kb.cc
@@ -5,8 +5,10 @@
// RUN: FileCheck %s --check-prefix=CHECK-VALUE
// RUN: %env_asan_opts=thread_local_quarantine_size_kb=64:quarantine_size_mb=64 %run %t 2>&1 | \
// RUN: FileCheck %s --allow-empty --check-prefix=CHECK-SMALL-LOCAL-CACHE-SMALL-OVERHEAD
-// RUN: %env_asan_opts=thread_local_quarantine_size_kb=0:quarantine_size_mb=64 %run %t 2>&1 | \
-// RUN: FileCheck %s --check-prefix=CHECK-NO-LOCAL-CACHE-HUGE-OVERHEAD
+// RUN: %env_asan_opts=thread_local_quarantine_size_kb=0:quarantine_size_mb=0 %run %t 2>&1 | \
+// RUN: FileCheck %s --check-prefix=CHECK-QUARANTINE-DISABLED
+// RUN: %env_asan_opts=thread_local_quarantine_size_kb=0:quarantine_size_mb=64 not %run %t 2>&1 | \
+// RUN: FileCheck %s --check-prefix=CHECK-FOR-PARAMETER-ERROR
#include <stdio.h>
#include <stdlib.h>
@@ -37,4 +39,5 @@
// CHECK-VALUE: thread_local_quarantine_size_kb=256K
// CHECK-SMALL-LOCAL-CACHE-SMALL-OVERHEAD-NOT: Heap size limit exceeded
-// CHECK-NO-LOCAL-CACHE-HUGE-OVERHEAD: Heap size limit exceeded
+// CHECK-QUARANTINE-DISABLED-NOT: Heap size limit exceeded
+// CHECK-FOR-PARAMETER-ERROR: thread_local_quarantine_size_kb can be set to 0 only when quarantine_size_mb is set to 0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28480.83728.patch
Type: text/x-patch
Size: 2335 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170110/e3926cc9/attachment.bin>
More information about the llvm-commits
mailing list