From: Ben Gras Date: Tue, 2 Nov 2010 21:27:04 +0000 (+0000) Subject: kernel: limit stacktrace depth to 50. X-Git-Tag: v3.2.0~761 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/rndc.html?a=commitdiff_plain;h=515e8d075fee056e169e0a2af4ec25de0466db7e;p=minix.git 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. --- 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"); }