DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pavel Ivashchenko <pivashchenko@nfware.com>
To: olivier.matz@6wind.com, konstantin.ananyev@intel.com,
	mb@smartsharesystems.com, ajit.khaparde@broadcom.com
Cc: dev@dpdk.org, Pavel Ivashchenko <pivashchenko@nfware.com>,
	stable@dpdk.org
Subject: [PATCH] app: fix mbuf_autotest in case of defined RTE_LIBRTE_MBUF_DEBUG
Date: Mon, 13 Mar 2023 19:56:05 +0300	[thread overview]
Message-ID: <20230313165605.12325-1-pivashchenko@nfware.com> (raw)

How to reproduce:

1. Define RTE_LIBRTE_MBUF_DEBUG
2. MALLOC_PERTURB_=178 DPDK_TEST=mbuf_autotest gdb --args obj-x86_64-linux-gnu/app/test/dpdk-test --file-prefix=mbuf_autotest

   PANIC in rte_mbuf_sanity_check():
   bad pkt_len

   ...
   #6  0x00007ffff7d3d4cc in rte_mbuf_sanity_check (m=m@entry=0x17f8c3400, is_header=is_header@entry=1) at ../lib/mbuf/rte_mbuf.c:384
   #7  0x0000555555653d57 in rte_pktmbuf_free (m=0x17f8c3400) at ../lib/mbuf/rte_mbuf.h:1385
   #8  0x000055555565c7a6 in test_nb_segs_and_next_reset () at ../app/test/test_mbuf.c:2752
   #9  test_mbuf () at ../app/test/test_mbuf.c:2967
   ...

   (gdb) frame 6
   #6  0x00007ffff7d3d4cc in rte_mbuf_sanity_check (m=m@entry=0x17f8c3400, is_header=is_header@entry=1) at ../lib/mbuf/rte_mbuf.c:384
   384			rte_panic("%s\n", reason);
   (gdb) p/d m->pkt_len
   $4 = 1500

Fixes: efc6f9104c80 ("mbuf: fix reset on mbuf free")
Cc: stable@dpdk.org

Signed-off-by: Pavel Ivashchenko <pivashchenko@nfware.com>
---
 app/test/test_mbuf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index 6cbb03b0af..d471a23805 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -2744,6 +2744,7 @@ test_nb_segs_and_next_reset(void)
 
 	/* split m0 chain in two, between m1 and m2 */
 	m0->nb_segs = 2;
+	m0->pkt_len -= 500;
 	m1->next = NULL;
 	m2->nb_segs = 1;
 
-- 
2.39.0


             reply	other threads:[~2023-03-13 16:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-13 16:56 Pavel Ivashchenko [this message]
2023-03-15 10:29 ` David Marchand
2023-03-15 16:02   ` Olivier Matz
2023-03-16 19:14 ` [PATCH v2 1/1] test/mbuf: fix mbuf autotest when mbuf debug is enabled Pavel Ivashchenko
2023-03-17  8:02   ` Olivier Matz
2023-03-17  8:09     ` David Marchand

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=20230313165605.12325-1-pivashchenko@nfware.com \
    --to=pivashchenko@nfware.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@intel.com \
    --cc=mb@smartsharesystems.com \
    --cc=olivier.matz@6wind.com \
    --cc=stable@dpdk.org \
    /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;
as well as URLs for NNTP newsgroup(s).