-
Notifications
You must be signed in to change notification settings - Fork 11.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docs][msan] List common cases reported by msan #101105
[docs][msan] List common cases reported by msan #101105
Conversation
Created using spr 1.3.4
@llvm/pr-subscribers-clang Author: Vitaly Buka (vitalybuka) ChangesFixes google/sanitizers#1755. Full diff: https://github.com/llvm/llvm-project/pull/101105.diff 1 Files Affected:
diff --git a/clang/docs/MemorySanitizer.rst b/clang/docs/MemorySanitizer.rst
index bcc6cc808e8ba..024bed25243b9 100644
--- a/clang/docs/MemorySanitizer.rst
+++ b/clang/docs/MemorySanitizer.rst
@@ -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 list cases when MemorySanitizer will report an error:
+
+* Conditional branches controlled by uninitialized values.
+* Using uninitalized pointers for memory accesses.
+* Passing and returning uninitialized values to/from function calls. Can be disabled with ``-fno-sanitize-memory-param-retval``.
+* Passing uninitialized data into libc calls.
+
How to build
============
|
* 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this redundant with "Uninitialized value passed or returned from a function call"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In some cases they are redundant, but usually not
e.g fopen(file_path, ...)
param-retval
will only check argument (pointer to C-string) 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)
Fixes google/sanitizers#1755.