From: Jérémie Galarneau Date: Wed, 14 Nov 2018 21:00:15 +0000 (-0500) Subject: Fix: session_list lock must be held to launch a rotation X-Git-Tag: v2.11.0-rc2~182 X-Git-Url: http://git.lttng.org./?a=commitdiff_plain;h=c1e4c65b588726a171c899045b4c9ae343b96318;p=lttng-tools.git Fix: session_list lock must be held to launch a rotation The timer.h functions are documented as needing the session_list lock to be held. Since timers are setup during the launch of a rotation, the session_list lock must be taken while a job is executed by the rotation thread. Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/rotation-thread.c b/src/bin/lttng-sessiond/rotation-thread.c index 25dbf76a9..3256a1e9b 100644 --- a/src/bin/lttng-sessiond/rotation-thread.c +++ b/src/bin/lttng-sessiond/rotation-thread.c @@ -642,7 +642,7 @@ end: return ret; } -/* Call with the session lock held. */ +/* Call with the session and session_list locks held. */ static int launch_session_rotation(struct ltt_session *session) { @@ -736,10 +736,9 @@ int handle_job_queue(struct rotation_thread_handle *handle, } session_lock(session); - session_unlock_list(); - ret = run_job(job, session, handle->notification_thread_handle); session_unlock(session); + session_unlock_list(); free(job); if (ret) { goto end;