public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: Attila Fazekas <afazekas@redhat.com>
To: williams@redhat.com, jkacur@redhat.com, debarbos@redhat.com
Cc: linux-rt-users@vger.kernel.org, Attila Fazekas <afazekas@redhat.com>
Subject: [PATCH] [ssdd] add ptrace tierdown for the tests
Date: Fri, 16 Jan 2026 03:37:36 -0500	[thread overview]
Message-ID: <20260116083736.27032-1-afazekas@redhat.com> (raw)

Without tierdown the tracee can receive SIGTRAP
leading to multiple core dumps being created.
At higher concurrency you may also see

coredump: 11747(ssdd): over core_pipe_limit, skipping core dump

in the dmesg with
kernel.core_pattern = |/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %d %F
kernel.core_pipe_limit = 16

Signed-off-by: Attila Fazekas <afazekas@redhat.com>
---
 src/ssdd/ssdd.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/ssdd/ssdd.c b/src/ssdd/ssdd.c
index 63130cd..61aab84 100644
--- a/src/ssdd/ssdd.c
+++ b/src/ssdd/ssdd.c
@@ -312,9 +312,23 @@ static int forktests(int testid)
 		got_sigchld = 0;
 	}
 
-	/* There is no need for the tracer to kill the tracee. It will
-	 * automatically exit when its owner, ie, us, exits.
+	/* The tracee can receive SIGTRAP(dump) without detaching.
 	 */
+	pstatus = ptrace(PTRACE_DETACH, child, NULL, NULL);
+	if (pstatus == ~0l) {
+		printf("forktest#%d/%d: EXITING, ERROR: "
+		       "detach failed.  errno %d\n",
+		       testid, getpid(), errno);
+		exit(1);
+	}
+	pstatus = kill(child, SIGKILL);
+	if (pstatus != 0) {
+		printf("forktest#%d/%d: EXITING, ERROR: "
+		       "kill failed.  errno %d\n",
+                       testid, getpid(), errno);
+		exit(1);
+	}
+
 	if (!quiet)
 		printf("forktest#%d/%d: EXITING, no error\n", testid, parent);
 	exit(0);
-- 
2.52.0


             reply	other threads:[~2026-01-16  8:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-16  8:37 Attila Fazekas [this message]
2026-01-16 15:32 ` [PATCH] [ssdd] add ptrace tierdown for the tests Derek Barbosa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260116083736.27032-1-afazekas@redhat.com \
    --to=afazekas@redhat.com \
    --cc=debarbos@redhat.com \
    --cc=jkacur@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=williams@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox