llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.98k stars 11.55k forks source link

Seemingly false positives with MSAN and libc++ #100600

Open Desperado17 opened 1 month ago

Desperado17 commented 1 month ago

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, std::1::allocator>::operator=(std::1::basic_string<char, std::__1::char_traits, std::1::allocator> 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

The lib that calls this links against my libc++.so I checked.

EricWF commented 1 month ago

What version of the sources are you using? That line points to __grow_by in head.

Desperado17 commented 1 month ago

llvmorg-18.1.8 branch

FooBarrior commented 1 month ago

Hello, I have the same issue building MSAN-enabled libcxx. Will be happy for a quick qworkaround to be able to proceed!