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

    <tr>
        <th>Summary</th>
        <td>
            [TySan] can't build protobuf-c
        </td>
    </tr>

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

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

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

<pre>
    Do I need a TypeSanitizer instrumented libc++ and libc++abi?  Is there something equivalent to `LLVM_USE_SANITIZER=MemoryWithOrigins`?  `LLVM_USE_SANITIZER=Type` maybe?

The build appears to be running protoc here and erroring out.

```
=96490==ERROR: TypeSanitizer: type-aliasing-violation on address 0x7ff7b73e8170 (pc 0x000108f38825 bp 0x7ff7b73e8110 sp 0x7ff7b73e80a0 tid 5397290)
READ of size 8 at 0x7ff7b73e8170 with type long partially accesses an object of type int that starts at offset 6
    #0 0x000108f38824 in unsigned long std::__1::__loadword[abi:ne200100]<unsigned long>(void const*)+0x514 (protoc-3.21.12.0:x86_64+0x100430824)
    #1 0x000108f36643 in std::__1::__murmur2_or_cityhash<unsigned long, 64ul>::__hash_len_33_to_64[abi:ne200100](char const*, unsigned long)+0x5e63 (protoc-3.21.12.0:x86_64+0x10042e643)
    #2 0x000108f20ce2 in std::__1::__murmur2_or_cityhash<unsigned long, 64ul>::operator()[abi:ne200100](void const*, unsigned long) const+0x2052 (protoc-3.21.12.0:x86_64+0x100418ce2)
    #3 0x000108f1ec7e in unsigned long std::__1::__do_string_hash[abi:ne200100]<char const*>(char const*, char const*)+0x91e (protoc-3.21.12.0:x86_64+0x100416c7e)
    #4 0x000108f1e33a in std::__1::__string_hash<char, std::__1::allocator<char>>::operator()[abi:ne200100](std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) const+0xa9a (protoc-3.21.12.0:x86_64+0x10041633a)
    #5 0x00010d5ab492 in std::__1::__unordered_map_hasher<std::__1::basic_string<char, 
....
```

I tried settings the base function calls to be ignored via an ignorelist, but that doesn't appear to work either.

These errors are similar to what happens with the MemorySanitizer if I don't build and link against custom instrumented C++ C++ABI libraries.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJysVlFvozgX_TXOy1WRsYHAQx5o00iRZr6ROv12pX1BBl-Cdxw7a5u2mV-_MqE7STtdZaSVIhGwfe855144V3ivdgZxRfJbkq8XYgyDdavBHgd7XLRWHldrC1swiBIEPB4P-FUYFdR3dKCMD27cowkoQau2I-yWsFsQ5vxWtIrwDcDWQxjQIXi7xzAoswP8a1RPQqMJECyQgn769Nvn5v9f75uv9f-2j9s_7h8IX3_GvXXH31UYvji1U8aTgk4RPzoQUZKCwl4cWyR8Q2hNaP04ILSj0hLE4YDC-ZizRXCjMRHMwdlgO5ggRgbonHVxwY4hOYWIiU8_WhO-roqsooSvCV_fPzx8eSC8vlQoPgjHA94IrYRXZnfzpKwWQVkD1oCQ0qH3QF-Wfb9slxzLdEmBsPLQAX2hlKa07HlZshzaw8W2lIK_eEIFhaAk5LxasooSVhFaP9zXa7A9ePUdoQQR3qZ6VmGYEIK2UQLhghJaH0F0HXqPHoQB2_6JXYhxpp0qVmsQAXwQLvgY1fa9xwAFoTUAAGGcXuLPQBkYzdRr8pTLB0l4TXjdNOnrH22FfLZOkvzUNbVBFoNQkq8Jv7sIQPg9YeWTVRI6a3wgrI6k2S19ydNsEnEq6A1PWJqkLKGE1y9l0RTZtCmlNOO0ZNlJqhl3eoa7KDIecf8M6X50-9GxxrqmU-E4CD-8A8juoMhGHYHOp-K2RqNpOG-CjUh-RpSV3SDcGas7eBN4pokFv44nwyLjFzzZD56Mdsj-S572gE4E6wgrY86fU3xTuPcUXxdv6QujObuOaFp2yC6I8h9EU-yWeF0jStv4EF_-qWQftONllaZ2fFe4Nw9OhatSvJJO0S3xgk52Todz8VHdztGfkEY073cKrW03FWveFYv4K3V8H7IVXnUzgH_NHVea4IQ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