[PATCH] D28609: [lsan] Enable LSan for x86 Linux.
Maxim Ostapenko via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 12 08:18:13 PST 2017
m.ostapenko added inline comments.
================
Comment at: lib/lsan/lsan_interceptors.cc:166
INTERCEPTOR_ATTRIBUTE
-void *operator new(uptr size) { OPERATOR_NEW_BODY; }
+void *operator new(size_t size) { OPERATOR_NEW_BODY; }
INTERCEPTOR_ATTRIBUTE
----------------
ygribov wrote:
> Why didn't you like uptrs?
Because for 32 bit arches uptr doesn't match size_t.
================
Comment at: lib/sanitizer_common/sanitizer_linux.h:53
uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg,
int *parent_tidptr, void *newtls, int *child_tidptr);
#endif
----------------
ygribov wrote:
> I thought we had implementation for arm as well?
Yeah, but I wanted to post it as a separate patch.
================
Comment at: test/lsan/TestCases/large_allocation_leak.cc:6
+// UNSUPPORTED: x86
+
----------------
ygribov wrote:
> This may deserve explanatory comment.
Ok.
================
Comment at: test/lsan/TestCases/use_tls_dynamic.cc:18
+
+__attribute__((noinline)) int Test(int argc, char *argv[]) {
std::string path = std::string(argv[0]) + "-so.so";
----------------
ygribov wrote:
> Looks like a hack to get test passing...
Yeah, for x86 the frame for main may contain spilled address for TLS chunk thus leak is not detected. I used the outlining hack to avoid this issue.
Do you have any suggestion how we can avoid test failure in another way?
Repository:
rL LLVM
https://reviews.llvm.org/D28609
More information about the llvm-commits
mailing list