Author: kib Date: Thu Aug 20 22:44:26 2015 New Revision: 286975 URL: https://svnweb.freebsd.org/changeset/base/286975
Log: If process becomes reaper (procctl(PROC_REAP_ACQUIRE)) while already having some children, the children' reaper is not reset to the parent. This allows for the situation where reaper has children but not descendands and the too strict asserts in the reap_status() fire. Remove the wrong asserts, add some clarification for the situation to the procctl(2) REAP_STATUS. Reported and tested by: feld Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/sys/procctl.2 head/sys/kern/kern_procctl.c Modified: head/lib/libc/sys/procctl.2 ============================================================================== --- head/lib/libc/sys/procctl.2 Thu Aug 20 22:14:43 2015 (r286974) +++ head/lib/libc/sys/procctl.2 Thu Aug 20 22:44:26 2015 (r286975) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 29, 2014 +.Dd August 21, 2015 .Dt PROCCTL 2 .Os .Sh NAME @@ -148,7 +148,11 @@ The specified process is the root of the .Pp The .Fa rs_children -field returns the number of children of the reaper. +field returns the number of children of the reaper among the descendands. +It is possible to have a child which reaper is not the specified process, +since the reaper for the existing children is not reset on the +.Dv PROC_REAP_ACQUIRE +operation. The .Fa rs_descendants field returns the total number of descendants of the reaper(s), Modified: head/sys/kern/kern_procctl.c ============================================================================== --- head/sys/kern/kern_procctl.c Thu Aug 20 22:14:43 2015 (r286974) +++ head/sys/kern/kern_procctl.c Thu Aug 20 22:44:26 2015 (r286975) @@ -187,8 +187,6 @@ reap_status(struct thread *td, struct pr } } else { rs->rs_pid = -1; - KASSERT(LIST_EMPTY(&reap->p_reaplist), ("reap children list")); - KASSERT(LIST_EMPTY(&reap->p_children), ("children list")); } return (0); } _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"