From fe30b74fdef8761c58fb5d0c072c9f61decc7443 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 6 Dec 2009 16:01:21 +0000 Subject: [PATCH] Fix for stack traces in the early boot process: The thread might not have its stack top/bottom assigned yet. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34527 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/arch/x86/arch_debug.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/system/kernel/arch/x86/arch_debug.cpp b/src/system/kernel/arch/x86/arch_debug.cpp index d45412de82..c7f521599d 100644 --- a/src/system/kernel/arch/x86/arch_debug.cpp +++ b/src/system/kernel/arch/x86/arch_debug.cpp @@ -391,6 +391,11 @@ is_kernel_stack_address(struct thread* thread, addr_t address) if (thread == NULL) return IS_KERNEL_ADDRESS(address); + // Also in the early boot process we might have a thread structure, but it + // might not have its kernel stack attributes set yet. + if (thread->kernel_stack_top == 0) + return IS_KERNEL_ADDRESS(address); + return (address >= thread->kernel_stack_base && address < thread->kernel_stack_top) || (thread->cpu != NULL