[PATCH] D40349: [LSan] New experimental flag for background leak checking before exit.
Maxim Ostapenko via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 30 08:08:18 PST 2017
m.ostapenko added subscribers: llvm-commits, m.ostapenko.
m.ostapenko added reviewers: kcc, vitalybuka, alekseyshl.
m.ostapenko added a comment.
Adding maintainers + some comments.
================
Comment at: lib/lsan/lsan_common.cc:767
+
+void MaybeAppendToLogPath(const char *suffix) {
+ if (common_flags()->leak_check_interval_s == kLeaksIntervalNotSet) return;
----------------
Why do you need all this stuff? Can't you use separate file descriptor from main report_fd? Because changing report_fd on the fly looks like a bad idea: what will happen if some another thread is reporting concurrently (corrupted reports, I guess)?
================
Comment at: lib/lsan/lsan_common.h:155
+
+static const uptr kLeaksIntervalNotSet = 0;
+void MaybeStartBackgroudLeakCheckingThread();
----------------
You don't need to explicitly initialize global variables with 0.
================
Comment at: lib/lsan/lsan_interceptors.cc:34
+#if SANITIZER_POSIX
+#include "sanitizer_common/sanitizer_posix.h"
----------------
Please don't. Why do you need this at all?
================
Comment at: lib/lsan/lsan_interceptors.cc:418
+DEFINE_REAL_PTHREAD_FUNCTIONS
+
----------------
Likewise, why do you need this?
Repository:
rL LLVM
https://reviews.llvm.org/D40349
More information about the llvm-commits
mailing list