OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // This file contains the default options for various compiler-based dynamic | 5 // This file contains the default options for various compiler-based dynamic |
6 // tools. | 6 // tools. |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #if defined(ADDRESS_SANITIZER) && defined(OS_MACOSX) | 10 #if defined(ADDRESS_SANITIZER) && defined(OS_MACOSX) |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // use_sigaltstack=1 - handle signals on an alternate signal stack. Useful | 59 // use_sigaltstack=1 - handle signals on an alternate signal stack. Useful |
60 // for stack overflow detection. | 60 // for stack overflow detection. |
61 // strip_path_prefix=Release/../../ - prefixes up to and including this | 61 // strip_path_prefix=Release/../../ - prefixes up to and including this |
62 // substring will be stripped from source file paths in symbolized reports | 62 // substring will be stripped from source file paths in symbolized reports |
63 // (if symbolize=true, which is set when running with LeakSanitizer). | 63 // (if symbolize=true, which is set when running with LeakSanitizer). |
64 // fast_unwind_on_fatal=1 - use the fast (frame-pointer-based) stack unwinder | 64 // fast_unwind_on_fatal=1 - use the fast (frame-pointer-based) stack unwinder |
65 // to print error reports. V8 doesn't generate debug info for the JIT code, | 65 // to print error reports. V8 doesn't generate debug info for the JIT code, |
66 // so the slow unwinder may not work properly. | 66 // so the slow unwinder may not work properly. |
67 // detect_stack_use_after_return=1 - use fake stack to delay the reuse of | 67 // detect_stack_use_after_return=1 - use fake stack to delay the reuse of |
68 // stack allocations and detect stack-use-after-return errors. | 68 // stack allocations and detect stack-use-after-return errors. |
| 69 // detect_container_overflow=0 - do not detect overflows in containers |
| 70 // until crbug.com/459632 is fixed. |
69 #if defined(OS_LINUX) | 71 #if defined(OS_LINUX) |
70 #if defined(GOOGLE_CHROME_BUILD) | 72 #if defined(GOOGLE_CHROME_BUILD) |
71 // Default AddressSanitizer options for the official build. These do not affect | 73 // Default AddressSanitizer options for the official build. These do not affect |
72 // tests on buildbots (which don't set GOOGLE_CHROME_BUILD) or non-official | 74 // tests on buildbots (which don't set GOOGLE_CHROME_BUILD) or non-official |
73 // Chromium builds. | 75 // Chromium builds. |
74 const char kAsanDefaultOptions[] = | 76 const char kAsanDefaultOptions[] = |
75 "legacy_pthread_cond=1 malloc_context_size=5 strict_memcmp=0 " | 77 "legacy_pthread_cond=1 malloc_context_size=5 strict_memcmp=0 " |
76 "symbolize=false check_printf=1 use_sigaltstack=1 detect_leaks=0 " | 78 "symbolize=false check_printf=1 use_sigaltstack=1 detect_leaks=0 " |
77 "strip_path_prefix=Release/../../ fast_unwind_on_fatal=1"; | 79 "strip_path_prefix=Release/../../ fast_unwind_on_fatal=1 " |
| 80 "detect_container_overflow=0 "; |
78 #else | 81 #else |
79 // Default AddressSanitizer options for buildbots and non-official builds. | 82 // Default AddressSanitizer options for buildbots and non-official builds. |
80 const char *kAsanDefaultOptions = | 83 const char *kAsanDefaultOptions = |
81 "strict_memcmp=0 symbolize=false check_printf=1 use_sigaltstack=1 " | 84 "strict_memcmp=0 symbolize=false check_printf=1 use_sigaltstack=1 " |
82 "detect_leaks=0 strip_path_prefix=Release/../../ fast_unwind_on_fatal=1 " | 85 "detect_leaks=0 strip_path_prefix=Release/../../ fast_unwind_on_fatal=1 " |
83 "detect_stack_use_after_return=1 "; | 86 "detect_stack_use_after_return=1 detect_container_overflow=0 "; |
84 #endif // GOOGLE_CHROME_BUILD | 87 #endif // GOOGLE_CHROME_BUILD |
85 | 88 |
86 #elif defined(OS_MACOSX) | 89 #elif defined(OS_MACOSX) |
87 const char *kAsanDefaultOptions = | 90 const char *kAsanDefaultOptions = |
88 "strict_memcmp=0 replace_intrin=0 check_printf=1 use_sigaltstack=1 " | 91 "strict_memcmp=0 replace_intrin=0 check_printf=1 use_sigaltstack=1 " |
89 "strip_path_prefix=Release/../../ fast_unwind_on_fatal=1 " | 92 "strip_path_prefix=Release/../../ fast_unwind_on_fatal=1 " |
90 "detect_stack_use_after_return=1 detect_odr_violation=0 "; | 93 "detect_stack_use_after_return=1 detect_odr_violation=0 " |
| 94 "detect_container_overflow=0 "; |
91 static const char kNaClDefaultOptions[] = "handle_segv=0"; | 95 static const char kNaClDefaultOptions[] = "handle_segv=0"; |
92 static const char kNaClFlag[] = "--type=nacl-loader"; | 96 static const char kNaClFlag[] = "--type=nacl-loader"; |
93 #endif // OS_LINUX | 97 #endif // OS_LINUX |
94 | 98 |
95 #if defined(OS_LINUX) || defined(OS_MACOSX) | 99 #if defined(OS_LINUX) || defined(OS_MACOSX) |
96 SANITIZER_HOOK_ATTRIBUTE const char *__asan_default_options() { | 100 SANITIZER_HOOK_ATTRIBUTE const char *__asan_default_options() { |
97 #if defined(OS_MACOSX) | 101 #if defined(OS_MACOSX) |
98 char*** argvp = _NSGetArgv(); | 102 char*** argvp = _NSGetArgv(); |
99 int* argcp = _NSGetArgc(); | 103 int* argcp = _NSGetArgc(); |
100 if (!argvp || !argcp) return kAsanDefaultOptions; | 104 if (!argvp || !argcp) return kAsanDefaultOptions; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 return kLsanDefaultOptions; | 157 return kLsanDefaultOptions; |
154 } | 158 } |
155 | 159 |
156 extern "C" char kLSanDefaultSuppressions[]; | 160 extern "C" char kLSanDefaultSuppressions[]; |
157 | 161 |
158 SANITIZER_HOOK_ATTRIBUTE const char *__lsan_default_suppressions() { | 162 SANITIZER_HOOK_ATTRIBUTE const char *__lsan_default_suppressions() { |
159 return kLSanDefaultSuppressions; | 163 return kLSanDefaultSuppressions; |
160 } | 164 } |
161 | 165 |
162 #endif // LEAK_SANITIZER | 166 #endif // LEAK_SANITIZER |
OLD | NEW |