aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuli Mallett <jmallett@FreeBSD.org>2002-10-03 04:09:00 +0000
committerJuli Mallett <jmallett@FreeBSD.org>2002-10-03 04:09:00 +0000
commita723033a4dda06e0688f81202a984da4bbec0f40 (patch)
tree19832029a7aedcb5f31997d8b7026a6efbbce68d
parent91e97a8266d38eb58a566fef3ea7c2353b20fd37 (diff)
Notes
-rw-r--r--sys/kern/kern_synch.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index 83f3d28bd218..42d23bd5650f 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -788,8 +788,13 @@ mi_switch(void)
/*
* Check if the process exceeds its cpu resource allocation. If
* over max, arrange to kill the process in ast().
+ *
+ * XXX The checking for p_limit being NULL here is totally bogus,
+ * but hides something easy to trip over, as a result of us switching
+ * after the limit has been freed/set-to-NULL. A KASSERT() will be
+ * appropriate once this is no longer a bug, to watch for regression.
*/
- if (p->p_state != PRS_ZOMBIE &&
+ if (p->p_state != PRS_ZOMBIE && p->p_limit != NULL &&
p->p_limit->p_cpulimit != RLIM_INFINITY &&
p->p_runtime.sec > p->p_limit->p_cpulimit) {
p->p_sflag |= PS_XCPU;