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. | |
71 #if defined(OS_LINUX) | 69 #if defined(OS_LINUX) |
72 #if defined(GOOGLE_CHROME_BUILD) | 70 #if defined(GOOGLE_CHROME_BUILD) |
73 // Default AddressSanitizer options for the official build. These do not affect | 71 // Default AddressSanitizer options for the official build. These do not affect |
74 // tests on buildbots (which don't set GOOGLE_CHROME_BUILD) or non-official | 72 // tests on buildbots (which don't set GOOGLE_CHROME_BUILD) or non-official |
75 // Chromium builds. | 73 // Chromium builds. |
76 const char kAsanDefaultOptions[] = | 74 const char kAsanDefaultOptions[] = |
77 "legacy_pthread_cond=1 malloc_context_size=5 strict_memcmp=0 " | 75 "legacy_pthread_cond=1 malloc_context_size=5 strict_memcmp=0 " |
78 "symbolize=false check_printf=1 use_sigaltstack=1 detect_leaks=0 " | 76 "symbolize=false check_printf=1 use_sigaltstack=1 detect_leaks=0 " |
79 "strip_path_prefix=Release/../../ fast_unwind_on_fatal=1 " | 77 "strip_path_prefix=Release/../../ fast_unwind_on_fatal=1"; |
80 "detect_container_overflow=0 "; | |
81 #else | 78 #else |
82 // Default AddressSanitizer options for buildbots and non-official builds. | 79 // Default AddressSanitizer options for buildbots and non-official builds. |
83 const char *kAsanDefaultOptions = | 80 const char *kAsanDefaultOptions = |
84 "strict_memcmp=0 symbolize=false check_printf=1 use_sigaltstack=1 " | 81 "strict_memcmp=0 symbolize=false check_printf=1 use_sigaltstack=1 " |
85 "detect_leaks=0 strip_path_prefix=Release/../../ fast_unwind_on_fatal=1 " | 82 "detect_leaks=0 strip_path_prefix=Release/../../ fast_unwind_on_fatal=1 " |
86 "detect_stack_use_after_return=1 detect_container_overflow=0 "; | 83 "detect_stack_use_after_return=1 "; |
87 #endif // GOOGLE_CHROME_BUILD | 84 #endif // GOOGLE_CHROME_BUILD |
88 | 85 |
89 #elif defined(OS_MACOSX) | 86 #elif defined(OS_MACOSX) |
90 const char *kAsanDefaultOptions = | 87 const char *kAsanDefaultOptions = |
91 "strict_memcmp=0 replace_intrin=0 check_printf=1 use_sigaltstack=1 " | 88 "strict_memcmp=0 replace_intrin=0 check_printf=1 use_sigaltstack=1 " |
92 "strip_path_prefix=Release/../../ fast_unwind_on_fatal=1 " | 89 "strip_path_prefix=Release/../../ fast_unwind_on_fatal=1 " |
93 "detect_stack_use_after_return=1 detect_odr_violation=0 " | 90 "detect_stack_use_after_return=1 detect_odr_violation=0 "; |
94 "detect_container_overflow=0 "; | |
95 static const char kNaClDefaultOptions[] = "handle_segv=0"; | 91 static const char kNaClDefaultOptions[] = "handle_segv=0"; |
96 static const char kNaClFlag[] = "--type=nacl-loader"; | 92 static const char kNaClFlag[] = "--type=nacl-loader"; |
97 #endif // OS_LINUX | 93 #endif // OS_LINUX |
98 | 94 |
99 #if defined(OS_LINUX) || defined(OS_MACOSX) | 95 #if defined(OS_LINUX) || defined(OS_MACOSX) |
100 SANITIZER_HOOK_ATTRIBUTE const char *__asan_default_options() { | 96 SANITIZER_HOOK_ATTRIBUTE const char *__asan_default_options() { |
101 #if defined(OS_MACOSX) | 97 #if defined(OS_MACOSX) |
102 char*** argvp = _NSGetArgv(); | 98 char*** argvp = _NSGetArgv(); |
103 int* argcp = _NSGetArgc(); | 99 int* argcp = _NSGetArgc(); |
104 if (!argvp || !argcp) return kAsanDefaultOptions; | 100 if (!argvp || !argcp) return kAsanDefaultOptions; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 return kLsanDefaultOptions; | 153 return kLsanDefaultOptions; |
158 } | 154 } |
159 | 155 |
160 extern "C" char kLSanDefaultSuppressions[]; | 156 extern "C" char kLSanDefaultSuppressions[]; |
161 | 157 |
162 SANITIZER_HOOK_ATTRIBUTE const char *__lsan_default_suppressions() { | 158 SANITIZER_HOOK_ATTRIBUTE const char *__lsan_default_suppressions() { |
163 return kLSanDefaultSuppressions; | 159 return kLSanDefaultSuppressions; |
164 } | 160 } |
165 | 161 |
166 #endif // LEAK_SANITIZER | 162 #endif // LEAK_SANITIZER |
OLD | NEW |