[all-commits] [llvm/llvm-project] be77af: tsan: Add a missing disable_sanitizer_instrumentat...

Alexander Potapenko via All-commits all-commits at lists.llvm.org
Thu Feb 17 06:34:56 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: be77afe43dd39f517ab2468c359fd0d5633d9be6
      https://github.com/llvm/llvm-project/commit/be77afe43dd39f517ab2468c359fd0d5633d9be6
  Author: Alexander Potapenko <glider at google.com>
  Date:   2022-02-17 (Thu, 17 Feb 2022)

  Changed paths:
    M compiler-rt/test/tsan/Linux/fork_deadlock.cpp

  Log Message:
  -----------
  tsan: Add a missing disable_sanitizer_instrumentation attribute

Turns out the test was working by accident: we need to ensure
TSan instrumentation is not called from the fork() hook, otherwise the
tool will deadlock. Previously it worked because alloc_free_blocks() got
inlined into __tsan_test_only_on_fork(), but it cannot always be the
case.

Adding __attribute__((disable_sanitizer_instrumentation)) will prevent
TSan from instrumenting alloc_free_blocks().

Reviewed By: dvyukov

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




More information about the All-commits mailing list