[all-commits] [llvm/llvm-project] 0da172: sanitizer_common: add thread safety annotations

Dmitry Vyukov via All-commits all-commits at lists.llvm.org
Mon Jul 12 02:47:03 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0da172b1766e1559ef677aa836dce4f1995dfef3
      https://github.com/llvm/llvm-project/commit/0da172b1766e1559ef677aa836dce4f1995dfef3
  Author: Dmitry Vyukov <dvyukov at google.com>
  Date:   2021-07-12 (Mon, 12 Jul 2021)

  Changed paths:
    M compiler-rt/CMakeLists.txt
    M compiler-rt/lib/asan/asan_allocator.cpp
    M compiler-rt/lib/cfi/cfi.cpp
    M compiler-rt/lib/lsan/lsan_common.h
    M compiler-rt/lib/memprof/memprof_allocator.cpp
    M compiler-rt/lib/sanitizer_common/CMakeLists.txt
    M compiler-rt/lib/sanitizer_common/sanitizer_addrhashmap.h
    M compiler-rt/lib/sanitizer_common/sanitizer_allocator_combined.h
    M compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary64.h
    M compiler-rt/lib/sanitizer_common/sanitizer_allocator_secondary.h
    M compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp
    M compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
    M compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
    M compiler-rt/lib/sanitizer_common/sanitizer_mutex.h
    M compiler-rt/lib/sanitizer_common/sanitizer_quarantine.h
    M compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp
    M compiler-rt/lib/sanitizer_common/sanitizer_thread_registry.h
    A compiler-rt/lib/sanitizer_common/sanitizer_thread_safety.h
    M compiler-rt/lib/sanitizer_common/sanitizer_win.cpp
    M compiler-rt/lib/scudo/scudo_allocator.cpp
    M compiler-rt/lib/scudo/scudo_tsd.h
    M compiler-rt/lib/scudo/scudo_tsd_exclusive.inc
    M compiler-rt/lib/tsan/rtl/tsan_rtl.cpp

  Log Message:
  -----------
  sanitizer_common: add thread safety annotations

Enable clang Thread Safety Analysis for sanitizers:
https://clang.llvm.org/docs/ThreadSafetyAnalysis.html

Thread Safety Analysis can detect inconsistent locking,
deadlocks and data races. Without GUARDED_BY annotations
it has limited value. But this does all the heavy lifting
to enable analysis and allows to add GUARDED_BY incrementally.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D105716




More information about the All-commits mailing list