From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.digiweb.ie (smtp2.digiweb.ie [83.147.160.14]) by dpdk.org (Postfix) with ESMTP id 08B5BB38C for ; Mon, 8 Sep 2014 14:48:56 +0200 (CEST) Received: from statler.emutex.com (unknown [92.51.199.138]) by smtp.digiweb.ie (Postfix) with ESMTP id 7893429027F for ; Mon, 8 Sep 2014 13:53:55 +0100 (IST) Received: from [10.10.64.102] by statler.emutex.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1XQySB-0006rd-2z for dev@dpdk.org; Mon, 08 Sep 2014 13:53:55 +0100 Message-ID: <540DA6DF.9040607@emutex.com> Date: Mon, 08 Sep 2014 09:53:51 -0300 From: Nicolas Pernas Maradei User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: dev@dpdk.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] PMD pcap driver: double free or corruption error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Sep 2014 12:48:56 -0000 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.