<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 - interceptors for __pthread_mutex_(un)lock should wrap __pthread_mutex_lock but actually call pthread_mutex_lock"
   href="https://bugs.llvm.org/show_bug.cgi?id=41095">41095</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>interceptors for __pthread_mutex_(un)lock should wrap __pthread_mutex_lock but actually call pthread_mutex_lock
          </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>asan
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>roc@ocallahan.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre><a href="https://github.com/llvm-project/llvm-project-20170507/commit/0a6efb6b61cba4040646e634c89c81ce38512d4d#diff-84c56a2db2415e80a9250fcf8679f462R4057">https://github.com/llvm-project/llvm-project-20170507/commit/0a6efb6b61cba4040646e634c89c81ce38512d4d#diff-84c56a2db2415e80a9250fcf8679f462R4057</a>

  #if SANITIZER_INTERCEPT___PTHREAD_MUTEX
  INTERCEPTOR(int, __pthread_mutex_lock, void *m) {
    return WRAP(pthread_mutex_lock)(m);
  }

This doesn't look right to me. I think it should call
WRAP(__pthread_mutex_lock).

This matters in practice because rr wraps pthread_mutex_lock to modify mutex
state and then call __pthread_mutex_lock. When recording an ASAN application,
ASAN intercepts __pthread_mutex_lock to delegate to pthread_mutex_lock, which
ends up back at rr's override. So we're in an infinite loop.</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>