summaryrefslogtreecommitdiff
path: root/trap.c
diff options
context:
space:
mode:
kill user process when it generates an unhandled trap (e.g., 13)
fix bug in test code of malloc
Diffstat (limited to 'trap.c')
-rw-r--r--trap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/trap.c b/trap.c
index d201990..f26024b 100644
--- a/trap.c
+++ b/trap.c
@@ -126,8 +126,10 @@ trap(struct trapframe *tf)
}
cprintf("trap %d from cpu %d eip %x\n", v, cpu(), tf->eip);
- if(curproc[cpu()])
+ if(curproc[cpu()]) {
cprintf("pid %d\n", curproc[cpu()]->pid);
+ proc_exit();
+ }
// panic("trap");
return;