From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7CB1845F26; Mon, 23 Dec 2024 22:10:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1D1794029C; Mon, 23 Dec 2024 22:10:54 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 2677C40263 for ; Mon, 23 Dec 2024 22:10:53 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id 3438B206ADC4; Mon, 23 Dec 2024 13:10:52 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 3438B206ADC4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1734988252; bh=389jISYdOJz8YheC5NAYwQXBKBzaiavIfMyH2opBF/A=; h=From:To:Cc:Subject:Date:From; b=LMlILt0p6vesOhqOYpM+f9cWYO0Lx5oFMbUKwodcGm4yLAIQtvJxHvKXCPUqCTyCI iwFIckj0HD/8cA4VXWeriOsw9c9PvQy+gmNOXDkBn5AVmjJLI7oDiMsvNgzJOwkojs SIEwDMnCLvaQPO1QDF4k1+crL6pQ9g5RvD7h0E24= From: Andre Muezerie To: Vladimir Medvedkin Cc: dev@dpdk.org, Andre Muezerie Subject: [PATCH] app/test: fix stack overflow in fib6_perf_autotest Date: Mon, 23 Dec 2024 13:10:33 -0800 Message-Id: <1734988233-20208-1-git-send-email-andremue@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Test fib6_perf_autotest was hitting a stack overflow on Windows with MSVC. The fix is to move some of the data from the stack to the heap. Signed-off-by: Andre Muezerie --- app/test/test_fib6_perf.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/test/test_fib6_perf.c b/app/test/test_fib6_perf.c index a96a0d6b2c..246bc2d509 100644 --- a/app/test/test_fib6_perf.c +++ b/app/test/test_fib6_perf.c @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -73,8 +74,14 @@ test_fib6_perf(void) uint64_t next_hop_add; int status = 0; int64_t count = 0; - struct rte_ipv6_addr ip_batch[NUM_IPS_ENTRIES]; - uint64_t next_hops[NUM_IPS_ENTRIES]; + + struct rte_ipv6_addr *ip_batch = rte_calloc("ip_batch", + NUM_IPS_ENTRIES, sizeof(struct rte_ipv6_addr), 0); + TEST_FIB_ASSERT(ip_batch != NULL); + + uint64_t *next_hops = rte_calloc("next_hops", + NUM_IPS_ENTRIES, sizeof(uint64_t), 0); + TEST_FIB_ASSERT(next_hops != NULL); conf.type = RTE_FIB6_TRIE; conf.default_nh = 0; @@ -151,6 +158,9 @@ test_fib6_perf(void) rte_fib6_free(fib); + rte_free(next_hops); + rte_free(ip_batch); + return 0; } -- 2.47.0.vfs.0.3