From c45536e170aa9ba8aeb9ba21da25b7cec73392f6 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Tue, 18 Dec 2012 12:05:24 -0500 Subject: [PATCH] Fix: remove ua_sess->started assert on stop trace It's totally possible that a start failed for a specific app but the started flag is set for the global session making a stop trace possible on a failed started session. The assert is no longer valid since this code flow is possible. Signed-off-by: David Goulet --- src/bin/lttng-sessiond/ust-app.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index a6325746d..e1d0c40e9 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -2393,10 +2393,13 @@ int ust_app_stop_trace(struct ltt_ust_session *usess, struct ust_app *app) /* * If started = 0, it means that stop trace has been called for a session - * that was never started. This is a code flow error and should never - * happen. + * that was never started. It's possible since we can have a fail start + * from either the application manager thread or the command thread. Simply + * indicate that this is a stop error. */ - assert(ua_sess->started == 1); + if (ua_sess->started == 1) { + goto error_rcu_unlock; + } health_code_update(&health_thread_cmd); -- 2.34.1