arch: arm64: fatal: limit max number of stack traces

In some cases, the `fp` will never be `NULL` and the stack
unwinding can go on and on forever, limit the max depth so that
this will not happen.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
This commit is contained in:
Yong Cong Sin 2024-05-26 16:16:20 +08:00 committed by Carles Cufí
commit 94346d2441

View file

@ -223,7 +223,7 @@ static void esf_unwind(const z_arch_esf_t *esf)
uint64_t lr;
LOG_ERR("");
while (fp != NULL) {
for (int i = 0; (fp != NULL) && (i < CONFIG_EXCEPTION_STACK_TRACE_MAX_FRAMES); i++) {
lr = fp[1];
#ifdef CONFIG_SYMTAB
uint32_t offset = 0;