[clang] [docs][msan] List common cases reported by msan (PR #101105)

Vitaly Buka via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 30 10:52:51 PDT 2024


================
@@ -8,11 +8,18 @@ MemorySanitizer
 Introduction
 ============
 
-MemorySanitizer is a detector of uninitialized reads. It consists of a
+MemorySanitizer is a detector of uninitialized memory use. It consists of a
 compiler instrumentation module and a run-time library.
 
 Typical slowdown introduced by MemorySanitizer is **3x**.
 
+Here is a not comprehensive of list cases when MemorySanitizer will report an error:
+
+* Uninitialized value was used in a conditional branch.
+* Uninitialized pointer was used for memory accesses.
+* Uninitialized value passed or returned from a function call, which is considered an undefined behavior. The check can be disabled with ``-fno-sanitize-memory-param-retval``.
+* Uninitialized data was passed into some libc calls.
----------------
vitalybuka wrote:

Not realy 
e.g `fopen(file_path, ...)`

`param-retval` will only check argument (pointer) if initialized
'libc` one will also check bytes in the string.

We can't check complex data structures or arrays without knowing details of called functions, but we know that about libc (glibc in case of msan)


https://github.com/llvm/llvm-project/pull/101105


More information about the cfe-commits mailing list