kernel - Terminate ddb backtraces at Xfast_syscall
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 29 Apr 2013 19:27:34 +0000 (12:27 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 29 Apr 2013 19:27:34 +0000 (12:27 -0700)
* Terminate ddb backtraces at Xfast_syscall to try to avoid double-faults
  from recursing into garbage.

sys/platform/pc64/x86_64/db_trace.c

index fa935e7..4200a8d 100644 (file)
@@ -430,6 +430,13 @@ db_stack_trace_cmd(db_expr_t addr, boolean_t have_addr, db_expr_t count,
 
                db_print_stack_entry(name, narg, argnp, argp, callpc);
 
+               /*
+                * Stop at the system call boundary (else we risk
+                * double-faulting on junk).
+                */
+               if (name && strcmp(name, "Xfast_syscall") == 0)
+                       break;
+
                if (actframe != frame) {
                        /* `frame' belongs to caller. */
                        callpc = (db_addr_t)