[all-commits] [llvm/llvm-project] 5e77ea: Make gCrashRecoveryEnabled thread local

Jacques Pienaar via All-commits all-commits at lists.llvm.org
Wed Feb 10 12:46:22 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5e77ea04f214c7a18bd5c782c8b8a7b7c828ad7a
      https://github.com/llvm/llvm-project/commit/5e77ea04f214c7a18bd5c782c8b8a7b7c828ad7a
  Author: Jacques Pienaar <jpienaar at google.com>
  Date:   2021-02-10 (Wed, 10 Feb 2021)

  Changed paths:
    M llvm/lib/Support/CrashRecoveryContext.cpp

  Log Message:
  -----------
  Make gCrashRecoveryEnabled thread local

If context is enabled/disabled and queried concurrently then this
results in a data race/TSAN failure with RunSafely (where boolean
variable was not locked).

There doesn't seem to be a reasonable way to enable threads that enable
and disable recovery in parallel (without also keeping
gCrashRecoveryEnabled's lock held during Fn execution which seems
undesirable). This makes enable checking if enabled thread local and
consistent with other thread local usage of crash context here.

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




More information about the All-commits mailing list