[PATCH] D21604: [tsan] Add HB edges for GCD barrier blocks

Kuba Brecka via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 22 03:28:19 PDT 2016


kubabrecka created this revision.
kubabrecka added reviewers: dvyukov, kcc, glider.
kubabrecka added subscribers: llvm-commits, zaks.anna, dcoughlin.
kubabrecka added a project: Sanitizers.
Herald added a subscriber: kubabrecka.

We currently have false positives when using GCD barrier blocks with concurrent queues.  The semantics of a submitted barrier block are:

1) All previously submitted blocks are completely finished before the barrier block starts executing.
2) The barrier block executed exclusively in the queue (as if the queue was serial for the duration of the block).
3) All subsequently submitted blocks are only executed after the barrier block has completely finished.

TSan needs two more HB edges to cover these semantics:  One edge from previous (regular) blocks to the barrier block and one edge from the barrier block to all subsequent (regular) blocks.  Only applies to concurrent queues.

http://reviews.llvm.org/D21604

Files:
  lib/tsan/rtl/tsan_libdispatch_mac.cc
  test/tsan/Darwin/gcd-barrier-race.mm
  test/tsan/Darwin/gcd-barrier.mm

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21604.61526.patch
Type: text/x-patch
Size: 11003 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160622/b5890e0e/attachment.bin>


More information about the llvm-commits mailing list