Fix: sessiond consumer thread should register as RCU thread
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sun, 23 Aug 2015 05:01:36 +0000 (22:01 -0700)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 24 Sep 2015 02:04:18 +0000 (22:04 -0400)
Fixes RCU race where objects are accessed by this thread under RCU
read-side lock after free. Since this thread is not a registered RCU
reader, the read-side lock has no effect.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/main.c

index a66645d959fd98f6ee40511fe635d863398f9ebb..7451b2c96ad74ca086780cc50ecbfe766af589bc 100644 (file)
@@ -1134,6 +1134,9 @@ static void *thread_manage_consumer(void *data)
 
        DBG("[thread] Manage consumer started");
 
+       rcu_register_thread();
+       rcu_thread_online();
+
        health_register(health_sessiond, HEALTH_SESSIOND_TYPE_CONSUMER);
 
        health_code_update();
@@ -1432,6 +1435,9 @@ error_poll:
        health_unregister(health_sessiond);
        DBG("consumer thread cleanup completed");
 
+       rcu_thread_offline();
+       rcu_unregister_thread();
+
        return NULL;
 }
 
This page took 0.028747 seconds and 4 git commands to generate.