ASan: re-enable strict memcmp() checks.

Also, introduce ASan suppressions and use them to suppress a memcmp()
report in system-installed libsqlite.

BUG=178677
TBR=glider@chromium.org

Review URL: https://codereview.chromium.org/1070853002

Cr-Original-Commit-Position: refs/heads/master@{#324448}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 01151d346358a1911639a97fd061393bc0b54e43
This commit is contained in:
earthdok 2015-04-09 08:49:59 -07:00 коммит произвёл Commit bot
Родитель 1a429146d1
Коммит c116c68761
3 изменённых файлов: 37 добавлений и 5 удалений

Просмотреть файл

@ -0,0 +1,23 @@
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file contains the default suppressions for AddressSanitizer.
// It should only be used under very limited circumstances such as suppressing
// a report caused by an interceptor call in a system-installed library.
#if defined(ADDRESS_SANITIZER)
// Please make sure the code below declares a single string variable
// kASanDefaultSuppressions which contains ASan suppressions delimited by
// newlines.
char kASanDefaultSuppressions[] =
// http://crbug.com/178677
"interceptor_via_lib:libsqlite3.so\n"
// PLEASE READ ABOVE BEFORE ADDING NEW SUPPRESSIONS.
// End of suppressions.
; // Please keep this semicolon.
#endif // ADDRESS_SANITIZER

Просмотреть файл

@ -36,8 +36,6 @@ void _sanitizer_options_link_helper() { }
#if defined(ADDRESS_SANITIZER)
// Default options for AddressSanitizer in various configurations:
// strict_memcmp=1 - disable the strict memcmp() checking
// (http://crbug.com/178677 and http://crbug.com/178404).
// malloc_context_size=5 - limit the size of stack traces collected by ASan
// for each malloc/free by 5 frames. These stack traces tend to accumulate
// very fast in applications using JIT (v8 in Chrome's case), see
@ -72,20 +70,20 @@ void _sanitizer_options_link_helper() { }
// tests on buildbots (which don't set GOOGLE_CHROME_BUILD) or non-official
// Chromium builds.
const char kAsanDefaultOptions[] =
"legacy_pthread_cond=1 malloc_context_size=5 strict_memcmp=0 "
"legacy_pthread_cond=1 malloc_context_size=5 "
"symbolize=false check_printf=1 use_sigaltstack=1 detect_leaks=0 "
"strip_path_prefix=Release/../../ fast_unwind_on_fatal=1";
#else
// Default AddressSanitizer options for buildbots and non-official builds.
const char *kAsanDefaultOptions =
"strict_memcmp=0 symbolize=false check_printf=1 use_sigaltstack=1 "
"symbolize=false check_printf=1 use_sigaltstack=1 "
"detect_leaks=0 strip_path_prefix=Release/../../ fast_unwind_on_fatal=1 "
"detect_stack_use_after_return=1 ";
#endif // GOOGLE_CHROME_BUILD
#elif defined(OS_MACOSX)
const char *kAsanDefaultOptions =
"strict_memcmp=0 replace_intrin=0 check_printf=1 use_sigaltstack=1 "
"replace_intrin=0 check_printf=1 use_sigaltstack=1 "
"strip_path_prefix=Release/../../ fast_unwind_on_fatal=1 "
"detect_stack_use_after_return=1 detect_odr_violation=0 ";
static const char kNaClDefaultOptions[] = "handle_segv=0";
@ -108,6 +106,12 @@ SANITIZER_HOOK_ATTRIBUTE const char *__asan_default_options() {
#endif
return kAsanDefaultOptions;
}
extern "C" char kASanDefaultSuppressions[];
SANITIZER_HOOK_ATTRIBUTE const char *__asan_default_suppressions() {
return kASanDefaultSuppressions;
}
#endif // OS_LINUX || OS_MACOSX
#endif // ADDRESS_SANITIZER

Просмотреть файл

@ -41,6 +41,11 @@
'lsan_suppressions.cc',
],
}],
['asan==1', {
'sources': [
'asan_suppressions.cc',
],
}],
],
'cflags/': [
['exclude', '-fsanitize='],