From b318c0ee9896652084d437b6c1584d7f2e49c911 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sat, 22 Aug 2015 22:01:36 -0700 Subject: [PATCH] Fix: sessiond consumer thread should register as RCU thread MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index a66645d95..7451b2c96 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -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; } -- 2.34.1