From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id 8DAF5DD2 for ; Wed, 2 May 2018 12:08:43 +0200 (CEST) Received: from lfbn-lil-1-169-73.w90-45.abo.wanadoo.fr ([90.45.25.73] helo=droids-corp.org) by mail.droids-corp.org with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fDogq-0003Ir-Nl; Wed, 02 May 2018 12:08:50 +0200 Received: by droids-corp.org (sSMTP sendmail emulation); Wed, 02 May 2018 12:08:37 +0200 Date: Wed, 2 May 2018 12:08:37 +0200 From: Olivier Matz To: "Tan, Jianfeng" Cc: "Burakov, Anatoly" , Maxime Coquelin , dev@dpdk.org, Thomas Monjalon Message-ID: <20180502100837.zxy2k2x2p5pgczj2@neon> References: <20180403130439.11151-1-olivier.matz@6wind.com> <20180424144651.13145-1-olivier.matz@6wind.com> <4256B2F0-EF9D-4B22-AC1A-D440C002360A@6wind.com> <39d5baf8-2bad-6df8-0419-a06c65d41475@redhat.com> <2d828aa1-482f-7f19-1909-c3ca4599c9b2@intel.com> <5e5611b7-e3dd-e0fa-157f-1749f46198c5@intel.com> <20180502095730.hcdgbqtfxtkfp5vd@neon> <1350d4e4-e4bc-716b-38ea-3e81e8cb09a6@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1350d4e4-e4bc-716b-38ea-3e81e8cb09a6@intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] pthread_barrier_deadlock in -rc1 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: Wed, 02 May 2018 10:08:43 -0000 On Wed, May 02, 2018 at 06:01:20PM +0800, Tan, Jianfeng wrote: > Hi Olivier and Anatoly, > > [...] > > > > > Below patch can fix another strange sigsegv issue in my VM. Please check > > > > if it works for you. I doubt it's use-after-free problem which could > > > > lead to different issues in different env. Please have a try. > > > > > > > > > > > > diff --git a/lib/librte_eal/common/eal_common_thread.c > > > > b/lib/librte_eal/common/eal_common_thread.c > > > > index de69452..d91b67d 100644 > > > > --- a/lib/librte_eal/common/eal_common_thread.c > > > > +++ b/lib/librte_eal/common/eal_common_thread.c > > > > @@ -205,6 +205,7 @@ rte_ctrl_thread_create(pthread_t *thread, const char > > > > *name, > > > > goto fail; > > > > > > > > pthread_barrier_wait(¶ms->configured); > > > > + pthread_barrier_destroy(¶ms->configured); > > > > free(params); > > > Should destroy also be called in fail case? > > Yes, and also pthread_barrier_wait(). > > > > I did a quick test simulating a failure of rte_thread_setname(), and > > without the wait, the barrier in the child thread blocks forever. > > > > v1 has been sent without seeing this email. You are right, I misunderstood > it. Will send a v2 based on this result. > > Thanks, > Jianfeng Thanks. Not sure it should be in the same patch, however there is also a memory leak here: ret = pthread_create(thread, attr, rte_thread_init, (void *)params); if (ret != 0) return ret;