🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: muc.lists.freebsd.bugs
Article #726

[Bug 301072] procdesc: procdesc_close() links a traced child onto its own reaper's orphan list, panicking the kernel at child ex...

#726
From: bugzilla-noreply
Date: Tue, 24 Nov 2026 11:59
56 lines
4021 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=301072

--- Comment #13 from laamalif@proton.me ---
You are right that it is the test race: I read proc_to_reap()
again and the guard rejects the untraced PD_NOWAITPID child, so
waitpid() cannot see it before PT_TRACE_ME. Not a wait4() issue;
scrapping that theory.

Fix for the D61975 tests: traceme_and_stop() writes one byte to a
pipe after ptrace(PT_TRACE_ME) returns; the parent reads that byte
before its first waitpid(). reaper_child_close_traced and
reaper_child_close_traced_exit each need the ready pipe; test 1
already had an equivalent byte.

Ran the tests against a GENERIC-KASAN kernel built from main plus
your D61975 kernel change (build of 2026-11-24, #4
main-6edecf52def6-dirty): all three pass, and the two traced tests
pass three consecutive times each.

reaper_child_close: passed
reaper_child_close_traced: passed, 3/3
reaper_child_close_traced_exit: passed, 3/3

Inline diff of the test changes:

--- tests/sys/kern/procdesc.c
+++ tests/sys/kern/procdesc.c
@@ -950,17 +950,21 @@ reaper_child_close(ATF_TC_ARGS_PROTO(tc))
 static void
 traceme_and_stop(int fd)
 {
+       int readyfd = tc_fd; /* see below */
        close(fd);
        if (ptrace(PT_TRACE_ME, 0, NULL, 0) != 0)
                _exit(1);
+       if (write(readyfd, &c, 1) != 1)
+               _exit(2);
        raise(SIGSTOP);
        for (;;)
                pause();
        _exit(0);
 }

(Attached as the full revised test file; the inline sketch abbreviates
the plumbing: traceme_and_stop() takes the ready pipe end as a second
argument, each traced test creates the pipe before pdfork, and the
parent reads one byte from it before the first waitpid.)

-- 
You are receiving this mail because:
You are the assignee for the bug.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Technical Details
Message-ID: <bug-301072-227-0punRPhZ7d@https.bugs.freebsd.org/bugzilla/>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!weretis.net!feeder8.news.weretis.net!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mail
References: <bug-301072-227@https.bugs.freebsd.org/bugzilla/>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!weretis.net!feeder8.news.weretis.net!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mail
From: bugzilla-noreply@freebsd.org
Newsgroups: muc.lists.freebsd.bugs
Subject: [Bug 301072] procdesc: procdesc_close() links a traced child onto
 its own reaper's orphan list, panicking the kernel at child exit
Date: Tue, 24 Nov 2026 11:59:47 +0000
Organization: Newsgate at muc.de e.V.
Approved: news-admin@muc.de
Distribution: world
Message-ID: <bug-301072-227-0punRPhZ7d@https.bugs.freebsd.org/bugzilla/>
References: <bug-301072-227@https.bugs.freebsd.org/bugzilla/>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2";
	logging-data="29006"; mail-complaints-to="news-admin@muc.de"
X-Original-To: bugs@mlmmj.nyi.freebsd.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1795521587;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=dS7R4WObMlGeqd+F00DMR/O4tWIaKmg8lu7KyOCCVRk=;
	b=wt82lRX1gEo6S2bepBsCGmHParQO35vISpPdQ3Bu996y5RkHLfLvgtQPSAnbUhJBzlpJqI
	/NT8F+sBQ2UOkU8CsZFdOEu8x8DBUeavsJK8xBahKeNSZLVKIVgWVBmvJZauVeA0GwBV6d
	KcG4rQETuXr/MhD45rjGUGQTwYsh7s2QySCVj4kr9RVDbWU76uQzSzFnGGKnmQ2DfT86Nr
	vHfeZXqkev0ctdXvrrkb9N1rl2NXnUcXKvFlRNui8eR+v0TnWjscqt4zjdlls1RCOg6KpG
	CCxPmcgppUktSjGo4NOybcwdzjdpIXwi/mt2foy3wkJfWXAu/kWRL8PO5iUXuA==
X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f
In-Reply-To: <bug-301072-227@https.bugs.freebsd.org/bugzilla/>
Auto-Submitted: auto-generated
Precedence: list
X-Newsgate-Id: f02c70b8849f+
X-No-Archive: Yes