Page MenuHomePhabricator

Fix Die() after pthread_exit call on macOS
ClosedPublic

Authored by yuri on Feb 8 2019, 10:43 AM.

Details

Summary

Scoped interceptor should not be used when calling real pthread_exit().
On macOS C++ destructors are not called by pthread_exit(), and later check for empty thread ignore set fails.

Patch by Yuri Per.

Diff Detail

Event Timeline

yuri created this revision.Feb 8 2019, 10:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 8 2019, 10:43 AM
Herald added subscribers: Restricted Project, llvm-commits, jfb, kubamracek. · View Herald Transcript
vitalybuka added inline comments.
lib/tsan/rtl/tsan_interceptors.cc
1054

Why do we need SCOPED_INTERCEPTOR like this if we do nothing inside of its scope?

BTW. I am trying to remove it completely as Dmitry suggested r353552

yuri marked 2 inline comments as done.Feb 8 2019, 11:52 AM
yuri added inline comments.
lib/tsan/rtl/tsan_interceptors.cc
1054

I copied this construction from other place in the same file. I guess it is intended for logging. There are several interceptors (for example, longjmp) that has the same structure. Moreover, In the next patch CHECK using 'thr' will be added into this scope.

yuri marked an inline comment as done.Feb 8 2019, 11:53 AM
vitalybuka accepted this revision.Feb 8 2019, 12:32 PM

LGTM
I'll commit it.

This revision is now accepted and ready to land.Feb 8 2019, 12:32 PM
vitalybuka edited the summary of this revision. (Show Details)Feb 8 2019, 12:42 PM
This revision was automatically updated to reflect the committed changes.