diff --git a/trap.c b/trap.c index bd1af93..f48ccd9 100644 --- a/trap.c +++ b/trap.c @@ -66,6 +66,12 @@ trap(struct trapframe *tf) tf->trapno, cpuid(), tf->eip, rcr2()); panic("trap"); } + // In user space, assume process misbehaved. + cprintf("pid %d %s: trap %d err %d on cpu %d " + "eip 0x%x addr 0x%x--kill proc\n", + myproc()->pid, myproc()->name, tf->trapno, + tf->err, cpuid(), tf->eip, rcr2()); + myproc()->killed = 1; } // Force process to exit if it has been killed and is in user space.