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 DC3FD45CB5; Fri, 8 Nov 2024 14:08:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AE11243348; Fri, 8 Nov 2024 14:08:36 +0100 (CET) Received: from fhigh-b5-smtp.messagingengine.com (fhigh-b5-smtp.messagingengine.com [202.12.124.156]) by mails.dpdk.org (Postfix) with ESMTP id 0249940677 for ; Fri, 8 Nov 2024 14:08:34 +0100 (CET) Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.stl.internal (Postfix) with ESMTP id 27EE72540119; Fri, 8 Nov 2024 08:08:34 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Fri, 08 Nov 2024 08:08:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to; s=fm3; t=1731071314; x=1731157714; bh=MvlQMaGa9q2AOJAM7kWNC /6u6/OYUiCSOnTl4OrdoKc=; b=hERidIHUKo0KSHPkGipa2Pm0fQLLc12YXy3AI 8em1RwafYvSQqgfAOFrmsaLw3kqTXKKCmc44OvVFEisnTQFtvxAmt/wD+62jYDjL 32I9b9H/kPf5U+bylzubOcQL1/PusIn8DQzaQTTsdp4dN98XMcbmglvq4oPaiKIa pLrrttXhlW2j8aMk2g/ThB2CoGiSDiaRefHkQSMg6BBvosge/ZeATrODOHvvRitY aOwZ2TR1f1ealQVNqL/8XlGAWcL84Q+SAaXW3772qlVrLWJvNW1q84WUj2O20HEA H6jqEUHmpKZN7pX2PORRcfdeRkyEXpDz0R1GxUTMPszyXC11w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1731071314; x=1731157714; bh=MvlQMaGa9q2AOJAM7kWNC/6u6/OYUiCSOnT l4OrdoKc=; b=RKlnWoOb+L0yAWBqi3ozVYzD9En9ZwbmzNXa0HpoqXUtB+JltA6 sHYODJhKfD8+/xJuarcR0L8cz+BQQ1c1O2fma5NQqljT+7s8BTucUNHZI+76nS3W SBTOnJmrg6n+mZx1GEATyJoxV7TaVpSO3K6dZOg2W1RR6PZs6EnBcA1WMEA718Va l/KpBk5i2Gd3Ixyi9CEk4S/Kx88vzkUZZq3FJ3yeK0/yUBVG6YLO0GLAHN3YeSJ9 JY7IYwgOkJdnMwm9Er2Vn94BAq3WZUfn8EIrI5QV+tFGv/wc4m7TAPaCbXeh0a7N KCq2etBwHdZ9y0GdX8wzJybEr9zVQxdrEow== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrtdeigdeghecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhr ohhmpefvhhhomhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonh drnhgvtheqnecuggftrfgrthhtvghrnhepveevfeevieeihfetudekgeekleeigeffueek veduteeuffeiudevteeiudekfeelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvthdpnhgspghr tghpthhtohepkedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepuggvvhesughpug hkrdhorhhgpdhrtghpthhtohepuggrvhhiugdrmhgrrhgthhgrnhgusehrvgguhhgrthdr tghomhdprhgtphhtthhopehmrghtthhirghsrdhrohhnnhgslhhomhesvghrihgtshhsoh hnrdgtohhmpdhrtghpthhtoheprhhorhgvthiilhgrsehlihhnuhigrdhmihgtrhhoshho fhhtrdgtohhmpdhrtghpthhtohepshhtvghphhgvnhesnhgvthifohhrkhhplhhumhgsvg hrrdhorhhgpdhrtghpthhtohepmhgssehsmhgrrhhtshhhrghrvghshihsthgvmhhsrdgt ohhmpdhrtghpthhtohepfhgvnhhgtghhvghnghifvghnsehhuhgrfigvihdrtghomhdprh gtphhtthhopehkohhnshhtrghnthhinhdrrghnrghnhigvvheshhhurgifvghirdgtohhm X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 8 Nov 2024 08:08:31 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: David Marchand , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= , Tyler Retzlaff , Stephen Hemminger , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Chengwen Feng , Konstantin Ananyev Subject: [PATCH] eal: fix cleanup on Windows Date: Fri, 8 Nov 2024 14:08:21 +0100 Message-ID: <20241108130822.4073057-1-thomas@monjalon.net> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 The memory allocated with _aligned_malloc() must be released with _aligned_free() on Windows. The POSIX free() was called in eal_lcore_var_cleanup(), called in rte_eal_cleanup(), and triggered a heap corruption: exit status 3221226356 or signal 3221226228 SIGinvalid with MALLOC_PERTURB_=86 Fixes: 5bce9bed67ad ("eal: add static per-lcore memory allocation facility") Reported-by: David Marchand Signed-off-by: Thomas Monjalon --- lib/eal/common/eal_common_lcore_var.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/eal/common/eal_common_lcore_var.c b/lib/eal/common/eal_common_lcore_var.c index 0e9e8e4804..a1b2458839 100644 --- a/lib/eal/common/eal_common_lcore_var.c +++ b/lib/eal/common/eal_common_lcore_var.c @@ -54,7 +54,6 @@ lcore_var_alloc(size_t size, size_t align) current_buffer = _aligned_malloc(alloc_size, RTE_CACHE_LINE_SIZE); #else current_buffer = aligned_alloc(RTE_CACHE_LINE_SIZE, alloc_size); - #endif RTE_VERIFY(current_buffer != NULL); @@ -108,7 +107,11 @@ eal_lcore_var_cleanup(void) while (current_buffer != NULL) { struct lcore_var_buffer *prev = current_buffer->prev; +#ifdef RTE_EXEC_ENV_WINDOWS + _aligned_free(current_buffer); +#else free(current_buffer); +#endif current_buffer = prev; } -- 2.46.0