Tests: Fix possible segfault in health check thread exit test
authorChristian Babeux <christian.babeux@efficios.com>
Wed, 22 May 2013 20:29:33 +0000 (16:29 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Wed, 22 May 2013 20:58:00 +0000 (16:58 -0400)
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 <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
tests/regression/tools/health/health_exit.c

index 8e414053e9d961867acc2b075ec8f1df6342af9f..8d1d05c5311dfa069bc66557a0448bb31ef10d72 100644 (file)
@@ -18,6 +18,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <pthread.h>
+#include <urcu.h>
 
 /*
  * 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);
        }
 
This page took 0.025774 seconds and 4 git commands to generate.