DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Reshma Pattan <reshma.pattan@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v2] pcap: fix segfault in pcap pmd
Date: Mon, 13 Jun 2016 12:07:54 +0100	[thread overview]
Message-ID: <20160613110754.GG13464@bricha3-MOBL3> (raw)
In-Reply-To: <1464350780-724-1-git-send-email-reshma.pattan@intel.com>

On Fri, May 27, 2016 at 01:06:20PM +0100, Reshma Pattan wrote:
> Testpmd application will crash in fclose() upon quit after running
> the below command.
> 
> "sudo gdb --args ./x86_64-native-linuxapp-gcc/app/testpmd -c 0xf0 -n 4
>           --vdev 'eth_pcap0,tx_iface=enp1s0f1,rx_pcap=/tmp/test.pcap' --
>           --port-topology=chained -i"
> 
> The reason is, pcap vdev creation with tx stream type as "iface"
> as in above command don't need member ''dumpers'' of
> "struct tx_pcaps", hence will not have memory allocated.
> But contains a garbage values, as local object of struct tx_pcaps
> is not initialized to 0 inside rte_pmd_pcap_dev_init().
> So calling pcap_dump_close() on dumper as part of eth_dev_stop()
> is causing segfault in fclose().
> 
> Fix is to initialize local object of struct tx_pcaps to 0.
> Also initialize local object of struct rx_pcaps to 0.
> 
> So during eth_dev_stop(), pcap_dump_close() will not be called if dumper
> is NULL.
> 
> Fixes:4c173302("pcap: add new driver")
> 
> Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
> v2:
> Fixed typos in commit message.
> Fixed commit message line length to 75.
> Fixed subject line of the patch.

The subject line is still not the best, since the prefix is "pcap" having the
subject also finish with "in pcap pmd" is superfluous. I've fixed the title
to "pcap: fix segfault on close" on apply.

> ---
>  drivers/net/pcap/rte_eth_pcap.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
Applied to dpdk_next_net/rel_16_07

/Bruce

      reply	other threads:[~2016-06-13 11:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-26 13:35 [dpdk-dev] [PATCH] drivers/net/pcap: " Reshma Pattan
2016-05-26 17:57 ` Ferruh Yigit
2016-05-27 12:06 ` [dpdk-dev] [PATCH v2] pcap: " Reshma Pattan
2016-06-13 11:07   ` Bruce Richardson [this message]

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=20160613110754.GG13464@bricha3-MOBL3 \
    --to=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=reshma.pattan@intel.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;
as well as URLs for NNTP newsgroup(s).