Lines Matching +full:use +full:- +full:external +full:- +full:names
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
33 make sure to use ``clang`` (not ``ld``) for the final link step. When linking
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)
107 If that does not work for you (e.g. your process is sandboxed), you can use a
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 ---------------------
151 Suppressing Reports in External Libraries
152 -----------------------------------------
154 not being recompiled. If you run into an issue in external libraries, we
156 gets addressed. However, you can use the following suppression mechanism
158 mechanism should only be used for suppressing issues in external code; it
160 in external libraries, set the ``ASAN_OPTIONS`` environment variable to point
164 .. code-block:: bash
168 Use the following format to specify the names of the functions or libraries
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 --------------------------------------------------------------------------
198 Some code should not be instrumented by AddressSanitizer. One may use the
202 supported by other compilers, so we suggest to use it together with
206 -------------------------------------------------
212 suppress error reports for out-of-bound access to globals with certain
213 names and types (you may only specify class or struct types).
215 You may use an ``init`` category to suppress reports about initialization-order
218 .. code-block:: bash
222 # Ignore all functions with names containing MyFooBar:
224 # Disable out-of-bound checks for global:
226 # Disable out-of-bound checks for global instances of a given class ...
228 # ... or a given struct. Use wildcard to deal with anonymous namespace.
230 # Disable initialization-order checks for globals:
242 * On 64-bit platforms AddressSanitizer maps (but not reserves) 16+ Terabytes of
253 * OS X 10.7 - 10.11 (i386/x86\_64)
256 * FreeBSD i386/x86\_64 (tested on FreeBSD 11-current)
265 check-asan`` command.