diff options
Diffstat (limited to 'deps/v8/build/sanitizers')
-rw-r--r-- | deps/v8/build/sanitizers/OWNERS | 10 | ||||
-rw-r--r-- | deps/v8/build/sanitizers/asan_suppressions.cc | 23 | ||||
-rw-r--r-- | deps/v8/build/sanitizers/lsan_suppressions.cc | 71 | ||||
-rw-r--r-- | deps/v8/build/sanitizers/sanitizer_options.cc | 181 | ||||
-rw-r--r-- | deps/v8/build/sanitizers/tsan_suppressions.cc | 213 |
5 files changed, 498 insertions, 0 deletions
diff --git a/deps/v8/build/sanitizers/OWNERS b/deps/v8/build/sanitizers/OWNERS new file mode 100644 index 0000000000..e9a248c4af --- /dev/null +++ b/deps/v8/build/sanitizers/OWNERS @@ -0,0 +1,10 @@ +ochang@chromium.org +eugenis@chromium.org +glider@chromium.org +inferno@chromium.org +mbarbella@chromium.org +metzman@chromium.org +mmoroz@chromium.org +rnk@chromium.org +per-file tsan_suppressions.cc=* +per-file lsan_suppressions.cc=* diff --git a/deps/v8/build/sanitizers/asan_suppressions.cc b/deps/v8/build/sanitizers/asan_suppressions.cc new file mode 100644 index 0000000000..f3b9459ded --- /dev/null +++ b/deps/v8/build/sanitizers/asan_suppressions.cc @@ -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. Entries should look, for example, like: +// +// // http://crbug.com/178677 +// "interceptor_via_lib:libsqlite3.so\n" +char kASanDefaultSuppressions[] = + + // End of suppressions. + // PLEASE READ ABOVE BEFORE ADDING NEW SUPPRESSIONS. + ""; // Please keep this semicolon. + +#endif // ADDRESS_SANITIZER diff --git a/deps/v8/build/sanitizers/lsan_suppressions.cc b/deps/v8/build/sanitizers/lsan_suppressions.cc new file mode 100644 index 0000000000..abda863fe2 --- /dev/null +++ b/deps/v8/build/sanitizers/lsan_suppressions.cc @@ -0,0 +1,71 @@ +// 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 LeakSanitizer. +// You can also pass additional suppressions via LSAN_OPTIONS: +// LSAN_OPTIONS=suppressions=/path/to/suppressions. Please refer to +// http://dev.chromium.org/developers/testing/leaksanitizer for more info. + +#if defined(LEAK_SANITIZER) + +// Please make sure the code below declares a single string variable +// kLSanDefaultSuppressions which contains LSan suppressions delimited by +// newlines. See http://dev.chromium.org/developers/testing/leaksanitizer +// for the instructions on writing suppressions. +char kLSanDefaultSuppressions[] = + // Intentional leak used as sanity test for Valgrind/memcheck. + "leak:base::ToolsSanityTest_MemoryLeak_Test::TestBody\n" + + // ================ Leaks in third-party code ================ + + // False positives in libfontconfig. http://crbug.com/39050 + "leak:libfontconfig\n" + // eglibc-2.19/string/strdup.c creates false positive leak errors because of + // the same reason as crbug.com/39050. The leak error stack trace, when + // unwind on malloc, includes a call to libfontconfig. But the default stack + // trace is too short in leak sanitizer bot to make the libfontconfig + // suppression works. http://crbug.com/605286 + "leak:__strdup\n" + + // Leaks in Nvidia's libGL. + "leak:libGL.so\n" + + // XRandR has several one time leaks. + "leak:libxrandr\n" + + // xrandr leak. http://crbug.com/119677 + "leak:XRRFindDisplay\n" + + // http://crbug.com/431213, http://crbug.com/416665 + "leak:gin/object_template_builder.h\n" + + // Leaks in swrast_dri.so. http://crbug.com/540042 + "leak:swrast_dri.so\n" + + // Leak in glibc's gconv caused by fopen(..., "r,ccs=UNICODE") + "leak:__gconv_lookup_cache\n" + + // ================ Leaks in Chromium code ================ + // PLEASE DO NOT ADD SUPPRESSIONS FOR NEW LEAKS. + // Instead, commits that introduce memory leaks should be reverted. + // Suppressing the leak is acceptable in some cases when reverting is + // impossible, i.e. when enabling leak detection for the first time for a + // test target with pre-existing leaks. + + // http://crbug.com/356306 + "leak:service_manager::SetProcessTitleFromCommandLine\n" + + // https://crbug.com/755670 + "leak:third_party/yasm/\n" + + // v8 leaks caused by weak ref not call + "leak:blink::DOMWrapperWorld::Create\n" + "leak:blink::ScriptState::Create\n" + + // PLEASE READ ABOVE BEFORE ADDING NEW SUPPRESSIONS. + + // End of suppressions. + ; // Please keep this semicolon. + +#endif // LEAK_SANITIZER diff --git a/deps/v8/build/sanitizers/sanitizer_options.cc b/deps/v8/build/sanitizers/sanitizer_options.cc new file mode 100644 index 0000000000..d40d4d254a --- /dev/null +++ b/deps/v8/build/sanitizers/sanitizer_options.cc @@ -0,0 +1,181 @@ +// Copyright 2014 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 options for various compiler-based dynamic +// tools. + +#include "build/build_config.h" + +#if defined(ADDRESS_SANITIZER) || defined(LEAK_SANITIZER) || \ + defined(MEMORY_SANITIZER) || defined(THREAD_SANITIZER) || \ + defined(UNDEFINED_SANITIZER) +// Functions returning default options are declared weak in the tools' runtime +// libraries. To make the linker pick the strong replacements for those +// functions from this module, we explicitly force its inclusion by passing +// -Wl,-u_sanitizer_options_link_helper +extern "C" +void _sanitizer_options_link_helper() { } + +// The callbacks we define here will be called from the sanitizer runtime, but +// aren't referenced from the Chrome executable. We must ensure that those +// callbacks are not sanitizer-instrumented, and that they aren't stripped by +// the linker. +#define SANITIZER_HOOK_ATTRIBUTE \ + extern "C" \ + __attribute__((no_sanitize("address", "memory", "thread", "undefined"))) \ + __attribute__((visibility("default"))) \ + __attribute__((used)) +#endif + +#if defined(ADDRESS_SANITIZER) +// Default options for AddressSanitizer in various configurations: +// 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 +// https://code.google.com/p/address-sanitizer/issues/detail?id=177 +// symbolize=1 - enable in-process symbolization. +// legacy_pthread_cond=1 - run in the libpthread 2.2.5 compatibility mode to +// work around libGL.so using the obsolete API, see +// http://crbug.com/341805. This may break if pthread_cond_t objects are +// accessed by both instrumented and non-instrumented binaries (e.g. if +// they reside in shared memory). This option is going to be deprecated in +// upstream AddressSanitizer and must not be used anywhere except the +// official builds. +// check_printf=1 - check the memory accesses to printf (and other formatted +// output routines) arguments. +// use_sigaltstack=1 - handle signals on an alternate signal stack. Useful +// for stack overflow detection. +// strip_path_prefix=/../../ - prefixes up to and including this +// substring will be stripped from source file paths in symbolized reports +// fast_unwind_on_fatal=1 - use the fast (frame-pointer-based) stack unwinder +// to print error reports. V8 doesn't generate debug info for the JIT code, +// so the slow unwinder may not work properly. +// detect_stack_use_after_return=1 - use fake stack to delay the reuse of +// stack allocations and detect stack-use-after-return errors. +#if defined(OS_LINUX) +#if defined(GOOGLE_CHROME_BUILD) +// Default AddressSanitizer options for the official build. These do not affect +// 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 " + "symbolize=1 check_printf=1 use_sigaltstack=1 detect_leaks=0 " + "strip_path_prefix=/../../ fast_unwind_on_fatal=1 " + "allow_user_segv_handler=1 "; +#else +// Default AddressSanitizer options for buildbots and non-official builds. +const char* kAsanDefaultOptions = + "symbolize=1 check_printf=1 use_sigaltstack=1 " + "detect_leaks=0 strip_path_prefix=/../../ fast_unwind_on_fatal=1 " + "detect_stack_use_after_return=1 " + "allow_user_segv_handler=1 "; +#endif // GOOGLE_CHROME_BUILD + +#elif defined(OS_MACOSX) +const char *kAsanDefaultOptions = + "check_printf=1 use_sigaltstack=1 " + "strip_path_prefix=/../../ fast_unwind_on_fatal=1 " + "detect_stack_use_after_return=1 detect_odr_violation=0 "; + +#elif defined(OS_WIN) +const char* kAsanDefaultOptions = + "check_printf=1 use_sigaltstack=1 " + "strip_path_prefix=\\..\\..\\ fast_unwind_on_fatal=1 "; +#endif // OS_LINUX + +#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) +// Allow NaCl to override the default asan options. +extern const char* kAsanDefaultOptionsNaCl; +__attribute__((weak)) const char* kAsanDefaultOptionsNaCl = nullptr; + +SANITIZER_HOOK_ATTRIBUTE const char *__asan_default_options() { + if (kAsanDefaultOptionsNaCl) + return kAsanDefaultOptionsNaCl; + return kAsanDefaultOptions; +} + +extern char kASanDefaultSuppressions[]; + +SANITIZER_HOOK_ATTRIBUTE const char *__asan_default_suppressions() { + return kASanDefaultSuppressions; +} +#endif // OS_LINUX || OS_MACOSX || OS_WIN +#endif // ADDRESS_SANITIZER + +#if defined(THREAD_SANITIZER) && defined(OS_LINUX) +// Default options for ThreadSanitizer in various configurations: +// detect_deadlocks=1 - enable deadlock (lock inversion) detection. +// second_deadlock_stack=1 - more verbose deadlock reports. +// report_signal_unsafe=0 - do not report async-signal-unsafe functions +// called from signal handlers. +// report_thread_leaks=0 - do not report unjoined threads at the end of +// the program execution. +// print_suppressions=1 - print the list of matched suppressions. +// history_size=7 - make the history buffer proportional to 2^7 (the maximum +// value) to keep more stack traces. +// strip_path_prefix=/../../ - prefixes up to and including this +// substring will be stripped from source file paths in symbolized reports. +const char kTsanDefaultOptions[] = + "detect_deadlocks=1 second_deadlock_stack=1 report_signal_unsafe=0 " + "report_thread_leaks=0 print_suppressions=1 history_size=7 " + "strict_memcmp=0 strip_path_prefix=/../../ "; + +SANITIZER_HOOK_ATTRIBUTE const char *__tsan_default_options() { + return kTsanDefaultOptions; +} + +extern char kTSanDefaultSuppressions[]; + +SANITIZER_HOOK_ATTRIBUTE const char *__tsan_default_suppressions() { + return kTSanDefaultSuppressions; +} + +#endif // THREAD_SANITIZER && OS_LINUX + +#if defined(MEMORY_SANITIZER) +// Default options for MemorySanitizer: +// intercept_memcmp=0 - do not detect uninitialized memory in memcmp() calls. +// Pending cleanup, see http://crbug.com/523428 +// strip_path_prefix=/../../ - prefixes up to and including this +// substring will be stripped from source file paths in symbolized reports. +const char kMsanDefaultOptions[] = + "intercept_memcmp=0 strip_path_prefix=/../../ "; + +SANITIZER_HOOK_ATTRIBUTE const char *__msan_default_options() { + return kMsanDefaultOptions; +} + +#endif // MEMORY_SANITIZER + +#if defined(LEAK_SANITIZER) +// Default options for LeakSanitizer: +// print_suppressions=1 - print the list of matched suppressions. +// strip_path_prefix=/../../ - prefixes up to and including this +// substring will be stripped from source file paths in symbolized reports. +const char kLsanDefaultOptions[] = + "print_suppressions=1 strip_path_prefix=/../../ "; + +SANITIZER_HOOK_ATTRIBUTE const char *__lsan_default_options() { + return kLsanDefaultOptions; +} + +extern char kLSanDefaultSuppressions[]; + +SANITIZER_HOOK_ATTRIBUTE const char *__lsan_default_suppressions() { + return kLSanDefaultSuppressions; +} + +#endif // LEAK_SANITIZER + +#if defined(UNDEFINED_SANITIZER) +// Default options for UndefinedBehaviorSanitizer: +// print_stacktrace=1 - print the stacktrace when UBSan reports an error. +const char kUbsanDefaultOptions[] = + "print_stacktrace=1 strip_path_prefix=/../../ "; + +SANITIZER_HOOK_ATTRIBUTE const char* __ubsan_default_options() { + return kUbsanDefaultOptions; +} + +#endif // UNDEFINED_SANITIZER diff --git a/deps/v8/build/sanitizers/tsan_suppressions.cc b/deps/v8/build/sanitizers/tsan_suppressions.cc new file mode 100644 index 0000000000..53c2f3234b --- /dev/null +++ b/deps/v8/build/sanitizers/tsan_suppressions.cc @@ -0,0 +1,213 @@ +// Copyright 2014 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 ThreadSanitizer. +// You can also pass additional suppressions via TSAN_OPTIONS: +// TSAN_OPTIONS=suppressions=/path/to/suppressions. Please refer to +// http://dev.chromium.org/developers/testing/threadsanitizer-tsan-v2 +// for more info. + +#if defined(THREAD_SANITIZER) + +// Please make sure the code below declares a single string variable +// kTSanDefaultSuppressions contains TSan suppressions delimited by newlines. +// See http://dev.chromium.org/developers/testing/threadsanitizer-tsan-v2 +// for the instructions on writing suppressions. +char kTSanDefaultSuppressions[] = + // False positives in libflashplayer.so, libgio.so and libglib.so. + // Since we don't instrument them, we cannot reason about the + // synchronization in them. + "race:libflashplayer.so\n" + "race:libgio*.so\n" + "race:libglib*.so\n" + + // Intentional race in ToolsSanityTest.DataRace in base_unittests. + "race:base/tools_sanity_unittest.cc\n" + + // Data race on WatchdogCounter [test-only]. + "race:base/threading/watchdog_unittest.cc\n" + + // Races in libevent, http://crbug.com/23244. + "race:libevent/event.c\n" + + // Data race caused by swapping out the network change notifier with a mock + // [test-only]. http://crbug.com/927330. + "race:content/browser/net_info_browsertest.cc\n" + + // http://crbug.com/84094. + "race:sqlite3StatusSet\n" + "race:pcache1EnforceMaxPage\n" + "race:pcache1AllocPage\n" + + // http://crbug.com/120808 + "race:base/threading/watchdog.cc\n" + + // http://crbug.com/157586 + "race:third_party/libvpx/source/libvpx/vp8/decoder/threading.c\n" + + // http://crbug.com/158718 + "race:third_party/ffmpeg/libavcodec/pthread.c\n" + "race:third_party/ffmpeg/libavcodec/pthread_frame.c\n" + "race:third_party/ffmpeg/libavcodec/vp8.c\n" + "race:third_party/ffmpeg/libavutil/mem.c\n" + "race:*HashFrameForTesting\n" + "race:third_party/ffmpeg/libavcodec/h264pred.c\n" + "race:media::ReleaseData\n" + + // http://crbug.com/239359 + "race:media::TestInputCallback::OnData\n" + + // http://crbug.com/244385 + "race:unixTempFileDir\n" + + // http://crbug.com/244755 + "race:v8::internal::Zone::NewExpand\n" + + // http://crbug.com/244774 + "race:webrtc::RTPReceiver::ProcessBitrate\n" + "race:webrtc::RTPSender::ProcessBitrate\n" + "race:webrtc::VideoCodingModuleImpl::Decode\n" + "race:webrtc::RTPSender::SendOutgoingData\n" + "race:webrtc::LibvpxVp8Encoder::GetEncodedPartitions\n" + "race:webrtc::LibvpxVp8Encoder::Encode\n" + "race:webrtc::ViEEncoder::DeliverFrame\n" + "race:webrtc::vcm::VideoReceiver::Decode\n" + "race:webrtc::VCMReceiver::FrameForDecoding\n" + + // http://crbug.com/244856 + "race:libpulsecommon*.so\n" + + // http://crbug.com/246968 + "race:webrtc::VideoCodingModuleImpl::RegisterPacketRequestCallback\n" + + // http://crbug.com/257396 + "race:base::trace_event::" + + // http://crbug.com/258479 + "race:SamplingStateScope\n" + "race:g_trace_state\n" + + // http://crbug.com/258499 + "race:third_party/skia/include/core/SkRefCnt.h\n" + + // http://crbug.com/268924 + "race:base::g_power_monitor\n" + "race:base::PowerMonitor::PowerMonitor\n" + "race:base::PowerMonitor::AddObserver\n" + "race:base::PowerMonitor::RemoveObserver\n" + "race:base::PowerMonitor::IsOnBatteryPower\n" + + // http://crbug.com/258935 + "race:base::Thread::StopSoon\n" + + // http://crbug.com/272095 + "race:base::g_top_manager\n" + + // http://crbug.com/308590 + "race:CustomThreadWatcher::~CustomThreadWatcher\n" + + // http://crbug.com/476529 + "deadlock:cc::VideoLayerImpl::WillDraw\n" + + // http://crbug.com/328826 + "race:gLCDOrder\n" + "race:gLCDOrientation\n" + + // http://crbug.com/328868 + "race:PR_Lock\n" + + // http://crbug.com/333244 + "race:content::" + "VideoCaptureImplTest::MockVideoCaptureImpl::~MockVideoCaptureImpl\n" + + // http://crbug.com/347534 + "race:v8::internal::V8::TearDown\n" + + // http://crbug.com/347538 + "race:sctp_timer_start\n" + + // http://crbug.com/348511 + "race:webrtc::acm1::AudioCodingModuleImpl::PlayoutData10Ms\n" + + // http://crbug.com/348982 + "race:cricket::P2PTransportChannel::OnConnectionDestroyed\n" + "race:cricket::P2PTransportChannel::AddConnection\n" + + // http://crbug.com/348984 + "race:sctp_express_handle_sack\n" + "race:system_base_info\n" + + // https://code.google.com/p/v8/issues/detail?id=3143 + "race:v8::internal::FLAG_track_double_fields\n" + + // http://crbug.com/374135 + "race:media::AlsaWrapper::PcmWritei\n" + + // False positive in libc's tzset_internal, http://crbug.com/379738. + "race:tzset_internal\n" + + // http://crbug.com/380554 + "deadlock:g_type_add_interface_static\n" + + // http:://crbug.com/386385 + "race:content::AppCacheStorageImpl::DatabaseTask::CallRunCompleted\n" + + // http://crbug.com/397022 + "deadlock:" + "base::trace_event::TraceEventTestFixture_ThreadOnceBlocking_Test::" + "TestBody\n" + + // http://crbug.com/415472 + "deadlock:base::trace_event::TraceLog::GetCategoryGroupEnabled\n" + + // http://crbug.com/490856 + "deadlock:content::TracingControllerImpl::SetEnabledOnFileThread\n" + + // https://code.google.com/p/skia/issues/detail?id=3294 + "race:SkBaseMutex::acquire\n" + + // Lock inversion in third party code, won't fix. + // https://crbug.com/455638 + "deadlock:dbus::Bus::ShutdownAndBlock\n" + + // https://crbug.com/459429 + "race:randomnessPid\n" + + // https://crbug.com/454655 + "race:content::BrowserTestBase::PostTaskToInProcessRendererAndWait\n" + + // http://crbug.com/582274 + "race:usrsctp_close\n" + + // http://crbug.com/633145 + "race:third_party/libjpeg_turbo/simd/jsimd_x86_64.c\n" + + // http://crbug.com/v8/6065 + "race:net::(anonymous namespace)::ProxyResolverV8TracingImpl::RequestImpl" + "::~RequestImpl()\n" + + // http://crbug.com/691029 + "deadlock:libGLX.so*\n" + + // http://crbug.com/695929 + "race:base::i18n::IsRTL\n" + "race:base::i18n::SetICUDefaultLocale\n" + + // https://crbug.com/794920 + "race:base::debug::SetCrashKeyString\n" + "race:crash_reporter::internal::CrashKeyStringImpl::Set\n" + + // http://crbug.com/795110 + "race:third_party/fontconfig/*\n" + + // http://crbug.com/797998 + "race:content::SandboxIPCHandler::HandleLocaltime\n" + + // http://crbug.com/927330 + "race:net::(anonymous namespace)::g_network_change_notifier\n" + + // End of suppressions. + ; // Please keep this semicolon. + +#endif // THREAD_SANITIZER |