If trap() is called when ddb is active, then go directly to trap_fatal();
do not blunder around enabling interrupts and running trap handlers. trap_pfault() will normally pass control to ddb's fault handler which will normally do the right thing. This bug is very old. but in old versions of FreeBSD it is probably only serious for trap handling that involves sleeping. In -current, attempting to examine unmapped memory while stopped at a breakpoint at mi_switch() was always fatal.
This commit is contained in:
parent
5a55cbe1eb
commit
a13cc2f243
@ -190,6 +190,15 @@ trap(frame)
|
||||
#endif
|
||||
|
||||
atomic_add_int(&cnt.v_trap, 1);
|
||||
type = frame.tf_trapno;
|
||||
|
||||
#ifdef DDB
|
||||
if (db_active) {
|
||||
eva = (type == T_PAGEFLT ? rcr2() : 0);
|
||||
trap_fatal(&frame, eva);
|
||||
goto out;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((frame.tf_eflags & PSL_I) == 0) {
|
||||
/*
|
||||
@ -199,7 +208,6 @@ trap(frame)
|
||||
* interrupts disabled until they are accidentally
|
||||
* enabled later.
|
||||
*/
|
||||
type = frame.tf_trapno;
|
||||
if (ISPL(frame.tf_cs) == SEL_UPL || (frame.tf_eflags & PSL_VM))
|
||||
printf(
|
||||
"pid %ld (%s): trap %d with interrupts disabled\n",
|
||||
@ -222,7 +230,6 @@ trap(frame)
|
||||
}
|
||||
|
||||
eva = 0;
|
||||
type = frame.tf_trapno;
|
||||
code = frame.tf_err;
|
||||
if (type == T_PAGEFLT) {
|
||||
/*
|
||||
|
@ -190,6 +190,15 @@ trap(frame)
|
||||
#endif
|
||||
|
||||
atomic_add_int(&cnt.v_trap, 1);
|
||||
type = frame.tf_trapno;
|
||||
|
||||
#ifdef DDB
|
||||
if (db_active) {
|
||||
eva = (type == T_PAGEFLT ? rcr2() : 0);
|
||||
trap_fatal(&frame, eva);
|
||||
goto out;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((frame.tf_eflags & PSL_I) == 0) {
|
||||
/*
|
||||
@ -199,7 +208,6 @@ trap(frame)
|
||||
* interrupts disabled until they are accidentally
|
||||
* enabled later.
|
||||
*/
|
||||
type = frame.tf_trapno;
|
||||
if (ISPL(frame.tf_cs) == SEL_UPL || (frame.tf_eflags & PSL_VM))
|
||||
printf(
|
||||
"pid %ld (%s): trap %d with interrupts disabled\n",
|
||||
@ -222,7 +230,6 @@ trap(frame)
|
||||
}
|
||||
|
||||
eva = 0;
|
||||
type = frame.tf_trapno;
|
||||
code = frame.tf_err;
|
||||
if (type == T_PAGEFLT) {
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user