From: Christian Babeux Date: Wed, 22 May 2013 20:29:33 +0000 (-0400) Subject: Tests: Fix possible segfault in health check thread exit test X-Git-Tag: v2.2.0-rc3~51 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=7f2a80589c0b04627eaa351a9debff202836f930;p=lttng-tools.git 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 --- 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); }