<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/122319>122319</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [OMPT] Linking with libraries that provide "RunningOnValgrind" symbols causes "Unable to find TSan function" messages
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          paulfloyd
      </td>
    </tr>
</table>

<pre>
    Off-topic remark. I'm a bit baffled as to  why TSAN has a "RunningOnValgrind" that doesn't do what it says (it doesn't detect that the exe is running on Valgrind, it just looks at the TSAN_OPTIONS).

The app that I'm working on uses Google Perftools tcmallloc. I'm doing some tests with LLVM OMP.

So when I run our exe I get

```
Unable to find TSan function AnnotateHappensAfter.
Unable to find TSan function AnnotateHappensBefore.
Unable to find TSan function AnnotateIgnoreWritesBegin.
Unable to find TSan function AnnotateIgnoreWritesEnd.
Unable to find TSan function AnnotateNewMemory.
Unable to find TSan function __tsan_func_entry.
Unable to find TSan function __tsan_func_exit.
Warning: please export TSAN_OPTIONS='ignore_noninstrumented_modules=1' to avoid false positive reports from the OpenMP runtime!
```

This is similar to issue #@93524

This is because you are checking for TSAN with a function called "RunningOnValgrind". However, tcmalloc also contains a "RunningOnValgrind".
 (booby prize for Google Perftools as well, their RunningOnValgrind also does not detect that the exe is running on Valgrind).


I'm doing a test, trying to use "_tsan_init" rather than "RunningOnValgrind". I'll update soon if it looks OK.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJycVV1v20YQ_DWnl0UE8iiZ0QMflLpujNqWUbvJo3Akl-TFx1vidilF_fXFkQpcN3AaFxAgibqZ_biZkWG2rUcs1PqDWl8uzCgdhWIwo2scnepFSfWp2DXNO6HBVhCwN-FpCddK5z0YKK1AaZrGYQ2GQQjg2J3g8WF7B51hMKC0_mP03vp25z8Z1wbra6U1SG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