[PATCH] D66885: [TSan] Add read/write range interface functions with PC

Joachim Protze via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 28 10:06:52 PDT 2019


protze.joachim added a comment.

In D66885#1649241 <https://reviews.llvm.org/D66885#1649241>, @dvyukov wrote:

> Who are "we"? And you would prefer to call them where? ;)


I'm working with some students in my group on the MPI and OpenMP runtime correctness checking tools called MUST and Archer. 
For MPI communication calls we are working on annotation for the memory access semantics of the buffer accesses. Since these memory accesses are typically done by the NIC, TSan could never observe such accesses directly. In multi-threaded MPI applications this annotation allows us to detect data race between communication and other threads accessing the buffer.

A simplified example of such annotation would look like:

  int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm){
    int size;
    MPI_Type_size(datatype, &size);
    __tsan_read_range_pc(buf, (uptr)size*count, __builtin_return_address(0));
    return PMPI_Send(buf, count, datatype, dest, tag, comm);
  }

Is there a better interface for doing such annotations? 
In our specific use case, also asan and msan might be interesting. I didn't look into interfaces of those, but a generic interface for all those sanitizers might be interesting.

> Also, tests.

Ok, I'll look into tests for this. But will take some time.


Repository:
  rCRT Compiler Runtime

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66885/new/

https://reviews.llvm.org/D66885





More information about the llvm-commits mailing list