This is the documentation for the latest (main) development branch of Zephyr. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

CONFIG_ASAN

Build with address sanitizer

Type: bool

Help

Builds Zephyr with Address Sanitizer enabled. This is currently
only supported by boards based on the posix architecture, and requires a
recent-ish compiler with the ``-fsanitize=address`` command line option,
and the libasan library.

Note that at exit leak detection is disabled for 64-bit boards when
GCC is used due to potential risk of a deadlock in libasan.
This behavior can be changes by adding leak_check_at_exit=1 to the
environment variable ASAN_OPTIONS.

Direct dependencies

ARCH_POSIX

(Includes any dependencies from ifs and menus.)

Defaults

No defaults. Implicitly defaults to n.

Kconfig definition

At subsys/debug/Kconfig:97

Included via Kconfig:8Kconfig.zephyr:42subsys/Kconfig:17

Menu path: (Top) → Sub Systems and OS Services → Debugging Options

config ASAN
    bool "Build with address sanitizer"
    depends on ARCH_POSIX
    help
      Builds Zephyr with Address Sanitizer enabled. This is currently
      only supported by boards based on the posix architecture, and requires a
      recent-ish compiler with the ``-fsanitize=address`` command line option,
      and the libasan library.

      Note that at exit leak detection is disabled for 64-bit boards when
      GCC is used due to potential risk of a deadlock in libasan.
      This behavior can be changes by adding leak_check_at_exit=1 to the
      environment variable ASAN_OPTIONS.

(The ‘depends on’ condition includes propagated dependencies from ifs and menus.)