From 7f2a80589c0b04627eaa351a9debff202836f930 Mon Sep 17 00:00:00 2001 From: Christian Babeux Date: Wed, 22 May 2013 16:29:33 -0400 Subject: [PATCH] Tests: Fix possible segfault in health check thread exit test The testpoints in the thread_manage_clients and thread_manage_apps are called after a rcu_register_thread() call. The testpoints were not unregistering their respective thread which could later on cause a segfault when shutting down the session daemon. Signed-off-by: Christian Babeux Signed-off-by: David Goulet --- tests/regression/tools/health/health_exit.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/regression/tools/health/health_exit.c b/tests/regression/tools/health/health_exit.c index 8e414053e..8d1d05c53 100644 --- a/tests/regression/tools/health/health_exit.c +++ b/tests/regression/tools/health/health_exit.c @@ -18,6 +18,7 @@ #include #include #include +#include /* * Check if the specified environment variable is set. @@ -40,6 +41,7 @@ int __testpoint_thread_manage_clients(void) const char *var = "LTTNG_THREAD_MANAGE_CLIENTS_EXIT"; if (check_env_var(var)) { + rcu_unregister_thread(); pthread_exit(NULL); } @@ -62,6 +64,7 @@ int __testpoint_thread_manage_apps(void) const char *var = "LTTNG_THREAD_MANAGE_APPS_EXIT"; if (check_env_var(var)) { + rcu_unregister_thread(); pthread_exit(NULL); } -- 2.34.1