<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - False positives when using std::condition_variable::wait_for"
   href="https://bugs.llvm.org/show_bug.cgi?id=46656">46656</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>False positives when using std::condition_variable::wait_for
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>compiler-rt
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>tsan
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>jchorko+clang@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23709" name="attach_23709" title="Example program that demonstrates issue">attachment 23709</a> <a href="attachment.cgi?id=23709&action=edit" title="Example program that demonstrates issue">[details]</a></span>
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
<a href="https://reviews.llvm.org/D65339">https://reviews.llvm.org/D65339</a>) 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)</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>