From: Ingo Molnar If CONFIG_FRAME_POINTERS is enabled, and one does a dump_stack() during early SMP init, an infinite stackdump and a bootup hang happens: [] show_trace+0xd/0xf [] dump_stack+0x15/0x17 [] save_trace+0xc3/0xce [] mark_lock+0x8c/0x4fe [] __lockdep_acquire+0x44e/0xaa5 [] lockdep_acquire+0x68/0x84 [] _spin_lock+0x21/0x2f [] prepare_set+0xd/0x5d [] generic_set_all+0x1d/0x201 [] mtrr_ap_init+0x23/0x3b [] identify_cpu+0x2a7/0x2af [] smp_store_cpu_info+0x2f/0xb4 [] start_secondary+0xb5/0x3ec [] end_of_stack_stop_unwind_function+0x1/0x4 [] end_of_stack_stop_unwind_function+0x1/0x4 [] end_of_stack_stop_unwind_function+0x1/0x4 [] end_of_stack_stop_unwind_function+0x1/0x4 [] end_of_stack_stop_unwind_function+0x1/0x4 [] end_of_stack_stop_unwind_function+0x1/0x4 [] end_of_stack_stop_unwind_function+0x1/0x4 [] end_of_stack_stop_unwind_function+0x1/0x4 [...] Due to "end_of_stack_stop_unwind_function" recursing back to itself in the EBP stackframe-walker. So avoid this type of recursion when walking the stack . Signed-off-by: Ingo Molnar Signed-off-by: Andrew Morton --- arch/i386/kernel/traps.c | 6 ++++++ 1 file changed, 6 insertions(+) diff -puN arch/i386/kernel/traps.c~i386-break-out-of-recursion-in-stackframe-walk arch/i386/kernel/traps.c --- devel/arch/i386/kernel/traps.c~i386-break-out-of-recursion-in-stackframe-walk 2006-05-17 13:09:46.000000000 -0700 +++ devel-akpm/arch/i386/kernel/traps.c 2006-05-17 13:09:46.000000000 -0700 @@ -149,6 +149,12 @@ static inline unsigned long print_contex while (valid_stack_ptr(tinfo, (void *)ebp)) { addr = *(unsigned long *)(ebp + 4); printed = print_addr_and_symbol(addr, log_lvl, printed); + /* + * break out of recursive entries (such as + * end_of_stack_stop_unwind_function): + */ + if (ebp == *(unsigned long *)ebp) + break; ebp = *(unsigned long *)ebp; } #else _