This is an archive of the discontinued LLVM Phabricator instance.

[NFC][TSan][libdispatch] Fix test for dispatch_apply[_f]
ClosedPublic

Authored by yln on Mar 18 2019, 1:45 PM.

Details

Summary
  • Array index out of bounds: 100 iterations, but size of array is 2.
  • Unmatched barrier_init (2) with barrier_wait (200)
  • Number of iterations must be smaller than the available parallelism for the queue, otherwise we deadlock (since every barrier_wait call blocks the thread).

Scary: All of this worked reliably in gcd-apply.mm (for Darwin)

Diff Detail

Repository
rL LLVM

Event Timeline

yln created this revision.Mar 18 2019, 1:45 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 18 2019, 1:46 PM
Herald added subscribers: llvm-commits, Restricted Project, jdoerfert, kubamracek. · View Herald Transcript
kubamracek accepted this revision.Mar 18 2019, 2:12 PM

Make size just "2" to make sure we're actually able to satisfy the barrier on low-end machines. Other that that, LGTM.

This revision is now accepted and ready to land.Mar 18 2019, 2:12 PM
This revision was automatically updated to reflect the committed changes.