Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Jul 2026 19:47:00 +0000
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 8cef3c9b768a - main - proc_realparent(): assert that an orphaned child has real parent != parent
Message-ID:  <6a690734.456aa.344d7b5a@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by kib:

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

commit 8cef3c9b768a4a6d63a7754f6a46315532687305
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-07-21 19:54:14 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
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);
 }
 


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a690734.456aa.344d7b5a>