Skip to content

Commit

Permalink
service: fix crash on exit
Browse files Browse the repository at this point in the history
[ upstream commit 33666b4 ]

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: da23f0a ("service: fix memory leak with new function")

Reported-by: David Marchand <david.marchand@redhat.com>
Reported-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Aaron Conole <aconole@redhat.com>
  • Loading branch information
harry-van-haaren authored and kevintraynor committed May 27, 2020
1 parent 444b643 commit a65c71f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/librte_eal/common/rte_service.c
Expand Up @@ -121,6 +121,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);

Expand Down

0 comments on commit a65c71f

Please sign in to comment.