From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 68990A04B5; Mon, 11 Jan 2021 14:17:22 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E3F43140CC1; Mon, 11 Jan 2021 14:17:21 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id C470B140CB5 for ; Mon, 11 Jan 2021 14:17:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610371040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XPZymeU93Zve5oaZPrG9IG5ZttyBWeiej+O4fXtO9zU=; b=IKyW54ZC9yn5rGzOXAlNmlMjTnY7KwjAKLd6T+v8xRNGPgxxmzDfNX6lVz3IaDtvd3VpgZ wOL8hKhvdQUzP956PwK93iFVSO7MId/NXgrgSE4ymy4DV4zmFKiO54vpDpSLaeZllatGTV VpdgROQ08UF1Hql7Iggi3Qh8FyQFjr0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-287-91zbZy7HNCeRFGzvGOSlcg-1; Mon, 11 Jan 2021 08:17:16 -0500 X-MC-Unique: 91zbZy7HNCeRFGzvGOSlcg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6978D100C607; Mon, 11 Jan 2021 13:17:15 +0000 (UTC) Received: from dhcp-25.97.bos.redhat.com (ovpn-113-60.rdu2.redhat.com [10.10.113.60]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 95B4E19714; Mon, 11 Jan 2021 13:17:11 +0000 (UTC) From: Aaron Conole To: David Marchand Cc: dev@dpdk.org, Michael Santana , Olivier Matz References: <20210111100146.3485-1-david.marchand@redhat.com> Date: Mon, 11 Jan 2021 08:17:10 -0500 In-Reply-To: <20210111100146.3485-1-david.marchand@redhat.com> (David Marchand's message of "Mon, 11 Jan 2021 11:01:46 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=aconole@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Subject: Re: [dpdk-dev] [RFC PATCH] ci: catch coredumps X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" David Marchand writes: > Parts of the unit tests code rely on forked/secondary processes > (expectedly) failing. > A crash in those situations could be missed so add a check on coredumps > presence after unit tests have run. > > In some situations (like explicitly call rte_panic), coredump generation > must be disabled to avoid false positives. > > Signed-off-by: David Marchand > --- > Sending as a RFC, as this is a "nice to have" patch I had in store for > some time, but I did not see the actual need so far. > > We could attach the coredumps in GHA result, but it would be hardly usable > without attaching all generated binaries... > Opinions? I think it's a good start. We may not need to attach the binaries at all - if we have access to gdb, we can run a script to just run simple commands like 'thread apply all bt' and maybe some info commands. That can all be stuffed into the logs. Usually a source level backtrace is enough to work through what happened. > --- > .ci/linux-build.sh | 8 ++++++++ > app/test/test_debug.c | 11 +++++++++-- > app/test/test_mbuf.c | 9 ++++++++- > 3 files changed, 25 insertions(+), 3 deletions(-) > > diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh > index d2c821adf3..d00a5804b4 100755 > --- a/.ci/linux-build.sh > +++ b/.ci/linux-build.sh > @@ -57,7 +57,11 @@ meson build --werror $OPTS > ninja -C build > > if [ "$AARCH64" != "true" ]; then > + ulimit -c unlimited > + sudo sysctl -w kernel.core_pattern=/tmp/dpdk-core.%e.%p > + > devtools/test-null.sh > + ! ls /tmp/dpdk-core.*.* 2>/dev/null > fi > > if [ "$ABI_CHECKS" = "true" ]; then > @@ -102,5 +106,9 @@ if [ "$ABI_CHECKS" = "true" ]; then > fi > > if [ "$RUN_TESTS" = "true" ]; then > + ulimit -c unlimited > + sudo sysctl -w kernel.core_pattern=/tmp/dpdk-core.%e.%p > + > sudo meson test -C build --suite fast-tests -t 3 > + ! ls /tmp/dpdk-core.*.* 2>/dev/null > fi > diff --git a/app/test/test_debug.c b/app/test/test_debug.c > index 834a7386f5..23b24db177 100644 > --- a/app/test/test_debug.c > +++ b/app/test/test_debug.c > @@ -4,6 +4,8 @@ > > #include > #include > +#include > +#include > #include > #include > > @@ -28,9 +30,14 @@ test_panic(void) > > pid = fork(); > > - if (pid == 0) > + if (pid == 0) { > + struct rlimit rl; > + > + /* No need to generate a coredump when panicking. */ > + rl.rlim_cur = rl.rlim_max = 0; > + setrlimit(RLIMIT_CORE, &rl); > rte_panic("Test Debug\n"); > - else if (pid < 0){ > + } else if (pid < 0) { > printf("Fork Failed\n"); > return -1; > } > diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c > index a40f7d4883..47a7b197d7 100644 > --- a/app/test/test_mbuf.c > +++ b/app/test/test_mbuf.c > @@ -1174,6 +1174,8 @@ test_refcnt_mbuf(void) > } > > #include > +#include > +#include > #include > > /* use fork() to test mbuf errors panic */ > @@ -1186,9 +1188,14 @@ verify_mbuf_check_panics(struct rte_mbuf *buf) > pid = fork(); > > if (pid == 0) { > + struct rlimit rl; > + > + /* No need to generate a coredump when panicking. */ > + rl.rlim_cur = rl.rlim_max = 0; > + setrlimit(RLIMIT_CORE, &rl); > rte_mbuf_sanity_check(buf, 1); /* should panic */ > exit(0); /* return normally if it doesn't panic */ > - } else if (pid < 0){ > + } else if (pid < 0) { > printf("Fork Failed\n"); > return -1; > }