[dpdk-stable] patch 'service: fix crash on exit' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 14:53:22 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/21/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From c20055f4716d024b388c5914272192c271747e31 Mon Sep 17 00:00:00 2001
From: Harry van Haaren <harry.van.haaren at intel.com>
Date: Wed, 11 Mar 2020 14:39:27 +0000
Subject: [PATCH] service: fix crash on exit

[ upstream commit 33666b448f15687ceaf61eac405d945391fe7066 ]

This commit releases all service cores from their role,
returning them to ROLE_RTE on rte_service_finalize().

This fixes an issue relating to the service cores causing
a race-condition on rte_eal_cleanup(), where the service core
could still be executing while the main thread has already
free-d the service memory, leading to a segfault.

Fixes: da23f0aa87d8 ("service: fix memory leak with new function")

Reported-by: David Marchand <david.marchand at redhat.com>
Reported-by: Aaron Conole <aconole at redhat.com>
Signed-off-by: David Marchand <david.marchand at redhat.com>
Signed-off-by: Harry van Haaren <harry.van.haaren at intel.com>
Acked-by: Aaron Conole <aconole at redhat.com>
---
 lib/librte_eal/common/rte_service.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c
index 7e537b8cd2..b0b78baabd 100644
--- a/lib/librte_eal/common/rte_service.c
+++ b/lib/librte_eal/common/rte_service.c
@@ -122,6 +122,9 @@ rte_service_finalize(void)
 	if (!rte_service_library_initialized)
 		return;
 
+	rte_service_lcore_reset_all();
+	rte_eal_mp_wait_lcore();
+
 	rte_free(rte_services);
 	rte_free(lcore_states);
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 13:56:19.311858395 +0100
+++ 0012-service-fix-crash-on-exit.patch	2020-05-19 13:56:18.175501026 +0100
@@ -1,8 +1,10 @@
-From 33666b448f15687ceaf61eac405d945391fe7066 Mon Sep 17 00:00:00 2001
+From c20055f4716d024b388c5914272192c271747e31 Mon Sep 17 00:00:00 2001
 From: Harry van Haaren <harry.van.haaren at intel.com>
 Date: Wed, 11 Mar 2020 14:39:27 +0000
 Subject: [PATCH] service: fix crash on exit
 
+[ upstream commit 33666b448f15687ceaf61eac405d945391fe7066 ]
+
 This commit releases all service cores from their role,
 returning them to ROLE_RTE on rte_service_finalize().
 
@@ -12,7 +14,6 @@
 free-d the service memory, leading to a segfault.
 
 Fixes: da23f0aa87d8 ("service: fix memory leak with new function")
-Cc: stable at dpdk.org
 
 Reported-by: David Marchand <david.marchand at redhat.com>
 Reported-by: Aaron Conole <aconole at redhat.com>


More information about the stable mailing list