From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier Matz Subject: Re: [PATCH v3 1/3] mempool: fix segfault when shared mempool handler not linked Date: Fri, 31 Mar 2017 15:44:31 +0200 Message-ID: <20170331154431.61fb0793@platinum> References: <11490938158-936-1-git-send-email-shreyansh.jain@nxp.com> <1490938537-1177-1-git-send-email-shreyansh.jain@nxp.com> <3b7b65f5-aa8b-fa4a-de8e-8458ec78ce87@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: , , , To: Shreyansh Jain Return-path: Received: from mail-wr0-f175.google.com (mail-wr0-f175.google.com [209.85.128.175]) by dpdk.org (Postfix) with ESMTP id EB5FC9E3 for ; Fri, 31 Mar 2017 15:44:34 +0200 (CEST) Received: by mail-wr0-f175.google.com with SMTP id w43so106640626wrb.0 for ; Fri, 31 Mar 2017 06:44:34 -0700 (PDT) In-Reply-To: <3b7b65f5-aa8b-fa4a-de8e-8458ec78ce87@nxp.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Shreyansh, On Fri, 31 Mar 2017 11:11:19 +0530, Shreyansh Jain wrote: > On Friday 31 March 2017 11:05 AM, Shreyansh Jain wrote: > > Fixes: 449c49b93a6b ("mempool: support handler operations") > > > > In case the stack or ring mempool handler are compiled as shared > > library and not linked in with test binary, segfault is reported. > > This is because return value of rte_mempool_set_ops_byname is not > > being checked in rte_mempool_ops_alloc. > > > > This patch handles error returned from rte_mempool_set_ops_byname > > when a mempool is not found. > > > > Signed-off-by: Shreyansh Jain > > --- > > $ devtools/check-git-log.sh > Is it candidate for Cc: stable@dpdk.org backport? > mempool: fix segfault when shared mempool handler not linked > > I am not sure this needs to be in stable. Previous versions never had > an external mempool handler and ring/stack are statically linked in > always. > Though, if a new handler is added (out of tree) over 16.11, and somehow > and application requests for it without linking the library, this > segfault would occur. > > Any suggestions? > > And just to add to this patch, this segfault is in 'test' binary. It may > not necessarily be the case for other application if they are > handling the error well. > I think it's not needed to backport in stable. As you said, the crash cannot occur because ring handler is always registered (it's part of the same mempool lib). Thanks, Olivier