From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id 6673C691A for ; Tue, 17 May 2016 10:16:36 +0200 (CEST) Received: from [10.16.0.195] (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id A38A323E00; Tue, 17 May 2016 10:14:59 +0200 (CEST) To: "Mrozowicz, SlawomirX" References: <158888A50F43E34AAE179517F56C97455A52C6@IRSMSX103.ger.corp.intel.com> Cc: "dev@dpdk.org" From: Olivier MATZ Message-ID: <573AD357.40602@6wind.com> Date: Tue, 17 May 2016 10:16:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.6.0 MIME-Version: 1.0 In-Reply-To: <158888A50F43E34AAE179517F56C97455A52C6@IRSMSX103.ger.corp.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] test-pmd: Free of address-of expression 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: Tue, 17 May 2016 08:16:36 -0000 Hi, On 05/17/2016 09:55 AM, Mrozowicz, SlawomirX wrote: > Hi, > > Noticed is that in the file: > > app/test-pmd/mempool.c > > using of the function munmap() could cause a problem. > > Coverity static code analyzer provide error (CID 13184) in line 158: > > munmap frees incorrect pointer uv. > > I noticed information on the net: > > https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxbd00/mumap.htm > > “If addr is not the address of a mapping established by a prior call to > mmap(), the behavior is undefined” > > I have analyzed the code and I have done some test with gcc. > > It seems that it is possible to free subrange of the mapping memory. > > In the mempool.c code the address is calculated independently. > > Anyway in my opinion the address variable uv is calculated correctly. > > So we should classify this issue as a False Positive. > > Please accept the conclusion. This file (app/test-pmd/mempool_anon.c) will be removed soon. Please see http://dpdk.org/dev/patchwork/patch/12067/ So I think we can ignore this alert, as the new code does not have the same issue. Regards, Olivier