The latest development version of this page may be more current than this released 2.7.5 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:44subsys/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.)