Commit 98419a68 authored by Andrew Doran's avatar Andrew Doran Committed by Facebook GitHub Bot

Back out "Disable TSAN instrumentation across StaticMetaBase::onThreadExit()."

Summary:
Sorry about the churn (& time spent on this), but this backs out the change in D20671620.

Despite best efforts it seems I've missed something and the issue runs deeper than TSAN observing thread exit.

My change has possibly only altered the timing of events, and has exposed another related failure during testpilot runs that didn't occur before, so I think it's best to return to baseline.

Reviewed By: yfeldblum

Differential Revision: D21310561

fbshipit-source-id: 369865f185415123ea8fddf6007115b87ea8fe82
parent a1340878
......@@ -16,7 +16,6 @@
#include <folly/detail/ThreadLocalDetail.h>
#include <folly/synchronization/CallOnce.h>
#include <folly/synchronization/SanitizeThread.h>
#include <list>
#include <mutex>
......@@ -119,17 +118,6 @@ bool StaticMetaBase::dying() {
}
void StaticMetaBase::onThreadExit(void* ptr) {
// Disable TSAN instrumentation for the duration of this method. This is
// called from pthread_exit(), as a thread-specific data destructor. On
// Linux, TSAN also uses that mechanism to intercept thread exit. There
// is no defined order for TSD destructor invocation. TSAN can therefore
// be informed of the thread's demise before this routine runs, which can
// later confuse TSAN when another thread running in ld-linux calls free()
// on this thread's TLS (not TSD) memory block, which is written to here.
Optional<annotate_ignore_thread_sanitizer_guard> tsanGuard;
if (kIsLinux) {
tsanGuard.emplace(__FILE__, __LINE__);
}
auto threadEntry = static_cast<ThreadEntry*>(ptr);
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment