From 515e8d075fee056e169e0a2af4ec25de0466db7e Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Tue, 2 Nov 2010 21:27:04 +0000 Subject: [PATCH] kernel: limit stacktrace depth to 50. - Unlikely to discard useful information and avoids long system lockups on machines configured to print system output to serial. --- kernel/arch/i386/exception.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/arch/i386/exception.c b/kernel/arch/i386/exception.c index 7b3e1e378..98c1edaf7 100644 --- a/kernel/arch/i386/exception.c +++ b/kernel/arch/i386/exception.c @@ -251,6 +251,7 @@ PUBLIC void proc_stacktrace(struct proc *whichproc) { reg_t v_bp, v_pc, v_hbp; int iskernel; + int n = 0; v_bp = whichproc->p_reg.fp; @@ -279,6 +280,8 @@ PUBLIC void proc_stacktrace(struct proc *whichproc) break; } v_bp = v_hbp; + if(n++ > 50) + break; } printf("\n"); } -- 2.44.0