[compiler-rt] r300887 - Define standard suppressions for LSan, start with this one.
Alex Shlyapnikov via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 20 13:54:22 PDT 2017
Author: alekseyshl
Date: Thu Apr 20 15:54:22 2017
New Revision: 300887
URL: http://llvm.org/viewvc/llvm-project?rev=300887&view=rev
Log:
Define standard suppressions for LSan, start with this one.
Modified:
compiler-rt/trunk/lib/lsan/lsan_common.cc
Modified: compiler-rt/trunk/lib/lsan/lsan_common.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lsan_common.cc?rev=300887&r1=300886&r2=300887&view=diff
==============================================================================
--- compiler-rt/trunk/lib/lsan/lsan_common.cc (original)
+++ compiler-rt/trunk/lib/lsan/lsan_common.cc Thu Apr 20 15:54:22 2017
@@ -68,6 +68,14 @@ ALIGNED(64) static char suppression_plac
static SuppressionContext *suppression_ctx = nullptr;
static const char kSuppressionLeak[] = "leak";
static const char *kSuppressionTypes[] = { kSuppressionLeak };
+static const char kStdSuppressions[] =
+#if SANITIZER_SUPPRESS_LEAK_ON_PTHREAD_EXIT
+ // The actual string allocation happens here (for more details refer to the
+ // SANITIZER_SUPPRESS_LEAK_ON_PTHREAD_EXIT definition).
+ "leak:*_dl_map_object_deps*";
+#else
+ "";
+#endif // SANITIZER_SUPPRESS_LEAK_ON_PTHREAD_EXIT
void InitializeSuppressions() {
CHECK_EQ(nullptr, suppression_ctx);
@@ -76,6 +84,7 @@ void InitializeSuppressions() {
suppression_ctx->ParseFromFile(flags()->suppressions);
if (&__lsan_default_suppressions)
suppression_ctx->Parse(__lsan_default_suppressions());
+ suppression_ctx->Parse(kStdSuppressions);
}
static SuppressionContext *GetSuppressionContext() {
@@ -848,13 +857,7 @@ int __lsan_is_turned_off() {
SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
const char *__lsan_default_suppressions() {
-#if SANITIZER_SUPPRESS_LEAK_ON_PTHREAD_EXIT
- // The actual string allocation happens here (for more details refer to the
- // SANITIZER_SUPPRESS_LEAK_ON_PTHREAD_EXIT definition).
- return "leak:*_dl_map_object_deps*";
-#else
return "";
-#endif // SANITIZER_SUPPRESS_LEAK_ON_PTHREAD_EXIT
}
#endif
} // extern "C"
More information about the llvm-commits
mailing list