From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] examples/performance-thread: fix segfault with in gcc 5.x Date: Wed, 27 Apr 2016 17:34:25 +0200 Message-ID: <5958766.CmHbfFznCf@xps13> References: <1461685676-7084-1-git-send-email-tomaszx.kulasek@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, ian.betts@intel.com To: Tomasz Kulasek Return-path: Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id AD5E737B0 for ; Wed, 27 Apr 2016 17:34:27 +0200 (CEST) Received: by mail-wm0-f49.google.com with SMTP id e201so44478784wme.0 for ; Wed, 27 Apr 2016 08:34:27 -0700 (PDT) In-Reply-To: <1461685676-7084-1-git-send-email-tomaszx.kulasek@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2016-04-26 17:47, Tomasz Kulasek: > It seems that with gcc >5.x and -O2/-O3 optimization breaks packet grouping > algorithm in l3fwd-thread application causing segfault. > > When last packet pointer "lp" and "pnum->u64" buffer points the same > memory buffer, high optimization can cause unpredictable results. It seems > that assignment of precalculated group sizes may interfere with > initialization of new group size when lp points value inside current group > and didn't should be changed. > > With gcc >5.x and optimization we cannot be sure which assignment will be > done first, so the group size can be counted incorrectly causing segfault. > > This patch eliminates intersection of assignment of initial group size > (lp[0] = 1) and precalculated group sizes when gptbl[v].idx < 4. > > Fixes: d48415e1fee3 ("examples/performance-thread: add l3fwd-thread app") > > Signed-off-by: Tomasz Kulasek Same patch as af1694d94 (for original l3fwd). Applied, thanks