From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1D5C8A04EF for ; Tue, 2 Jun 2020 20:46:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 55E8F1BF87; Tue, 2 Jun 2020 20:46:06 +0200 (CEST) Received: from wh10.alp1.flow.ch (wh10.alp1.flow.ch [185.119.84.194]) by dpdk.org (Postfix) with ESMTP id 0A3831BF67 for ; Tue, 2 Jun 2020 20:46:05 +0200 (CEST) Received: from [::1] (port=49776 helo=wh10.alp1.flow.ch) by wh10.alp1.flow.ch with esmtpa (Exim 4.92) (envelope-from ) id 1jgBvI-006SYr-GZ; Tue, 02 Jun 2020 20:46:04 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 02 Jun 2020 20:46:04 +0200 From: Alex Kiselev To: Stephen Hemminger Cc: users@dpdk.org In-Reply-To: <20200601091729.03ea9e50@hermes.lan> References: <504fcb6e5a12a03035e7b55507e7c279@therouter.net> <20200601091729.03ea9e50@hermes.lan> Message-ID: <19d55c6a68fbfbac84f5241de36d7a88@therouter.net> X-Sender: alex@therouter.net User-Agent: Roundcube Webmail/1.3.8 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - wh10.alp1.flow.ch X-AntiAbuse: Original Domain - dpdk.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - therouter.net X-Get-Message-Sender-Via: wh10.alp1.flow.ch: authenticated_id: alex@therouter.net X-Authenticated-Sender: wh10.alp1.flow.ch: alex@therouter.net X-Source: X-Source-Args: X-Source-Dir: Subject: Re: [dpdk-users] segmention fault while accessing mbuf X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org Sender: "users" On 2020-06-01 18:17, Stephen Hemminger wrote: > On Mon, 01 Jun 2020 15:24:25 +0200 > Alex Kiselev wrote: > >> Hello, >> >> I've got a segmentation fault error in my data plane path. >> I am pretty sure the code where the segfault happened is ok, >> so my guess is that I somehow received a corrupted mbuf. >> How could I troubleshoot this? Is there any way? >> Is it possible that other threads of the application >> corrupted that mbuf? >> >> I would really appriciate any advice. >> Thanks. >> >> DPDK 18.11.3 >> NIC: 82599ES >> >> Code: >> >> nb_rx = rte_eth_rx_burst(port_id, queue_id, pkts_burst, >> MAX_PKT_BURST); >> >> ... >> >> for (i=0; i < vec_size; i++) { >> rte_prefetch0(rte_pktmbuf_mtod(m_v[i], void *)); >> >> for (i=0; i < vec_size; i++) { >> m = m_v[i]; >> eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); >> eth_type = rte_be_to_cpu_16(eth_hdr->ether_type); <--- >> Segmentation fault >> ... >> >> #0 rte_arch_bswap16 (_x=> at address 0x4d80000000053010>) > > Build with as many of the debug options turned on in the DPDK config, > and build with EXTRA_CFLAGS of -g. I usually use this options in some debug environments: CONFIG_RTE_LIBRTE_MEMPOOL_DEBUG=y CONFIG_RTE_MALLOC_DEBUG=y as well as gcc sanitize options and some custom memory sanitize techniques to make sure there is no mempool leaks, use after free or double free. But what was your point? Could you please explain what should I expect from enabling other debug options or what should I pay attention to? Should I take a look the PMD drivers debug options? Unfortunately, there is no way to reproduce the bug. So I need to understand what could cause it to make my search more precise.