From: David Goulet Date: Tue, 14 Feb 2012 20:35:31 +0000 (-0500) Subject: Fix missing session locks X-Git-Tag: v2.0-pre23~8 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=4ee14516054068e38d7dc5dbeaccd39151ca2d06;p=lttng-tools.git Fix missing session locks When an application registers, an update is triggered to create pending events of the global event registry. This process MUST held the session lock and the session list locks since it's iterating over all sessions. Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 8e794bdf4..6c4b8ec5c 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -769,12 +769,18 @@ static void update_ust_app(int app_sock) { struct ltt_session *sess, *stmp; + session_lock_list(); + /* For all tracing session(s) */ cds_list_for_each_entry_safe(sess, stmp, &session_list_ptr->head, list) { + session_lock(sess); if (sess->ust_session) { ust_app_global_update(sess->ust_session, app_sock); } + session_unlock(sess); } + + session_unlock_list(); } /*