Lines Matching +full:x +full:- +full:versions
12 compiler instrumentation module and a run-time library.
14 Typical slowdown introduced by MemorySanitizer is **3x**.
20 * Uninitialized value was passed or returned from a function call, which is considered an undefined behavior. The check can be disabled with ``-fno-sanitize-memory-param-retval``.
31 Simply compile and link your program with ``-fsanitize=memory`` flag.
32 The MemorySanitizer run-time library should be linked to the final
34 link step. When linking shared libraries, the MemorySanitizer run-time
35 is not linked, so ``-Wl,-z,defs`` may cause link errors (don't use it
36 with MemorySanitizer). To get a reasonable performance add ``-O1`` or
38 ``-fno-omit-frame-pointer``. To get perfect stack traces you may need
39 to disable inlining (just use ``-O1``) and tail call elimination
40 (``-fno-optimize-sibling-calls``).
42 .. code-block:: console
55 % clang -fsanitize=memory -fno-omit-frame-pointer -g -O2 umr.cc
58 stderr and exit with a non-zero exit code.
60 .. code-block:: console
63 WARNING: MemorySanitizer: use-of-uninitialized-value
65 #1 0x7f45938b676c in __libc_start_main libc-start.c:226
69 :ref:`origin tracking <msan-origins>`.
72 ------------------------------------
76 <langext-__has_feature-__has_extension>` can be used for this purpose.
78 .. code-block:: c
87 -----------------------------------------------
96 --------------------------------------------------------
102 and resulting side-effects. This attribute overrides ``no_sanitize("memory")``.
105 ----------
117 reports. Make sure that ``llvm-symbolizer`` binary is in ``PATH``,
120 .. _msan-origins:
126 Valgrind's --track-origins option. This feature is enabled by
127 ``-fsanitize-memory-track-origins=2`` (or simply
128 ``-fsanitize-memory-track-origins``) Clang option. With the code from
131 .. code-block:: console
145 % clang -fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer -g -O2 umr2.cc
147 WARNING: MemorySanitizer: use-of-uninitialized-value
149 #1 0x7f789249b76c in __libc_start_main libc-start.c:226
162 reports. It slows down program execution by a factor of 1.5x-2x on top
165 Clang option ``-fsanitize-memory-track-origins=1`` enables a slightly
169 Use-after-destruction detection
172 MemorySanitizer includes use-after-destruction detection. After invocation of
179 #. Pass addition Clang option ``-fno-sanitize-memory-use-after-dtor`` during
196 to run MemorySanitizer-instrumented programs linked with
198 MemorySanitizer-instrumented Clang compiler by linking it with
199 self-built instrumented libc++ (as a replacement for libstdc++).
206 MemorySanitizer's runtime was not developed with security-sensitive
221 * MemorySanitizer uses 2x more real memory than a native run, 3x with
227 * Older versions of MSan (LLVM 3.7 and older) didn't work with
228 non-position-independent executables, and could fail on some Linux
229 kernel versions with disabled ASLR. Refer to documentation for older versions
231 * MemorySanitizer might be incompatible with position-independent executables
238 MemorySanitizer is known to work on large real-world programs