From 414765c25358a3f8e2d1a1ae93bc16f2e348295a Mon Sep 17 00:00:00 2001 From: thorpej Date: Tue, 8 Aug 2000 23:42:07 +0000 Subject: [PATCH] In fill_kproc2(), testing p->p_stats != NULL doesn't do much good, instead test for (p->p_flag & I_INMEM), and don't access the U-area (via p->p_stats) if that bit is clear. Fixes the hangs people have seen when the system is paging and the user runs top/ps/w. --- sys/kern/kern_sysctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index f66100c38f63..514260e0a5cd 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_sysctl.c,v 1.75 2000/07/14 07:21:22 thorpej Exp $ */ +/* $NetBSD: kern_sysctl.c,v 1.76 2000/08/08 23:42:07 thorpej Exp $ */ /*- * Copyright (c) 1982, 1986, 1989, 1993 @@ -1565,7 +1565,7 @@ fill_kproc2(p, ki) ki->p_eflag |= EPROC_SLEADER; /* XXX Is this double check necessary? */ - if (P_ZOMBIE(p) || p->p_addr == NULL) { + if ((p->p_flag & P_INMEM) == 0 || P_ZOMBIE(p)) { ki->p_uvalid = 0; } else { ki->p_uvalid = 1;