Skip to content

Seemingly false positives with MSAN and libc++Β #100600

@Desperado17

Description

@Desperado17

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    compiler-rt:msanMemory sanitizerlibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions