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>
Tue, 8 Sep 2015 13:10:59 +0000 (09:10 -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 faa1b494df034bf8dfd5a7a850018be8a21a2705..638f9a49020d847f536e2423679923c230290739 100644 (file)
@@ -1212,6 +1212,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();
@@ -1510,6 +1513,9 @@ error_poll:
        health_unregister(health_sessiond);
        DBG("consumer thread cleanup completed");
 
+       rcu_thread_offline();
+       rcu_unregister_thread();
+
        return NULL;
 }
 
This page took 0.0272 seconds and 4 git commands to generate.