]> Zhao Yanbai Git Server - minix.git/commitdiff
kernel: limit stacktrace depth to 50.
authorBen Gras <ben@minix3.org>
Tue, 2 Nov 2010 21:27:04 +0000 (21:27 +0000)
committerBen Gras <ben@minix3.org>
Tue, 2 Nov 2010 21:27:04 +0000 (21:27 +0000)
  - Unlikely to discard useful information and avoids long
    system lockups on machines configured to print system output to serial.

kernel/arch/i386/exception.c

index 7b3e1e37854006c21a389f8d6a13be8f8b5f2644..98c1edaf7aa13d966c0d99687685401069b3aecc 100644 (file)
@@ -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");
 }