From: Mathieu Desnoyers Date: Sun, 23 Aug 2015 05:01:36 +0000 (-0700) Subject: Fix: sessiond consumer thread should register as RCU thread X-Git-Tag: v2.7.0-rc2~100 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ceff174b5c719baf827b15d1f7082ea1a4fc0a9f;p=lttng-tools.git Fix: sessiond consumer thread should register as RCU thread 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 --- diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index faa1b494d..638f9a490 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -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; }