From 0590fa549d09bd1b6f26c0d5e470f35efe430d65 Mon Sep 17 00:00:00 2001 From: mtklein Date: Thu, 1 Sep 2016 07:06:54 -0700 Subject: Build LSAN suppressions into the test binaries. This way you don't need to set LSAN_SUPPRESSIONS in your environment... sort of foolproof this way. I _think_ the strdup() business from skia:2916 is actually rooted in libfontconfig, so one suppression should cover both old ones. I'll leave the file empty until I clean up mention of it in bot recipes. BUG=skia:2916 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2295153003 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot Review-Url: https://codereview.chromium.org/2295153003 --- tools/LsanSuppressions.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tools/LsanSuppressions.cpp (limited to 'tools/LsanSuppressions.cpp') diff --git a/tools/LsanSuppressions.cpp b/tools/LsanSuppressions.cpp new file mode 100644 index 0000000000..c81184f3b0 --- /dev/null +++ b/tools/LsanSuppressions.cpp @@ -0,0 +1,28 @@ +/* + * Copyright 2016 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "SkTypes.h" + +#if !defined(__has_feature) + #define __has_feature(x) 0 +#endif + +#if __has_feature(address_sanitizer) + +extern "C" { + + const char* __lsan_default_suppressions(); + const char* __lsan_default_suppressions() { + return "leak:libfontconfig\n" // FontConfig looks like it leaks, but it doesn't. + "leak:libGL.so\n" // For NVidia driver. + "leak:__strdup\n" // An eternal mystery, skia:2916. + ; + } + +} + +#endif -- cgit v1.2.3