[PATCH] D46661: [tsan] Add debugging API to retrieve the "external tag" from reports

George Karpenkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 10 14:18:16 PDT 2018


george.karpenkov added inline comments.


================
Comment at: test/tsan/Darwin/external-swift-debugging.cc:39
+  });
+  // CHECK: WARNING: ThreadSanitizer: Swift access race
+  // CHECK: Modifying access of Swift variable at {{.*}} by thread {{.*}}
----------------
kubamracek wrote:
> delcypher wrote:
> > kubamracek wrote:
> > > delcypher wrote:
> > > > I don't understand this. There's no Swift code in this test case so how is this a Swift access race?
> > > The test is faking what a Swift code would do via the `__tsan_external_write` call.
> > This is still incredibly unclear. Why when using `__tsan_external_write`
> > 
> > - Is it okay to pass nullptr as `caller_pc`?
> > - The fact that `0x1` means a swift race is not all obvious. A bit of grepping shows this is defined in `lib/tsan/rtl/tsan_defs.h` but this is not at all obvious.
> > 
> > Please add some comments to `ExternalWrite` to explain what is going on (i.e. that you're faking a swift access will a special tag that is defined in `lib/tsan/rtl/tsan_defs.h` ).
> I don't want to expand the scope of this patch. Let's strictly focus on the added API.
@delcypher this file is just a test. The race itself is immaterial here, from my understanding the test is there to check that we can get the correct tag from the report. In fact, all the CHECK: lines about the race could be even dropped.


https://reviews.llvm.org/D46661





More information about the llvm-commits mailing list