diff options
author | Philip Guenthe <guenther@cvs.openbsd.org> | 2010-07-10 21:29:38 +0000 |
---|---|---|
committer | Philip Guenthe <guenther@cvs.openbsd.org> | 2010-07-10 21:29:38 +0000 |
commit | 70b71e93e57273957157668e8fbf73ffe57502e7 (patch) | |
tree | 75a68fc52dd4623f9123ef0606a6dac46ed8e760 /sys/kern | |
parent | bc3132e70a55b6fc1887f8891a84451943d440bf (diff) |
A process on the zombie list can have a NULL p_pgrp if it sleeps when
grabbing allproclk in proc_zap(); skip such processes in sysctl(KERN_PROC*)
and handle the NULL pointer in ddb's ps.
ok tedu@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_proc.c | 5 | ||||
-rw-r--r-- | sys/kern/kern_sysctl.c | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index a54ca2ceef3..20884921077 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_proc.c,v 1.42 2010/03/24 23:18:17 tedu Exp $ */ +/* $OpenBSD: kern_proc.c,v 1.43 2010/07/10 21:29:37 guenther Exp $ */ /* $NetBSD: kern_proc.c,v 1.14 1996/02/09 18:59:41 christos Exp $ */ /* @@ -464,7 +464,8 @@ db_show_all_procs(db_expr_t addr, int haddr, db_expr_t count, char *modif) case 'n': db_printf("%5d %5d %5d %d %#10x " "%-12.12s %-16s\n", - pp ? pp->p_pid : -1, p->p_pgrp->pg_id, + pp ? pp->p_pid : -1, + p->p_pgrp ? p->p_pgrp->pg_id : -1, p->p_cred->p_ruid, p->p_stat, p->p_flag, (p->p_wchan && p->p_wmesg) ? p->p_wmesg : "", p->p_comm); diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 41bf6d4f76f..9fc2b8e78f2 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.188 2010/07/02 18:14:40 guenther Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.189 2010/07/10 21:29:37 guenther Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -1372,6 +1372,11 @@ again: */ if (p->p_stat == SIDL) continue; + + /* XXX skip processes in the middle of being zapped */ + if (p->p_pgrp == NULL) + continue; + /* * TODO - make more efficient (see notes below). */ |