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

    <tr>
        <th>Summary</th>
        <td>
            Seemingly false positives with MSAN and libc++
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            libc++
      </td>
    </tr>

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

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

<pre>
    I successfully built libc++ with msan parameters I thought but I seem to get some false positives in std::string class:

==49572==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7ffff6cd4901 in std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::operator=(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) /home/user/instrumentedlibcpp/llvm-project/msan_out/include/c++/v1/string:2531:11

libc++ built with:

cmake -GNinja ../runtimes \
 -DCMAKE_BUILD_TYPE=Release \
 -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \
 -DCMAKE_C_COMPILER=clang \
    -DCMAKE_CXX_COMPILER=clang++ \
 -DBUILD_SHARED_LIBS="ON" \
    -DLLVM_USE_SANITIZER=MemoryWithOrigins \
    -DLIBCXXABI_USE_LLVM_UNWINDER=OFF

cmake --build . -- cxx cxxabi

llvmorg-18.1.8
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVMFuqzgU_Rpnc5UI7JDAggUJ4Q2ahD417bQzG-TABfzG4Mg2mfR9_QhI9dJp9yMhZNnnXh_7HB9ujKg7xJB4G-LFM97bRukwRnNGzUvlrmcnVb6FKZi-KNCYqpfyDU69kBakOBWEbgjdwD_CNtAa3sGZa96iRW0gBduovm4snHoLKRjEFqyCGi0Y1SJUXBqEszLCigsaEB0YWxIWERYZq0VXQyG5McOMExPn_c9iwuJl4K3pNHyJHrM0-0ZYBAdslX478k5Y8RP1MNUbnKtq3ndimORS_MRyfuGyx6kdAAChzAHnuq6qqloV5TJw3A9s8tydBiduRJFP5AjbFg3XhG6_AA4rudVcWPOOY7uvoVxKVXCr9B1w-IY1NegwLsWE-v8nHyhUZyyhK0IDIDRpVIuEJr1BTWgiOmN132JnsRx8cT4Tmkh5aednrX5gYQlNBn_kqrcjvJB9OdTfHERocnEJTd5PElGPDXRc9175O8dNFhx89x93FC3_G2H-LRPdDw6LBaGJ7jsrWjRAvO1N83m8PUS_7_LNc7qP86c_v-8Iix9RIjf4Abbf_3HId1m02e_yx-fsKT3sjqMYdCBzvRK2mQb8JAilX2yxzbcPh-_pfvdIWFxI3tV3IIBfuNfXT8jbYe-bToyPv0WPuzjfp5sbm4fs4-5j45H883GXH6MsfUr_GhtPT-RF2OZBi1p05lNVutm-vkabdCydemQvaRaP5Q9J8sV1zwc9SljAfA7F9Qq3C7nXTl5apeu56y_chT8rQ1YGLOAzDN01dQO6Zkt31oR-4JSVX_puFVAeUEax8Iul53tltWJVwGcipA5dOmvquWvH9_zFyitWvlt65WrFcM0csnSw5UIuhh0XStczYUyPoes4K8eZSX5CacbAmzR8NyAdAlCHo2lPfW3I0pHCWPOrjxVWYnhEbEVXy7dP-TWm4OEYZcC78i4eZ72WYWPteUwymhCa1MI2_WlRqPb2Tj4_l5G1ITS5Eb-E9N8AAAD__7W4tHw">