kernel panic on HEAD from Oct. 4th sources

Matthew Dillon dillon at
Sun Oct 21 09:32:18 PDT 2007

:It looks like p_sigsagts == NULL.  Presumably, p_sigsagts could be tested for
:NULL in fill_kinfo_proc() (as p_pgrp).
:However, the problem may be higher up in the call stack.  sysctl_kern_proc()
:contains two calls to sysctl_out_proc().  One is protected by PHOLD/PRELE, the
:other isn't.  I reckon both calls should be protected to delay reaping until
:sysctl() processing completes.
:The following patch is UNTESTED as I don't know how to reproduce the original

    Yes, you are correct, both should be protected and your patch looks

    However, even though both should be protected this particular bit of
    code is for special kernel processes, and special kernel processes
    typically do not exit so I do not think it can be the cause.  It needs
    to be fixed anyway, though!  I will commit your patch as soon as I
    test it a little.

					Matthew Dillon 
					<dillon at>

:Index: kern_proc.c
:RCS file: /home/dcvs/src/sys/kern/kern_proc.c,v
:retrieving revision 1.39
:diff -u -5 -r1.39 kern_proc.c
:--- kern_proc.c	12 Aug 2007 16:32:13 -0000	1.39
:+++ kern_proc.c	21 Oct 2007 10:34:28 -0000
:@@ -714,11 +714,13 @@
: 		p = pfind((pid_t)name[0]);
: 		if (!p)
: 			return (0);
: 		if (!PRISON_CHECK(cr1, p->p_ucred))
: 			return (0);
:+		PHOLD(p);
: 		error = sysctl_out_proc(p, req, flags);
:+		PRELE(p);
: 		return (error);
: 	}
: 	if (!req->oldptr) {
: 		/* overestimate by 5 procs */

More information about the Bugs mailing list