git: 8cef3c9b768a - main - proc_realparent(): assert that an orphaned child has real parent != parent

Konstantin Belousov <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a690734.456aa.344d7b5a__33386.042974756$1785268067$gmane$org@gitrepo.freebsd.org>
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=8cef3c9b768a4a6d63a7754f6a46315532687305

commit 8cef3c9b768a4a6d63a7754f6a46315532687305
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2026-07-21 19:54:14 +0000
Commit:     Konstantin Belousov <[email protected]>
CommitDate: 2026-07-28 19:45:47 +0000

    proc_realparent(): assert that an orphaned child has real parent != parent
    
    Reviewed by:    markj
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D58504
---
 sys/kern/kern_exit.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 2aa756bd00d2..c43bd69554e7 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -124,6 +124,9 @@ proc_realparent(struct proc *child)
 	}
 	parent = __containerof(p->p_orphan.le_prev, struct proc,
 	    p_orphans.lh_first);
+	KASSERT(child->p_pptr != parent,
+	    ("proc %d %p orphaned but parent %d %p is realparent",
+	    child->p_pid, child, parent->p_pid, parent));
 	return (parent);
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.