Closed as not planned
Description
Here in compiler-rt
sanitizer common code:
llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp
Lines 291 to 310 in 5861145
On line 296, the code calls pipe
, which could be intercepted by sanitizers such as TSAN and make them produce false positives. This can be reproduced by the following example, which mixes UBSan and TSan:
// test.cpp
// g++ -std=c++17 -fsanitize=undefined -fsanitize=thread -o test test.cpp
#include <thread>
class Foo {
public:
void produce(int) {}
void consume() {}
void run() {
w1_ = std::thread{&Foo::produce, this, 0};
w2_ = std::thread{&Foo::consume, this};
w1_.join();
w2_.join();
}
private:
std::thread w1_;
std::thread w2_;
};
int main() {
Foo f;
f.run();
return 0;
}
Should we replace this pipe
call with something like internal_pipe
? I can draft a patch for this if necessary. Or this is not a considered scenario?