This is an archive of the discontinued LLVM Phabricator instance.

[TSan][NFC] fixup for comment of Shadow
ClosedPublic

Authored by Enna1 on Feb 10 2022, 1:33 AM.

Details

Summary

There should be 1-bit unused field between tid field and is_atomic field of Shadow.

Diff Detail

Event Timeline

Enna1 requested review of this revision.Feb 10 2022, 1:33 AM
Enna1 created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 10 2022, 1:33 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
Enna1 added a comment.Feb 10 2022, 1:33 AM

When we access is_atomic field, we use kAtomicShift, which is 48. And when we access tid field, we use kTidShift, which is 50.
If I Understand It Correctly, there should be 1-bit unused field between tid field and is_atomic field of Shadow.

dvyukov accepted this revision.Feb 10 2022, 1:38 AM

I don't mind this change, but rtl-old should be deleted now.

This revision is now accepted and ready to land.Feb 10 2022, 1:38 AM
Enna1 added a comment.Feb 10 2022, 2:01 AM

but rtl-old should be deleted now.

Hi @dvyukov, Is there any plan when rtl-old will be deleted, right now ? If so, I won't commit this patch.

BTW, AFAIK tsan v2 uses pure happen-befores similar to FastTrack(PLDI'09), Is there any change in v3, are we still use this algorithm ?
Thanks!

dvyukov added a subscriber: thakis.Feb 11 2022, 1:02 AM

but rtl-old should be deleted now.

Hi @dvyukov, Is there any plan when rtl-old will be deleted, right now ? If so, I won't commit this patch.

@thakis does Chrome still need rtl-old?
It already misses some fixes that rtl/ has and may be build broken.

BTW, AFAIK tsan v2 uses pure happen-befores similar to FastTrack(PLDI'09), Is there any change in v3, are we still use this algorithm ?

I would say tsan v2 used algorithm similar to Relacy'08, but ok :)
v3 uses the same algorithm on high-level.

Enna1 added a comment.Feb 11 2022, 1:21 AM

BTW, AFAIK tsan v2 uses pure happen-befores similar to FastTrack(PLDI'09), Is there any change in v3, are we still use this algorithm ?

I would say tsan v2 used algorithm similar to Relacy'08, but ok :)
v3 uses the same algorithm on high-level.

Haha, I read tsan v2 use algorithm similar to FastTrack(PLDI'09) from "AddressSanitizer, ThreadSanitizer and MemorySanitizer -- Dynamic Testing Tools for C++ @ GTAC2013".
Is there any paper about the Relacy'08 algorithm? I only found your relacy github repo
I want to dive into the algorithm behind tsan.
Thanks!

Is there any paper about the Relacy'08 algorithm? I only found your relacy github repo

No, only the sources.

vitalybuka accepted this revision.Feb 23 2022, 11:15 AM
This revision was automatically updated to reflect the committed changes.