This is an archive of the discontinued LLVM Phabricator instance.

[tsan] Add support for dispatch event sources
ClosedPublic

Authored by kubamracek on Mar 28 2016, 4:47 AM.

Details

Summary

GCD has APIs for event sources, we need some more release-acquire pairs to avoid false positives in TSan.

Diff Detail

Repository
rL LLVM

Event Timeline

kubamracek updated this revision to Diff 51779.Mar 28 2016, 4:47 AM
kubamracek retitled this revision from to [tsan] Add support for dispatch event sources.
kubamracek updated this object.
kubamracek added reviewers: dvyukov, glider, samsonov, kcc.
dvyukov accepted this revision.Apr 5 2016, 1:04 AM
dvyukov edited edge metadata.

LGTM with a nit

lib/tsan/rtl/tsan_libdispatch_mac.cc
286 ↗(On Diff #51779)

In the xpc-change you scoped handler outside of SCOPED_INTERCEPTOR scope as:

{
  SCOPED_INTERCEPTOR_RAW(dispatch_source_set_event_handler_callback);
  Acquire(thr, pc, (uptr)source);
}
handler();

Don't we need to do the same here?
We generally don't run user callbacks inside of interceptor scope.

307 ↗(On Diff #51779)

same here

330 ↗(On Diff #51779)

same here

This revision is now accepted and ready to land.Apr 5 2016, 1:04 AM
This revision was automatically updated to reflect the committed changes.