diff --git a/kernel/src/mm/stack.c b/kernel/src/mm/stack.c index 6770e0e..7d12527 100644 --- a/kernel/src/mm/stack.c +++ b/kernel/src/mm/stack.c @@ -22,6 +22,7 @@ */ #include "mm/stack.h" +#include "mm/region.h" #include "utils/logger.h" #include "proc/scheduler.h" @@ -31,7 +32,7 @@ void stack_dump_call_info(uint64_t rip, symbol_T* symbol) { void stack_trace_call_stack(uint64_t rbp) { uint64_t rip = ((uint64_t*)rbp)[1]; - process_T* process = scheduler_get_current_process(); + process_T* process = rip >= MEM_REGION_KERNEL ? scheduler_get_process(PROCESS_KERNEL) : scheduler_get_current_process(); if (process == NULL) { log(LOG_NONE, " 0x%x -> (process NULL reference)", rip); return;