From 25e2f038d1acc62e9295954021a8f75db4837c5b Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 8 Oct 2019 11:33:26 -0700 Subject: [PATCH] Compile sanitizer suppressions list and file bugs as necessary. (#12991) --- flow/layers/layer_tree.h | 2 +- testing/lsan_suppressions.txt | 42 +++++++++++++++++++++++++++++++ testing/sanitizer_suppressions.sh | 16 ++++++++++++ testing/tsan_suppressions.txt | 14 +++++++++++ testing/ubsan_suppressions.txt | 10 ++++++++ 5 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 testing/lsan_suppressions.txt create mode 100755 testing/sanitizer_suppressions.sh create mode 100644 testing/tsan_suppressions.txt create mode 100644 testing/ubsan_suppressions.txt diff --git a/flow/layers/layer_tree.h b/flow/layers/layer_tree.h index 920fd166d..e61f48b97 100644 --- a/flow/layers/layer_tree.h +++ b/flow/layers/layer_tree.h @@ -72,7 +72,7 @@ class LayerTree { } private: - SkISize frame_size_; // Physical pixels. + SkISize frame_size_ = SkISize::MakeEmpty(); // Physical pixels. std::shared_ptr root_layer_; fml::TimePoint build_start_; fml::TimePoint build_finish_; diff --git a/testing/lsan_suppressions.txt b/testing/lsan_suppressions.txt new file mode 100644 index 000000000..2348ec9ce --- /dev/null +++ b/testing/lsan_suppressions.txt @@ -0,0 +1,42 @@ +# For more information on how to add additional suppressions here go to +# https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer#suppressions + +# The Dart VM has incorrectly annotated false positives that we don't care +# about. +leak:dart::* + +# Objective-C class definitions are not leaks. +leak:class_createInstance + +# SkSurfaces from Embedder backing stores may not be collected on engine +# shutdown. +# https://github.com/flutter/flutter/issues/42172 +leak:MakeSkSurfaceFromBackingStore + +# dispatch_once blocks don't cleanup their contents. +leak:_dispatch_once_callout + +# Message loops in TLS slots may not be collected. +# https://github.com/flutter/flutter/issues/42174 +leak:fml::MessageLoop::EnsureInitializedForCurrentThread + +# CFRunLoopSource in MessageLoopDarwin not being collected +# https://github.com/flutter/flutter/issues/42175 +leak:wrap_dispatch_source_set_event_handler + + +# Dispatched platform message that are not handled due to isolate death are +# leaked. +# https://github.com/flutter/flutter/issues/42176 +leak:flutter::PlatformViewEmbedder::HandlePlatformMessage + +# Service ID platform message is leaked in case the isolate dies before the +# message is received by the the same. +# https://github.com/flutter/flutter/issues/42178 +leak:flutter::Engine::Run(flutter::RunConfiguration) + +# Font families on are leaked when launching the shell. +# https://github.com/flutter/flutter/issues/42179 +leak:txt::FontCollection::CreateMinikinFontFamily +leak:CGFontCreateFontsWithURL +leak:txt::GetDefaultFontFamily diff --git a/testing/sanitizer_suppressions.sh b/testing/sanitizer_suppressions.sh new file mode 100755 index 000000000..6a170c40f --- /dev/null +++ b/testing/sanitizer_suppressions.sh @@ -0,0 +1,16 @@ +CURRENT_DIRECTORY="$(pwd)/$(dirname "$0")" + +TSAN_SUPPRESSIONS_FILE="${CURRENT_DIRECTORY}/tsan_suppressions.txt" +export TSAN_OPTIONS="suppressions=${TSAN_SUPPRESSIONS_FILE}" +echo "Using Thread Sanitizer suppressions in ${TSAN_SUPPRESSIONS_FILE}" + +LSAN_SUPPRESSIONS_FILE="${CURRENT_DIRECTORY}/lsan_suppressions.txt" +export LSAN_OPTIONS="suppressions=${LSAN_SUPPRESSIONS_FILE}" +echo "Using Leak Sanitizer suppressions in ${LSAN_SUPPRESSIONS_FILE}" + +UBSAN_SUPPRESSIONS_FILE="${CURRENT_DIRECTORY}/ubsan_suppressions.txt" +export UBSAN_OPTIONS="suppressions=${UBSAN_SUPPRESSIONS_FILE}" +echo "Using Undefined Behavior suppressions in ${UBSAN_SUPPRESSIONS_FILE}" + + +export ASAN_OPTIONS="detect_leaks=1" diff --git a/testing/tsan_suppressions.txt b/testing/tsan_suppressions.txt new file mode 100644 index 000000000..6d09bbe7f --- /dev/null +++ b/testing/tsan_suppressions.txt @@ -0,0 +1,14 @@ +# For more information on how to add additional suppressions here go to +# https://github.com/google/sanitizers/wiki/ThreadSanitizerSuppressions + +# We don't care about errors from the Dart VM. +race:dart::* + +# Data race on animator begin frame when the engine is shutting down. +# https://github.com/flutter/flutter/issues/42190 +race:flutter::Shell::OnAnimatorBeginFrame +race:flutter::Shell::OnAnimatorNotifyIdle + +# Data race in MessageLoopTaskQueues disposal. +# https://github.com/flutter/flutter/issues/42192 +race:fml::MessageLoopTaskQueues::Dispose diff --git a/testing/ubsan_suppressions.txt b/testing/ubsan_suppressions.txt new file mode 100644 index 000000000..ec24e3185 --- /dev/null +++ b/testing/ubsan_suppressions.txt @@ -0,0 +1,10 @@ +# For more information on how to add additional suppressions here go to +# https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#id13 + +# Ignore errors is Dart VM. +alignment:third_party/dart +null:third_party/dart + +# Ignore errors in SwiftShader +undefined:third_party/swiftshader + -- GitLab