This is an archive of the discontinued LLVM Phabricator instance.

tsan: clean up dynamic TLS memory between reuse
ClosedPublic

Authored by dvyukov on Jun 2 2016, 11:02 AM.

Details

Reviewers
kcc
eugenis
Summary

Currently the added test produces false race reports with glibc 2.19,
because DLTS memory is reused by pthread under the hood.

Use the DTLS machinery to intercept new DTLS ranges.
__tls_get_addr known to cause issues for tsan in the past,
so write the interceptor more carefully.

Diff Detail

Event Timeline

dvyukov updated this revision to Diff 59426.Jun 2 2016, 11:02 AM
dvyukov retitled this revision from to tsan: clean up dynamic TLS memory between reuse.
dvyukov updated this object.
dvyukov added a reviewer: eugenis.
dvyukov added a subscriber: llvm-commits.
kcc added a subscriber: kcc.Jun 2 2016, 11:15 AM
kcc added inline comments.
lib/tsan/rtl/tsan_rtl_thread.cc
140

Please, can you stop adding #ifdefs?

dvyukov updated this revision to Diff 59437.Jun 2 2016, 11:34 AM
dvyukov marked an inline comment as done.
dvyukov added inline comments.
lib/tsan/rtl/tsan_rtl_thread.cc
140

Done

kcc accepted this revision.Jun 2 2016, 11:40 AM
kcc added a reviewer: kcc.

LGTM, assuming the test fails w/o your patch and passes with it.

This revision is now accepted and ready to land.Jun 2 2016, 11:40 AM
Eugene.Zelenko added a subscriber: Eugene.Zelenko.

Committed in r271568.