DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nicolas Pernas Maradei <nico@emutex.com>
To: dev@dpdk.org
Subject: [dpdk-dev] PMD pcap driver: double free or corruption error
Date: Mon, 08 Sep 2014 09:53:51 -0300	[thread overview]
Message-ID: <540DA6DF.9040607@emutex.com> (raw)

Hi,

I've been using the PMD pcap driver for a while now. It's very handy for 
testing and running DPDK on systems with no Intel NICs (like my laptop). 
Unfortunately I've found a small issue that's been bothering me a lot. 
It turns out that the PMD pcap driver opens the pcaps/interfaces only at 
init time and close them everytime the port is closed. So if you close 
the port two times in a row you'll get a "double free or corruption" 
error being thrown by libpcap.

You can easily reproduce the error with testpmd doing the following:

sudo  ./x86_64-native-linuxapp-gcc/app/testpmd -c f -n 3 
--vdev=eth_pcap0,rx_pcap=../netronome/client/examples/file.pcap,tx_pcap=out.pcap 
-- --port-topology=chained -i

.....

init (0) eth_pcap0
PMD: Initializing pmd_pcap for eth_pcap0
PMD: Creating pcap-backed ethdev on numa socket 0
EAL: Core 3 is ready (tid=e99fc700)
EAL: Core 2 is ready (tid=ea1fd700)
EAL: Core 1 is ready (tid=ea9fe700)
Interactive-mode selected
Configuring Port 0 (socket 0)
Port 0: 00:00:00:01:02:03
Checking link statuses...
Port 0 Link Up - speed 10000 Mbps - full-duplex
Done
testpmd> port stop all
Stopping ports...
Checking link statuses...
Port 0 Link Down
Done
testpmd> port start all
Port 0: 00:00:00:01:02:03
Checking link statuses...
Port 0 Link Up - speed 10000 Mbps - full-duplex
Done
testpmd> port stop all
Stopping ports...
*** Error in `./x86_64-native-linuxapp-gcc/app/testpmd': double free or 
corruption (!prev): 0x00000000015a9020 ***

I have a fix for it that I'm currently testing and will be submitting 
later on this week. Basically I'm storing the config the driver is 
started with (type of streams and pcap/interface names) and re-opening 
them everytime the user starts the port.

Thanks,
Nico.

-- 
Nicolás Pernas Maradei
Software Engineer
Emutex Ltd.
Callan Centre, National Technology Park, Limerick, Ireland
Phone: +353 (0)61 514496 Ext #872, Mobile: +353 (0)86 7907731
Web: www.emutex.com, Email: nico@emutex.com

This email may contain information, which is confidential and/or privileged. The information is intended solely for the use of the individual or entity named above. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents is prohibited. If you have received this electronic transmission in error, please notify the sender by telephone or return email and delete the material from your computer. Emutex Ltd is registered in Ireland, No 256238, at Callan Centre, National Technology Park, Limerick, Ireland.

                 reply	other threads:[~2014-09-08 12:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=540DA6DF.9040607@emutex.com \
    --to=nico@emutex.com \
    --cc=dev@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).