summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_synch.c
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2002-10-03 04:09:00 +0000
committerjmallett <jmallett@FreeBSD.org>2002-10-03 04:09:00 +0000
commit2eba9107fd1321295aebc7fea9f4546656156488 (patch)
tree19832029a7aedcb5f31997d8b7026a6efbbce68d /sys/kern/kern_synch.c
parentda2757cbc5b4e67753f56890f45f5f687cc298ae (diff)
downloadFreeBSD-src-2eba9107fd1321295aebc7fea9f4546656156488.zip
FreeBSD-src-2eba9107fd1321295aebc7fea9f4546656156488.tar.gz
XXX Add a check for p->p_limit being NULL before dereferencing it. This is
totally bogus but will hide the occurances of access of 0xbc(NULL) which people have run into lately. This is not a proper fix, just a bandaid, until the cause of this happening is tracked down and fixed. Reviewed by: rwatson
Diffstat (limited to 'sys/kern/kern_synch.c')
-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 83f3d28..42d23bd 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;
OpenPOWER on IntegriCloud