From e0494263dae6ba61e1dcad0e15c278c075dc3c38 Mon Sep 17 00:00:00 2001 From: antifallobst Date: Sat, 4 Mar 2023 17:32:34 +0100 Subject: [PATCH] fix (stack-tracing): added check if symbol resolved correctly --- kernel/src/mm/stack.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/src/mm/stack.c b/kernel/src/mm/stack.c index fd4be11..a13d4ef 100644 --- a/kernel/src/mm/stack.c +++ b/kernel/src/mm/stack.c @@ -34,7 +34,12 @@ void stack_trace_call_stack(uint64_t rbp) { process_T* process = scheduler_get_current_process(); symbol_T* symbol = symbol_resolve_function_from_rip(process->executable->symbols, process->executable->num_symbols, rip); - if (symbol != NULL && !string_compare(symbol->name, "_start")) { + if (symbol == NULL) { + log(LOG_NONE, " 0x%x -> ", rip); + return; + } + + if (!string_compare(symbol->name, "_start")) { stack_trace_call_stack(((uint64_t*)rbp)[0]); }