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 // Functions returning default options are declared weak in the tools' runtime | 10 // Functions returning default options are declared weak in the tools' runtime |
(...skipping 18 matching lines...) Expand all Loading... | |
29 // work around libGL.so using the obsolete API, see | 29 // work around libGL.so using the obsolete API, see |
30 // http://crbug.com/341805. This may break if pthread_cond_t objects are | 30 // http://crbug.com/341805. This may break if pthread_cond_t objects are |
31 // accessed by both instrumented and non-instrumented binaries (e.g. if | 31 // accessed by both instrumented and non-instrumented binaries (e.g. if |
32 // they reside in shared memory). This option is going to be deprecated in | 32 // they reside in shared memory). This option is going to be deprecated in |
33 // upstream AddressSanitizer and must not be used anywhere except the | 33 // upstream AddressSanitizer and must not be used anywhere except the |
34 // official builds. | 34 // official builds. |
35 // replace_intrin=0 - do not intercept memcpy(), memmove() and memset() to | 35 // replace_intrin=0 - do not intercept memcpy(), memmove() and memset() to |
36 // work around http://crbug.com/162461 (ASan report in OpenCL on Mac). | 36 // work around http://crbug.com/162461 (ASan report in OpenCL on Mac). |
37 // check_printf=1 - check the memory accesses to printf (and other formatted | 37 // check_printf=1 - check the memory accesses to printf (and other formatted |
38 // output routines) arguments. | 38 // output routines) arguments. |
39 // use_sigaltstack=1 - handle signals on an alternate signal stack. Useful | |
Nico
2014/04/30 15:23:39
Typo use_sigalstack (missing n)
…oh, below too, s
Alexander Potapenko
2014/04/30 16:08:15
That's named after the sigaltstack() function :)
| |
40 // for stack overflow detection. | |
39 #if defined(OS_LINUX) | 41 #if defined(OS_LINUX) |
40 #if defined(GOOGLE_CHROME_BUILD) | 42 #if defined(GOOGLE_CHROME_BUILD) |
41 // Default AddressSanitizer options for the official build. These do not affect | 43 // Default AddressSanitizer options for the official build. These do not affect |
42 // tests on buildbots (which don't set GOOGLE_CHROME_BUILD) or non-official | 44 // tests on buildbots (which don't set GOOGLE_CHROME_BUILD) or non-official |
43 // Chromium builds. | 45 // Chromium builds. |
44 const char kAsanDefaultOptions[] = | 46 const char kAsanDefaultOptions[] = |
45 "legacy_pthread_cond=1 malloc_context_size=5 strict_memcmp=0 " | 47 "legacy_pthread_cond=1 malloc_context_size=5 strict_memcmp=0 " |
46 "symbolize=false check_printf=1"; | 48 "symbolize=false check_printf=1 use_sigaltstack=1"; |
47 #else | 49 #else |
48 // Default AddressSanitizer options for buildbots and non-official builds. | 50 // Default AddressSanitizer options for buildbots and non-official builds. |
49 const char *kAsanDefaultOptions = | 51 const char *kAsanDefaultOptions = |
50 "strict_memcmp=0 symbolize=false check_printf=1"; | 52 "strict_memcmp=0 symbolize=false check_printf=1 use_sigaltstack=1"; |
51 #endif // GOOGLE_CHROME_BUILD | 53 #endif // GOOGLE_CHROME_BUILD |
52 | 54 |
53 #elif defined(OS_MACOSX) | 55 #elif defined(OS_MACOSX) |
54 const char *kAsanDefaultOptions = | 56 const char *kAsanDefaultOptions = |
55 "strict_memcmp=0 replace_intrin=0 check_printf=1"; | 57 "strict_memcmp=0 replace_intrin=0 check_printf=1 use_sigaltstack=1"; |
56 #endif // OS_LINUX | 58 #endif // OS_LINUX |
57 | 59 |
58 #if defined(OS_LINUX) || defined(OS_MACOSX) | 60 #if defined(OS_LINUX) || defined(OS_MACOSX) |
59 extern "C" | 61 extern "C" |
60 __attribute__((no_sanitize_address)) | 62 __attribute__((no_sanitize_address)) |
61 const char *__asan_default_options() { | 63 const char *__asan_default_options() { |
62 return kAsanDefaultOptions; | 64 return kAsanDefaultOptions; |
63 } | 65 } |
64 #endif // OS_LINUX || OS_MACOSX | 66 #endif // OS_LINUX || OS_MACOSX |
65 #endif // ADDRESS_SANITIZER | 67 #endif // ADDRESS_SANITIZER |
OLD | NEW |