From: Jérémie Galarneau Date: Thu, 30 Jul 2015 16:46:56 +0000 (-0400) Subject: Fix: Initialize global agent_apps_ht_by_sock on session daemon launch X-Git-Tag: v2.7.0-rc2~167 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=77cdfc81210ea4cfca740335af03be732e652e6d;p=lttng-tools.git Fix: Initialize global agent_apps_ht_by_sock on session daemon launch Reported-by: Julien Desfossez Signed-off-by: Jérémie Galarneau --- 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();