[PATCH] D39124: Add NetBSD improvements in sanitizers

Dmitry Vyukov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 00:40:38 PDT 2017


dvyukov added a comment.

Besides the two details this generally looks good to me.



================
Comment at: lib/sanitizer_common/sanitizer_common_interceptors.inc:4422
+  COMMON_INTERCEPTOR_READ_STRING(ctx, name, 0);
+  COMMON_INTERCEPTOR_SET_PTHREAD_NAME(ctx, thread, name, arg);
+  return REAL(pthread_setname_np)(thread, name, arg);
----------------
COMMON_INTERCEPTOR_* is interface with the rest of the system (asan, tsan, msan, lsan, ...). It _must_ be platform-independent. We don't want gazillion of OS/arch-specific details plague rest of the codebase. See how you now need to update all of asan/tsan/msan (and forgot esan/esan_interceptors.cpp).
Keep the interface as it is now and handle NetBSDs-specific difference in NetBSDs-specific interceptor. Namely, do the printf here and pass formatted name to COMMON_INTERCEPTOR_SET_PTHREAD_NAME.


================
Comment at: lib/tsan/rtl/tsan_platform_posix.cc:127
       continue;
+#if !SANITIZER_NETBSD
     if (segment.start >= VdsoBeg())  // vdso
----------------
Why is this necessary?
VdsoBeg is 0xf000000000000000ull, why do we need to continue after this address on NetBSD?


Repository:
  rL LLVM

https://reviews.llvm.org/D39124





More information about the llvm-commits mailing list