[PATCH] Interceptors for standalone LSan.

Kostya Serebryany kcc at google.com
Mon May 13 02:37:02 PDT 2013



================
Comment at: lib/lsan/lsan_interceptors.cc:63
@@ +62,3 @@
+  GET_STACK_TRACE;
+  void *p = Allocate(stack, size, kAlignment, false);
+  return p;
----------------
change to "return Allocate" (here and below)

================
Comment at: lib/lsan/lsan_interceptors.cc:58
@@ +57,3 @@
+
+const uptr kAlignment = 8;
+
----------------
This is actually wrong, because we must ensure 16 alignment. 
But why not simply pass 0? (and remove this constant)

================
Comment at: lib/lsan/lsan_interceptors.cc:205
@@ +204,3 @@
+  }
+  AdjustStackSizeLinux(attr, 0);
+  int detached = 0;
----------------
Why do you need this?
If you don't, you also don't need myattr (use code similar to asan_interceptors.cc)

================
Comment at: lib/lsan/lsan_interceptors.cc:213
@@ +212,3 @@
+  int res = REAL(pthread_create)(th, attr, __lsan_thread_start_func, &p);
+  if (res == 0) {
+    int tid = ThreadCreate(GetCurrentThread(), *(uptr *)th, detached);
----------------
I'd like dvyukov's review here.


http://llvm-reviews.chandlerc.com/D763



More information about the llvm-commits mailing list