summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorchrisha@google.com <chrisha@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-27 15:08:04 +0000
committerchrisha@google.com <chrisha@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-27 15:08:04 +0000
commitaee2f33ce1dc427fd3b47d8e17f3634ce21f5387 (patch)
treedb20a34a10414e96c320c3ab61c98ecce1cffab0 /base
parent0dcb85a5be580fc9754d8dd0f9615b9a3e0b30f0 (diff)
downloadchromium_src-aee2f33ce1dc427fd3b47d8e17f3634ce21f5387.zip
chromium_src-aee2f33ce1dc427fd3b47d8e17f3634ce21f5387.tar.gz
chromium_src-aee2f33ce1dc427fd3b47d8e17f3634ce21f5387.tar.bz2
Use SYZYASAN instead of ADDRESS_SANITIZER.
We've seen different failure related to the fact that we use the same flag without providing the same API and functionality. BUG= TBR=jamesr Review URL: https://codereview.chromium.org/212643015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@259855 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/allocator/allocator_shim.cc16
-rw-r--r--base/process/process_util_unittest.cc3
-rw-r--r--base/security_unittest.cc4
-rw-r--r--base/test/test_timeouts.cc2
-rw-r--r--base/tools_sanity_unittest.cc8
5 files changed, 17 insertions, 16 deletions
diff --git a/base/allocator/allocator_shim.cc b/base/allocator/allocator_shim.cc
index d2dd5a4..c0de36e 100644
--- a/base/allocator/allocator_shim.cc
+++ b/base/allocator/allocator_shim.cc
@@ -41,8 +41,8 @@ typedef enum {
// See SetupSubprocessAllocator() to specify a default secondary (subprocess)
// allocator.
// TODO(jar): Switch to using TCMALLOC for the renderer as well.
-#if (defined(ADDRESS_SANITIZER) && defined(OS_WIN))
-// The Windows implementation of Asan requires the use of "WINHEAP".
+#if defined(SYZYASAN)
+// SyzyASan requires the use of "WINHEAP".
static Allocator allocator = WINHEAP;
#else
static Allocator allocator = TCMALLOC;
@@ -228,9 +228,9 @@ static void release_free_memory_thunk() {
// The CRT heap initialization stub.
extern "C" int _heap_init() {
-// Don't use the environment variable if ADDRESS_SANITIZER is defined on
-// Windows, as the implementation requires Winheap to be the allocator.
-#if !(defined(ADDRESS_SANITIZER) && defined(OS_WIN))
+// Don't use the environment variable if SYZYASAN is defined, as the
+// implementation requires Winheap to be the allocator.
+#if !defined(SYZYASAN)
const char* environment_value = GetenvBeforeMain(primary_name);
if (environment_value) {
if (!stricmp(environment_value, "winheap"))
@@ -356,9 +356,9 @@ void SetupSubprocessAllocator() {
buffer[sizeof(buffer) - 1] = '\0';
if (secondary_length || !primary_length) {
- // Don't use the environment variable if ADDRESS_SANITIZER is defined on
- // Windows, as the implementation require Winheap to be the allocator.
-#if !(defined(ADDRESS_SANITIZER) && defined(OS_WIN))
+// Don't use the environment variable if SYZYASAN is defined, as the
+// implementation require Winheap to be the allocator.
+#if !defined(SYZYASAN)
const char* secondary_value = secondary_length ? buffer : "TCMALLOC";
// Force renderer (or other subprocesses) to use secondary_value.
#else
diff --git a/base/process/process_util_unittest.cc b/base/process/process_util_unittest.cc
index 41a8dd6..250b06a 100644
--- a/base/process/process_util_unittest.cc
+++ b/base/process/process_util_unittest.cc
@@ -235,7 +235,8 @@ MULTIPROCESS_TEST_MAIN(CrashingChildProcess) {
// This test intentionally crashes, so we don't need to run it under
// AddressSanitizer.
// TODO(jschuh): crbug.com/175753 Fix this in Win64 bots.
-#if defined(ADDRESS_SANITIZER) || (defined(OS_WIN) && defined(ARCH_CPU_X86_64))
+#if defined(ADDRESS_SANITIZER) || \
+ (defined(OS_WIN) && defined(ARCH_CPU_X86_64)) || defined(SYZYASAN)
#define MAYBE_GetTerminationStatusCrash DISABLED_GetTerminationStatusCrash
#else
#define MAYBE_GetTerminationStatusCrash GetTerminationStatusCrash
diff --git a/base/security_unittest.cc b/base/security_unittest.cc
index d613f34c..6735f6a 100644
--- a/base/security_unittest.cc
+++ b/base/security_unittest.cc
@@ -43,11 +43,11 @@ Type HideValueFromCompiler(volatile Type value) {
}
// - NO_TCMALLOC (should be defined if compiled with use_allocator!="tcmalloc")
-// - ADDRESS_SANITIZER because it has its own memory allocator
+// - ADDRESS_SANITIZER and SYZYASAN because they have their own memory allocator
// - IOS does not use tcmalloc
// - OS_MACOSX does not use tcmalloc
#if !defined(NO_TCMALLOC) && !defined(ADDRESS_SANITIZER) && \
- !defined(OS_IOS) && !defined(OS_MACOSX)
+ !defined(OS_IOS) && !defined(OS_MACOSX) && !defined(SYZYASAN)
#define TCMALLOC_TEST(function) function
#else
#define TCMALLOC_TEST(function) DISABLED_##function
diff --git a/base/test/test_timeouts.cc b/base/test/test_timeouts.cc
index 467c0fe..5302626 100644
--- a/base/test/test_timeouts.cc
+++ b/base/test/test_timeouts.cc
@@ -16,7 +16,7 @@ namespace {
// ASan and TSan instrument each memory access. This may slow the execution
// down significantly.
-#if defined(ADDRESS_SANITIZER) || defined(THREAD_SANITIZER)
+#if defined(ADDRESS_SANITIZER) || defined(THREAD_SANITIZER) || defined(SYZYASAN)
static const int kTimeoutMultiplier = 2;
#else
static const int kTimeoutMultiplier = 1;
diff --git a/base/tools_sanity_unittest.cc b/base/tools_sanity_unittest.cc
index c763a32a..a7db5f3 100644
--- a/base/tools_sanity_unittest.cc
+++ b/base/tools_sanity_unittest.cc
@@ -20,7 +20,7 @@ const base::subtle::Atomic32 kMagicValue = 42;
// Helper for memory accesses that can potentially corrupt memory or cause a
// crash during a native run.
-#if defined(ADDRESS_SANITIZER)
+#if defined(ADDRESS_SANITIZER) || defined(SYZYASAN)
#if defined(OS_IOS)
// EXPECT_DEATH is not supported on IOS.
#define HARMFUL_ACCESS(action,error_regexp) do { action; } while (0)
@@ -113,7 +113,7 @@ TEST(ToolsSanityTest, MemoryLeak) {
// tests should be put back under the (defined(OS_IOS) || defined(OS_WIN))
// clause above.
// See also http://crbug.com/172614.
-#if defined(ADDRESS_SANITIZER)
+#if defined(ADDRESS_SANITIZER) || defined(SYZYASAN)
#define MAYBE_SingleElementDeletedWithBraces \
DISABLED_SingleElementDeletedWithBraces
#define MAYBE_ArrayDeletedWithoutBraces DISABLED_ArrayDeletedWithoutBraces
@@ -135,7 +135,7 @@ TEST(ToolsSanityTest, MAYBE_AccessesToMallocMemory) {
}
TEST(ToolsSanityTest, MAYBE_ArrayDeletedWithoutBraces) {
-#if !defined(ADDRESS_SANITIZER)
+#if !defined(ADDRESS_SANITIZER) && !defined(SYZYASAN)
// This test may corrupt memory if not run under Valgrind or compiled with
// AddressSanitizer.
if (!RunningOnValgrind())
@@ -161,7 +161,7 @@ TEST(ToolsSanityTest, MAYBE_SingleElementDeletedWithBraces) {
delete [] foo;
}
-#if defined(ADDRESS_SANITIZER)
+#if defined(ADDRESS_SANITIZER) || defined(SYZYASAN)
TEST(ToolsSanityTest, DISABLED_AddressSanitizerNullDerefCrashTest) {
// Intentionally crash to make sure AddressSanitizer is running.
// This test should not be ran on bots.