Skip to contentSkip to conversation

Revert "dt_pid: pid grabs should be shortlived"

PATCH In review [email protected] 3 participants 5 messages May 22, 2025 – Jun 19, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "dt_pid: pid grabs should be shortlived"

From: Eugene Loh <[email protected]>

Commit 4aec5c9931eb ("dt_pid: pid grabs should be shortlived") made grabs short-lived. No test cases show the utility of this patch. Meanwhile, the patch causes roughly a dozen tests to fail on OL9 when the test suite is started remotely using ssh, closing ttys. The problem is that DTrace tries to determine if a process is a "system daemon." There is no robust way of doing so. In particular, the test suite starts trigger processes as root and in many cases closes all file descriptors, making such processes hard to distinguish from system daemons.

As long as the patch causes so many test regressions -- and in the absence of any demonstration of any benefit -- revert this patch.

---
 libdtrace/dt_pid.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
libdtrace/dt_pid.c +1 -2
index 9abbd474c..e2d4e540d 100644
@@ -1257,8 +1257,7 @@ dt_pid_create_pid_probes(dtrace_probedesc_t *pdp, dtrace_hdl_t *dtp, dt_pcb_t *p
 		return 0;
 
 	/* Grab the process. */
-	if (dt_proc_grab_lock(dtp, pid, DTRACE_PROC_WAITING |
-					DTRACE_PROC_SHORTLIVED) < 0) {
+	if (dt_proc_grab_lock(dtp, pid, DTRACE_PROC_WAITING) < 0) {
 		dt_pid_error(dtp, pcb, NULL, D_PROC_GRAB,
 		    "failed to grab process %d", (int)pid);
 		return -1;
Signature · 1 line
2.43.5
#1 lore raw

On 22 May 2025, eugene loh verbalised:

Quoted 6 lines

From: Eugene Loh <[email protected]>

Commit 4aec5c9931eb ("dt_pid: pid grabs should be shortlived") made grabs short-lived. No test cases show the utility of this patch. Meanwhile, the patch causes roughly a dozen tests to fail on OL9 when the test suite is started remotely using ssh, closing ttys. The

I think this is a consequence of another bug (Psystem_daemon() was failing to detect that systemd was running correctly on systemd v2 systems, and we were falling back to the old approach, which is indeed going to conclude that processes in system groups without controlling terminals or associated TTYs are system daemons).

I have a fix for this detection failure under test now and will post it shortly.

Signature · 1 line
NULL && (void)
#2 lore raw
Quoted 11 lines · Nick Alcock via DTrace-devel

On 22 May 2025, eugene loh verbalised:

Quoted 6 lines

From: Eugene Loh <[email protected]>

Commit 4aec5c9931eb ("dt_pid: pid grabs should be shortlived") made grabs short-lived. No test cases show the utility of this patch. Meanwhile, the patch causes roughly a dozen tests to fail on OL9 when the test suite is started remotely using ssh, closing ttys. The

I think this is a consequence of another bug (Psystem_daemon() was failing to detect that systemd was running correctly on systemd v2

(Do you mean cgroup v2?)

Quoted 6 lines

systems, and we were falling back to the old approach, which is indeed going to conclude that processes in system groups without controlling terminals or associated TTYs are system daemons).

I have a fix for this detection failure under test now and will post it shortly.

#3 lore raw
Quoted 11 lines · Sam James via DTrace-devel
Quoted 9 lines · Nick Alcock via DTrace-devel

On 22 May 2025, eugene loh verbalised:

Quoted 6 lines

From: Eugene Loh <[email protected]>

Commit 4aec5c9931eb ("dt_pid: pid grabs should be shortlived") made grabs short-lived. No test cases show the utility of this patch. Meanwhile, the patch causes roughly a dozen tests to fail on OL9 when the test suite is started remotely using ssh, closing ttys. The

Quoted 4 lines
Quoted 2 lines

I think this is a consequence of another bug (Psystem_daemon() was failing to detect that systemd was running correctly on systemd v2

(Do you mean cgroup v2?)

Nevermind, I see that in the patch you posted.

Quoted 12 lines
Quoted 7 lines

systems, and we were falling back to the old approach, which is indeed going to conclude that processes in system groups without controlling terminals or associated TTYs are system daemons).

I have a fix for this detection failure under test now and will post it shortly.

_______________________________________________
DTrace-devel mailing list
[email protected]
https://oss.oracle.com/mailman/listinfo/dtrace-devel

#4 lore raw

On 14 Jun 2025, Sam James outgrape:

Quoted 13 lines
Quoted 11 lines · Sam James via DTrace-devel
Quoted 9 lines · Nick Alcock via DTrace-devel

On 22 May 2025, eugene loh verbalised:

Quoted 6 lines

From: Eugene Loh <[email protected]>

Commit 4aec5c9931eb ("dt_pid: pid grabs should be shortlived") made grabs short-lived. No test cases show the utility of this patch. Meanwhile, the patch causes roughly a dozen tests to fail on OL9 when the test suite is started remotely using ssh, closing ttys. The

Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

I think this is a consequence of another bug (Psystem_daemon() was failing to detect that systemd was running correctly on systemd v2

(Do you mean cgroup v2?)

Yes indeed. The heat and pollen is ruining my brain :/

$random_related_word v2