[cfe-users] Silencing errors in TSAN

Kyle Edwards via cfe-users cfe-users at lists.llvm.org
Fri Jan 24 07:15:37 PST 2020


Hello all,

I am attempting to build OpenMPI with TSAN enabled (to TSAN-itize a
project that uses OpenMPI), and am finding that OpenMPI throws lots of
errors in TSAN (not surprising.) I am attempting to build OpenMPI with
the following blacklist:

src:*

However, I am still getting errors when I run mpiexec. I've reduced it
down to the following minimal example:

--

#include <thread>

#include <unistd.h>

static int my_pipe[2];

int main()
{
  pipe(my_pipe);
  std::thread([]() {
    std::this_thread::sleep_for(std::chrono::seconds(1));
    close(my_pipe[1]);
  }).detach();
  write(my_pipe[1], "Hello", 5);
  std::this_thread::sleep_for(std::chrono::seconds(2));
  return 0;
}

--

Even when I compile this with -fsanitize-blacklist=blacklist.txt, I
still get a warning about a race condition. Is there some way I can
silence this, preferably without patching OpenMPI? Is this a bug in
TSAN?

Kyle


More information about the cfe-users mailing list