[PATCH] [sanitizer] Support adaptive stack unwinding in sanitizer tools.

Kostya Serebryany kcc at google.com
Tue Aug 13 07:41:02 PDT 2013


  the general idea is ok, but the performance is still so-so.
  We may want to improve upon it later, so it does not prevent us from committing this code now (off by default in all tools).

  But please do add tests. You can use qsort() as the functions though which we can't unwind.


================
Comment at: lib/asan/asan_interceptors.cc:148
@@ +147,3 @@
+  // it mixes up stack traces.
+  volatile int foo = 42;
+  foo++;
----------------
you can use one line volatile asm blob here. 

================
Comment at: lib/lsan/lsan_interceptors.cc:219
@@ +218,3 @@
+  // it mixes up stack traces.
+  volatile int foo = 42;
+  foo++;
----------------
ditto

================
Comment at: lib/sanitizer_common/sanitizer_posix_libcdep.cc:31
@@ +30,3 @@
+#if SANITIZER_LINUX && !defined(SANITIZER_GO)
+__attribute__((weak)) extern "C" void __libc_start_main();
+__attribute__((weak)) extern "C" int sanitizer_thread_start(void *arg);
----------------
comment?

================
Comment at: lib/sanitizer_common/sanitizer_posix_libcdep.cc:134
@@ +133,3 @@
+  // we've chosen are good approximations.
+  if (start_main_addr && InRange(stack->trace[size - 1], start_main_addr, 150))
+    return;
----------------
change 150 to kSomething


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



More information about the llvm-commits mailing list