Lines Matching +full:- +full:fno +full:- +full:omit +full:- +full:frame +full:- +full:pointer
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 (to some extent)
18 * Double-free, invalid free
31 Simply compile and link your program with ``-fsanitize=address`` flag. The
32 AddressSanitizer run-time library should be linked to the final executable, so
34 shared libraries, the AddressSanitizer run-time is not linked, so
35 ``-Wl,-z,defs`` may cause link errors (don't use it with AddressSanitizer). To
36 get a reasonable performance add ``-O1`` or higher. To get nicer stack traces
37 in error messages add ``-fno-omit-frame-pointer``. To get perfect stack traces
38 you may need to disable inlining (just use ``-O1``) and tail call elimination
39 (``-fno-optimize-sibling-calls``).
41 .. code-block:: console
51 % clang -O1 -g -fsanitize=address -fno-omit-frame-pointer example_UseAfterFree.cc
55 .. code-block:: console
58 % clang -O1 -g -fsanitize=address -fno-omit-frame-pointer -c example_UseAfterFree.cc
60 % clang -g -fsanitize=address example_UseAfterFree.o
63 exit with a non-zero exit code. AddressSanitizer exits on the first detected error.
78 try to re-exec. Also keep in mind that when moving the executable to another machine,
86 the ``llvm-symbolizer`` binary (or make sure ``llvm-symbolizer`` is in your
89 .. code-block:: console
91 % ASAN_SYMBOLIZER_PATH=/usr/local/bin/llvm-symbolizer ./a.out
92 …==9442== ERROR: AddressSanitizer heap-use-after-free on address 0x7f7ddab8c084 at pc 0x403c8c bp 0…
96 0x7f7ddab8c084 is located 4 bytes inside of 400-byte region [0x7f7ddab8c080,0x7f7ddab8c210)
111 .. code-block:: console
114 % projects/compiler-rt/lib/asan/scripts/asan_symbolize.py / < log | c++filt
115 …==9442== ERROR: AddressSanitizer heap-use-after-free on address 0x7f7ddab8c084 at pc 0x403c8c bp 0…
128 -----------------------------
139 ---------------------
152 -----------------------------------------
164 .. code-block:: bash
173 .. code-block:: bash
176 interceptor_via_fun:-[ClassName objCMethodToSuppress:]
180 -----------------------------------------------------------------
184 :ref:`\_\_has\_feature <langext-__has_feature-__has_extension>` can be used for
187 .. code-block:: c
196 --------------------------------------------------------------------------
206 -------------------------------------------------
212 suppress error reports for out-of-bound access to globals with certain
215 You may use an ``init`` category to suppress reports about initialization-order
218 .. code-block:: bash
224 # Disable out-of-bound checks for global:
226 # Disable out-of-bound checks for global instances of a given class ...
230 # Disable initialization-order checks for globals:
236 ------------------------
241 .. code-block:: bash
259 * On 64-bit platforms AddressSanitizer maps (but not reserves) 16+ Terabytes of
270 * OS X 10.7 - 10.11 (i386/x86\_64)
273 * FreeBSD i386/x86\_64 (tested on FreeBSD 11-current)
282 check-asan`` command.