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 21 matching lines...) Expand all Loading... |
32 __attribute__((visibility("default"))) \ | 32 __attribute__((visibility("default"))) \ |
33 __attribute__((used)) | 33 __attribute__((used)) |
34 #endif | 34 #endif |
35 | 35 |
36 #if defined(ADDRESS_SANITIZER) | 36 #if defined(ADDRESS_SANITIZER) |
37 // Default options for AddressSanitizer in various configurations: | 37 // Default options for AddressSanitizer in various configurations: |
38 // malloc_context_size=5 - limit the size of stack traces collected by ASan | 38 // malloc_context_size=5 - limit the size of stack traces collected by ASan |
39 // for each malloc/free by 5 frames. These stack traces tend to accumulate | 39 // for each malloc/free by 5 frames. These stack traces tend to accumulate |
40 // very fast in applications using JIT (v8 in Chrome's case), see | 40 // very fast in applications using JIT (v8 in Chrome's case), see |
41 // https://code.google.com/p/address-sanitizer/issues/detail?id=177 | 41 // https://code.google.com/p/address-sanitizer/issues/detail?id=177 |
42 // symbolize=false - disable the in-process symbolization, which isn't 100% | 42 // symbolize=1 - enable in-process symbolization. |
43 // compatible with the existing sandboxes and doesn't make much sense for | |
44 // stripped official binaries. | |
45 // legacy_pthread_cond=1 - run in the libpthread 2.2.5 compatibility mode to | 43 // legacy_pthread_cond=1 - run in the libpthread 2.2.5 compatibility mode to |
46 // work around libGL.so using the obsolete API, see | 44 // work around libGL.so using the obsolete API, see |
47 // http://crbug.com/341805. This may break if pthread_cond_t objects are | 45 // http://crbug.com/341805. This may break if pthread_cond_t objects are |
48 // accessed by both instrumented and non-instrumented binaries (e.g. if | 46 // accessed by both instrumented and non-instrumented binaries (e.g. if |
49 // they reside in shared memory). This option is going to be deprecated in | 47 // they reside in shared memory). This option is going to be deprecated in |
50 // upstream AddressSanitizer and must not be used anywhere except the | 48 // upstream AddressSanitizer and must not be used anywhere except the |
51 // official builds. | 49 // official builds. |
52 // check_printf=1 - check the memory accesses to printf (and other formatted | 50 // check_printf=1 - check the memory accesses to printf (and other formatted |
53 // output routines) arguments. | 51 // output routines) arguments. |
54 // use_sigaltstack=1 - handle signals on an alternate signal stack. Useful | 52 // use_sigaltstack=1 - handle signals on an alternate signal stack. Useful |
55 // for stack overflow detection. | 53 // for stack overflow detection. |
56 // strip_path_prefix=Release/../../ - prefixes up to and including this | 54 // strip_path_prefix=Release/../../ - prefixes up to and including this |
57 // substring will be stripped from source file paths in symbolized reports | 55 // substring will be stripped from source file paths in symbolized reports |
58 // (if symbolize=true, which is set when running with LeakSanitizer). | |
59 // fast_unwind_on_fatal=1 - use the fast (frame-pointer-based) stack unwinder | 56 // fast_unwind_on_fatal=1 - use the fast (frame-pointer-based) stack unwinder |
60 // to print error reports. V8 doesn't generate debug info for the JIT code, | 57 // to print error reports. V8 doesn't generate debug info for the JIT code, |
61 // so the slow unwinder may not work properly. | 58 // so the slow unwinder may not work properly. |
62 // detect_stack_use_after_return=1 - use fake stack to delay the reuse of | 59 // detect_stack_use_after_return=1 - use fake stack to delay the reuse of |
63 // stack allocations and detect stack-use-after-return errors. | 60 // stack allocations and detect stack-use-after-return errors. |
64 #if defined(OS_LINUX) | 61 #if defined(OS_LINUX) |
65 #if defined(GOOGLE_CHROME_BUILD) | 62 #if defined(GOOGLE_CHROME_BUILD) |
66 // Default AddressSanitizer options for the official build. These do not affect | 63 // Default AddressSanitizer options for the official build. These do not affect |
67 // tests on buildbots (which don't set GOOGLE_CHROME_BUILD) or non-official | 64 // tests on buildbots (which don't set GOOGLE_CHROME_BUILD) or non-official |
68 // Chromium builds. | 65 // Chromium builds. |
69 const char kAsanDefaultOptions[] = | 66 const char kAsanDefaultOptions[] = |
70 "legacy_pthread_cond=1 malloc_context_size=5 " | 67 "legacy_pthread_cond=1 malloc_context_size=5 " |
71 "symbolize=false check_printf=1 use_sigaltstack=1 detect_leaks=0 " | 68 "symbolize=1 check_printf=1 use_sigaltstack=1 detect_leaks=0 " |
72 "strip_path_prefix=Release/../../ fast_unwind_on_fatal=1"; | 69 "strip_path_prefix=Release/../../ fast_unwind_on_fatal=1"; |
73 #else | 70 #else |
74 // Default AddressSanitizer options for buildbots and non-official builds. | 71 // Default AddressSanitizer options for buildbots and non-official builds. |
75 const char *kAsanDefaultOptions = | 72 const char *kAsanDefaultOptions = |
76 "symbolize=false check_printf=1 use_sigaltstack=1 " | 73 "symbolize=1 check_printf=1 use_sigaltstack=1 " |
77 "detect_leaks=0 strip_path_prefix=Release/../../ fast_unwind_on_fatal=1 " | 74 "detect_leaks=0 strip_path_prefix=Release/../../ fast_unwind_on_fatal=1 " |
78 "detect_stack_use_after_return=1 "; | 75 "detect_stack_use_after_return=1 "; |
79 #endif // GOOGLE_CHROME_BUILD | 76 #endif // GOOGLE_CHROME_BUILD |
80 | 77 |
81 #elif defined(OS_MACOSX) | 78 #elif defined(OS_MACOSX) |
82 const char *kAsanDefaultOptions = | 79 const char *kAsanDefaultOptions = |
83 "check_printf=1 use_sigaltstack=1 " | 80 "check_printf=1 use_sigaltstack=1 " |
84 "strip_path_prefix=Release/../../ fast_unwind_on_fatal=1 " | 81 "strip_path_prefix=Release/../../ fast_unwind_on_fatal=1 " |
85 "detect_stack_use_after_return=1 detect_odr_violation=0 "; | 82 "detect_stack_use_after_return=1 detect_odr_violation=0 "; |
86 static const char kNaClDefaultOptions[] = "handle_segv=0"; | 83 static const char kNaClDefaultOptions[] = "handle_segv=0"; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 #if defined(UNDEFINED_SANITIZER) | 177 #if defined(UNDEFINED_SANITIZER) |
181 // Default options for UndefinedBehaviorSanitizer: | 178 // Default options for UndefinedBehaviorSanitizer: |
182 // print_stacktrace=1 - print the stacktrace when UBSan reports an error. | 179 // print_stacktrace=1 - print the stacktrace when UBSan reports an error. |
183 const char kUbsanDefaultOptions[] = "print_stacktrace=1"; | 180 const char kUbsanDefaultOptions[] = "print_stacktrace=1"; |
184 | 181 |
185 SANITIZER_HOOK_ATTRIBUTE const char* __ubsan_default_options() { | 182 SANITIZER_HOOK_ATTRIBUTE const char* __ubsan_default_options() { |
186 return kUbsanDefaultOptions; | 183 return kUbsanDefaultOptions; |
187 } | 184 } |
188 | 185 |
189 #endif // UNDEFINED_SANITIZER | 186 #endif // UNDEFINED_SANITIZER |
OLD | NEW |