This is an archive of the discontinued LLVM Phabricator instance.

[TSan] The "thread_terminate" event is delivered on the terminating thread
AbandonedPublic

Authored by yln on Jan 6 2020, 3:06 PM.

Event Timeline

yln created this revision.Jan 6 2020, 3:06 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 6 2020, 3:06 PM
Herald added subscribers: llvm-commits, Restricted Project, jfb. · View Herald Transcript
yln retitled this revision from [TSan] The "thread_terminate" is delivered on the terminating thread to [TSan] The "thread_terminate" event is delivered on the terminating thread.Jan 7 2020, 11:06 AM
yln added reviewers: kubamracek, delcypher.

I've mentioned this to Julian in person: The code change look good to me, but any changes in this piece of code need a high level of manual testing as this code is very critical and has potential for breaking something even with innocent changes like this.

@yln The description of this change needs improving. The title probably ought to be "[TSan] The "thread_terminate" event is always delivered on the terminating thread" and then that should be followed with a brief justification along with a radar number (if there is one).

I don't know if the invariant you're adding is actually true so I can't really comment on that.

delcypher added inline comments.Jan 10 2020, 10:07 AM
compiler-rt/lib/tsan/rtl/tsan_platform_mac.cpp
197

Does this comment need updating? The comment and your change together imply that the PTHREAD_INTROSPECTION_THREAD_TERMINATE event only happens on GCD worker threads. Is that right?

yln abandoned this revision.Jan 10 2020, 6:08 PM

Superseded by D72549.