From 77cdfc81210ea4cfca740335af03be732e652e6d Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Thu, 30 Jul 2015 12:46:56 -0400 Subject: [PATCH] Fix: Initialize global agent_apps_ht_by_sock on session daemon launch MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reported-by: Julien Desfossez Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/agent.c | 3 +++ src/bin/lttng-sessiond/main.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/bin/lttng-sessiond/agent.c b/src/bin/lttng-sessiond/agent.c index 1c46bec4e..e89adbb10 100644 --- a/src/bin/lttng-sessiond/agent.c +++ b/src/bin/lttng-sessiond/agent.c @@ -1009,6 +1009,9 @@ void agent_app_ht_clean(void) struct lttng_ht_node_ulong *node; struct lttng_ht_iter iter; + if (!agent_apps_ht_by_sock) { + return; + } rcu_read_lock(); cds_lfht_for_each_entry(agent_apps_ht_by_sock->ht, &iter.iter, node, node) { struct agent_app *app; diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 91dd047e7..2582e886d 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -5298,6 +5298,9 @@ int main(int argc, char **argv) void *status; const char *home_path, *env_app_timeout; + /* Initialize agent apps ht global variable */ + agent_apps_ht_by_sock = NULL; + init_kernel_workarounds(); rcu_register_thread(); -- 2.34.1