This is an archive of the discontinued LLVM Phabricator instance.

sanitizer_common: introduce kInvalidTid/kMainTid
ClosedPublic

Authored by dvyukov on Apr 28 2021, 12:40 AM.

Details

Summary

Currently we have a bit of a mess related to tids:

  • sanitizers re-declare kInvalidTid multiple times
  • some call it kUnknownTid
  • implicit assumptions that main tid is 0
  • asan/memprof claim their tids need to fit into 24 bits, but this does not seem to be true anymore
  • inconsistent use of u32/int to store tids

Introduce kInvalidTid/kMainTid in sanitizer_common
and use them consistently.

Diff Detail

Event Timeline

dvyukov requested review of this revision.Apr 28 2021, 12:40 AM
dvyukov created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptApr 28 2021, 12:41 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
vitalybuka accepted this revision.Apr 30 2021, 1:26 AM
vitalybuka added inline comments.
compiler-rt/lib/tsan/rtl/tsan_clock.h
67

This redefinition is confusing. Maybe D101604?

This revision is now accepted and ready to land.Apr 30 2021, 1:26 AM
dvyukov added inline comments.Apr 30 2021, 1:39 AM
compiler-rt/lib/tsan/rtl/tsan_clock.h
67

I agree it is confusing.
How should we apply both my and your patches? Should I submit this and then you submit yours?

vitalybuka added inline comments.Apr 30 2021, 1:54 AM
compiler-rt/lib/tsan/rtl/tsan_clock.h
67

works for me, but I'll submit mine with ~1 day delay, to make revert of this one easier, just in case

This revision was landed with ongoing or failed builds.Apr 30 2021, 6:58 AM
This revision was automatically updated to reflect the committed changes.