[llvm-bugs] [Bug 46656] New: False positives when using std::condition_variable::wait_for

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jul 9 08:01:50 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=46656

            Bug ID: 46656
           Summary: False positives when using
                    std::condition_variable::wait_for
           Product: compiler-rt
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: tsan
          Assignee: unassignedbugs at nondot.org
          Reporter: jchorko+clang at gmail.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 23709
  --> https://bugs.llvm.org/attachment.cgi?id=23709&action=edit
Example program that demonstrates issue

Thread sanitizer reports false positive double locks and data races when
std::condition_variable::wait_for is used.

std::condition_variable::wait_for is implemented using pthread_cond_clockwait
when available (GLIBC >= 2.30 or Android API >= 30, see
https://reviews.llvm.org/D65339) instead of pthread_cond_timedwait, but there
is no interceptor for this function in
compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp

Issue can be reproduced with attached program test_case.cpp, compiled with
-fsanitize=thread -stdlib=libc++ flags on current trunk (tested on
fb75451775f83c04d53e4e94bb4bd298ea9a882f)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200709/6e99ee28/attachment.html>


More information about the llvm-bugs mailing list