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 70C48E6D for ; Mon, 11 Apr 2016 11:33:38 +0200 (CEST) Received: from glumotte.dev.6wind.com (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id C050524586 for ; Mon, 11 Apr 2016 11:32:55 +0200 (CEST) From: Olivier Matz To: dev@dpdk.org Date: Mon, 11 Apr 2016 11:33:23 +0200 Message-Id: <1460367203-30925-1-git-send-email-olivier.matz@6wind.com> X-Mailer: git-send-email 2.1.4 Subject: [dpdk-dev] [PATCH] autotests: fix mempool element size in func_reentrancy 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: Mon, 11 Apr 2016 09:33:38 -0000 The mempool element size is set to 0, but 4 bytes are written in my_obj_init(): uint32_t *objnum = obj; memset(obj, 0, mp->elt_size); *objnum = i; Change the MEMPOOL_ELT_SIZE constant to sizeof(uint32_t). This fixes memory corruptions since we were writting outside of the object boundaries. Fixes: 104a92bd026 ("app: add reentrancy tests") Signed-off-by: Olivier Matz --- app/test/test_func_reentrancy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test/test_func_reentrancy.c b/app/test/test_func_reentrancy.c index 300a3bc..e5b2821 100644 --- a/app/test/test_func_reentrancy.c +++ b/app/test/test_func_reentrancy.c @@ -78,7 +78,7 @@ typedef void (*case_clean_t)(unsigned lcore_id); #define MAX_ITER_TIMES (16) #define MAX_LPM_ITER_TIMES (8) -#define MEMPOOL_ELT_SIZE (0) +#define MEMPOOL_ELT_SIZE (sizeof(uint32)) #define MEMPOOL_SIZE (4) #define MAX_LCORES RTE_MAX_MEMZONE / (MAX_ITER_TIMES * 4U) -- 2.1.4