From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id C7A271B365 for ; Fri, 22 Dec 2017 10:20:48 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Dec 2017 01:20:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,440,1508828400"; d="scan'208";a="4898595" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.252.17.195]) ([10.252.17.195]) by orsmga006.jf.intel.com with ESMTP; 22 Dec 2017 01:20:45 -0800 To: "Wang, Yipeng1" , "dev@dpdk.org" Cc: "Gobriel, Sameh" References: <5c0a540f8917604a86e18f8da77fa0c2013b7fde.1513865858.git.anatoly.burakov@intel.com> From: "Burakov, Anatoly" Message-ID: <08f1736c-e3ce-1dfd-02a1-032f990472d1@intel.com> Date: Fri, 22 Dec 2017 09:20:44 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] member: fix memory leak on error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Dec 2017 09:20:49 -0000 On 22-Dec-17 12:01 AM, Wang, Yipeng1 wrote: > Thank you Anatoly for finding this issue. In the code I tried to reuse the rte_member_free function to free memory but it may not be executed through. > > Because of this, I may not properly release setsum struct neither. I will post a fix for both soon. > > Thanks Yep, i can see that now. Didn't think to look inside rte_member_free() :/ However, you're creating a race condition there - you're unlocking a tailq, and then locking (and unlocking) it again inside rte_member_free() - it probably needs _thread_unsafe() functions that you can call from behind the lock. -- Thanks, Anatoly