:orphan: .. title:: STACK_SENTINEL .. option:: CONFIG_STACK_SENTINEL *Enable stack sentinel* Type: ``bool`` Help ==== Store a magic value at the lowest addresses of a thread's stack. Periodically check that this value is still present and kill the thread gracefully if it isn't. This is currently checked in four places: 1) Upon any context switch for the outgoing thread 2) Any hardware interrupt that doesn't context switch, the check is performed for the interrupted thread 3) When a thread returns from its entry point 4) When a thread calls k_yield() but doesn't context switch This feature doesn't prevent corruption and the system may be in an unusable state. However, given the bizarre behavior associated with stack overflows, knowledge that this is happening is very useful. This feature is intended for those systems which lack hardware support for stack overflow protection, or have insufficient system resources to use that hardware support. Direct dependencies =================== !\ :option:`USERSPACE ` *(Includes any dependencies from ifs and menus.)* Defaults ======== No defaults. Implicitly defaults to ``n``. Symbols selected by this symbol =============================== - \ :option:`THREAD_STACK_INFO ` Kconfig definition ================== .. highlight:: kconfig At ``subsys/debug/Kconfig:145`` Included via ``Kconfig:8`` → ``Kconfig.zephyr:34`` → ``subsys/Kconfig:17`` Menu path: (Top) → Sub Systems and OS Services → Debugging Options .. parsed-literal:: config STACK_SENTINEL bool "Enable stack sentinel" select \ :option:`THREAD_STACK_INFO ` depends on !\ :option:`USERSPACE ` help Store a magic value at the lowest addresses of a thread's stack. Periodically check that this value is still present and kill the thread gracefully if it isn't. This is currently checked in four places: 1) Upon any context switch for the outgoing thread 2) Any hardware interrupt that doesn't context switch, the check is performed for the interrupted thread 3) When a thread returns from its entry point 4) When a thread calls k_yield() but doesn't context switch This feature doesn't prevent corruption and the system may be in an unusable state. However, given the bizarre behavior associated with stack overflows, knowledge that this is happening is very useful. This feature is intended for those systems which lack hardware support for stack overflow protection, or have insufficient system resources to use that hardware support. *(The 'depends on' condition includes propagated dependencies from ifs and menus.)*