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);
 }
 

Reply via email to