Uninitialized Usage in libstdc++ filesystem?
This is a false positive.
You should report it as a Sanitizer bug; it appears to be similar to issue 1238.
Memory Sanitizer
From the clang santitizer documentation it is clear that it only deals with unitialized memory reads from dynamically allocated memory. Automatic memory is not part of sanitizer checks.
Memory sanitizer reports use-of-uninitialized-value in global object construction
This is probably already reported MemorySanitizer bug https://github.com/google/sanitizers/issues/542.
However it was closed with Status WontFix without much explanation.
It seems that you need to build instrumented C++ standard library to avoid false positives. From MemorySanitizer wiki:
If you want MemorySanitizer to work properly and not produce any false
positives, you must ensure that all the code in your program and in
libraries it uses is instrumented (i.e. built with -fsanitize=memory).
In particular, you would need to link against MSan-instrumented C++
standard library. We recommend to use libc++ for that purpose.
clang memory sanitizer; how to make it print source line numbers
With the address sanitizer I noticed that I needed to have these environment variables defined:
ASAN_OPTIONS=symbolize=1
(only needed when compiled with GCC > 4.8) andASAN_SYMBOLIZER_PATH=$(which llvm-symbolizer)
I think the symbolizer is what you're looking for. It transforms symbols to file names with line numbers and columns.
On the memory sanitizer project website it reads:
Symbolization
Set MSAN_SYMBOLIZER_PATH environment variable to the path to
llvm-symbolizer binary (normally built with LLVM). MemorySanitizer
will use it to symbolize reports on-the-fly.
So you need MSAN_SYMBOLIZER_PATH
to be set analogous to ASAN_SYMBOLIZER_PATH
.
Related Topics
Using Raii to Manage Resources from a C-Style API
Why Does My Program Run Way Faster When I Enable Profiling
How Is Push_Back Implemented in Stl Vector
Why Does Gcc Not Seem to Have the Filesystem Standard Library
Unordered_Map Constructor Error (Equal_To Templated Function)
When Did "And" Become an Operator in C++
Non-Const Reference May Only Be Bound to an Lvalue
Reading from .Txt File into Two Dimensional Array in C++
How to Reproduce Tcp Protocol 3-Way Handshake with Raw Sockets Correctly
Getting Cannot Allocate Memory Error
How to Suppress Specific Warnings in G++
Specializing Single Method in a Big Template Class
What Happens to an Stl Iterator After Erasing It in VS, Unix/Linux
Virtual Functions Default Parameters
How to Know When a New Usb Storage Device Is Connected in Qt
How Does "Using Std::Swap" Enable Adl