Lines Matching +full:- +full:dllvm_enable_runtimes
12 instrumentation module and a run-time library. The tool can detect the
15 * Out-of-bounds accesses to heap, stack and globals
16 * Use-after-free
17 * Use-after-return (clang flag ``-fsanitize-address-use-after-return=(never|runtime|always)`` default: ``runtime``)
20 * Use-after-scope (clang flag ``-fsanitize-address-use-after-scope``)
21 * Double-free, invalid free
30 the ``compiler-rt`` runtime. An example CMake configuration that will allow
33 .. code-block:: console
35 $ cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_ENABLE_RUNTIMES="compiler-rt" <path to source>/llvm
40 Simply compile and link your program with ``-fsanitize=address`` flag. The
41 AddressSanitizer run-time library should be linked to the final executable, so
43 shared libraries, the AddressSanitizer run-time is not linked, so
44 ``-Wl,-z,defs`` may cause link errors (don't use it with AddressSanitizer). To
45 get a reasonable performance add ``-O1`` or higher. To get nicer stack traces
46 in error messages add ``-fno-omit-frame-pointer``. To get perfect stack traces
47 you may need to disable inlining (just use ``-O1``) and tail call elimination
48 (``-fno-optimize-sibling-calls``).
50 .. code-block:: console
60 % clang++ -O1 -g -fsanitize=address -fno-omit-frame-pointer example_UseAfterFree.cc
64 .. code-block:: console
67 % clang++ -O1 -g -fsanitize=address -fno-omit-frame-pointer -c example_UseAfterFree.cc
69 % clang++ -g -fsanitize=address example_UseAfterFree.o
72 exit with a non-zero exit code. AddressSanitizer exits on the first detected error.
87 try to re-exec. Also keep in mind that when moving the executable to another machine,
95 the ``llvm-symbolizer`` binary (or make sure ``llvm-symbolizer`` is in your
98 .. code-block:: console
100 % ASAN_SYMBOLIZER_PATH=/usr/local/bin/llvm-symbolizer ./a.out
101 ==9442== ERROR: AddressSanitizer heap-use-after-free on address 0x7f7ddab8c084 at pc 0x403c8c bp 0x7fff87fb82d0 sp 0x7fff87fb82c8
105 0x7f7ddab8c084 is located 4 bytes inside of 400-byte region [0x7f7ddab8c080,0x7f7ddab8c210)
120 .. code-block:: console
123 % projects/compiler-rt/lib/asan/scripts/asan_symbolize.py / < log | c++filt
124 ==9442== ERROR: AddressSanitizer heap-use-after-free on address 0x7f7ddab8c084 at pc 0x403c8c bp 0x7fff87fb82d0 sp 0x7fff87fb82c8
137 -----------------------------
148 ----------------------------
152 (``-fsanitize-address-use-after-return=runtime``).
156 Enabling this check (``-fsanitize-address-use-after-return=always``) will
158 eliminating this check (``-fsanitize-address-use-after-return=never``).
160 To summarize: ``-fsanitize-address-use-after-return=<mode>``
168 ---------------------
182 -----------------------------------------
194 .. code-block:: bash
203 .. code-block:: bash
206 interceptor_via_fun:-[ClassName objCMethodToSuppress:]
210 -----------------------------------------------------------------
214 :ref:`\_\_has\_feature <langext-__has_feature-__has_extension>` can be used for
217 .. code-block:: c
226 --------------------------------------------------------------------------
246 --------------------------------------------------
252 suppress error reports for out-of-bound access to globals with certain
255 You may use an ``init`` category to suppress reports about initialization-order
258 .. code-block:: bash
264 # Disable out-of-bound checks for global:
266 # Disable out-of-bound checks for global instances of a given class ...
270 # Disable initialization-order checks for globals:
276 ------------------------
281 .. code-block:: bash
296 ------------------------------
299 run-time performance, which leads to increased binary size. Using the
300 (clang flag ``-fsanitize-address-outline-instrumentation` default: ``false``)
302 of the generated code, but also reduces the run-time performance.
311 * On 64-bit platforms AddressSanitizer maps (but not reserves) 16+ Terabytes of
321 AddressSanitizer's runtime was not developed with security-sensitive
342 check-asan`` command.