7 VPP is instrumented to support `Google Sanitizers <https://github.com/google/sanitizers>`_.
8 As of today, only `AddressSanitizer <https://github.com/google/sanitizers/wiki/AddressSanitizer>`_
9 is supported, both for GCC and clang.
14 `AddressSanitizer <https://github.com/google/sanitizers/wiki/AddressSanitizer>`_ (aka ASan) is a memory
15 error detector for C/C++. Think Valgrind but much faster.
17 In order to use it, VPP must be recompiled with ASan support.
18 See developer documentation on prerequisites for :ref:`building VPP <building>`.
20 ASan support is implemented as a cmake build option,
21 so all VPP targets should be supported. For example:
23 .. code-block:: console
25 # build a debug image with ASan support:
26 $ make rebuild VPP_EXTRA_CMAKE_ARGS=-DVPP_ENABLE_SANITIZE_ADDR=ON
29 # build a release image with ASan support:
30 $ make rebuild-release VPP_EXTRA_CMAKE_ARGS=-DVPP_ENABLE_SANITIZE_ADDR=ON
33 # build packages in debug mode with ASan support:
34 $ make pkg-deb-debug VPP_EXTRA_CMAKE_ARGS=-DVPP_ENABLE_SANITIZE_ADDR=ON
37 # run GBP plugin tests in debug mode with ASan
38 $ make test-debug TEST=test_gbp VPP_EXTRA_CMAKE_ARGS=-DVPP_ENABLE_SANITIZE_ADDR=ON
41 Once VPP has been built with ASan support you can use it as usual including
44 .. code-block:: console
46 $ gdb --args $PWD/build-root/install-vpp_debug-native/vpp/bin/vpp "unix { interactive }"