From: Mathieu Desnoyers Date: Thu, 13 Jun 2013 21:07:21 +0000 (-0400) Subject: Fix ua_chan assert X-Git-Tag: v2.2.0-rc3~29 X-Git-Url: http://git.lttng.org/?a=commitdiff_plain;h=4950b860f76b938833046793e7221c11e8e89682;hp=cfa9a5a2b4a96e0d6a9eeddd2622a6d7c173b7ac;p=lttng-tools.git Fix ua_chan assert delete_ust_app() can remove a channel objd from the hash table concurrently with notify Fix #560 Signed-off-by: Mathieu Desnoyers Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 396ca936e..ee3b3406d 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -4475,9 +4475,14 @@ static int reply_ust_register_channel(int sock, int sobjd, int cobjd, goto error_rcu_unlock; } - /* Lookup channel by UST object descriptor. Should always be found. */ + /* Lookup channel by UST object descriptor. */ ua_chan = find_channel_by_objd(app, cobjd); - assert(ua_chan); + if (!ua_chan) { + DBG("Application channel is being teardown. Abort event notify"); + ret = 0; + goto error_rcu_unlock; + } + assert(ua_chan->session); ua_sess = ua_chan->session; @@ -4581,9 +4586,14 @@ static int add_event_ust_registry(int sock, int sobjd, int cobjd, char *name, goto error_rcu_unlock; } - /* Lookup channel by UST object descriptor. Should always be found. */ + /* Lookup channel by UST object descriptor. */ ua_chan = find_channel_by_objd(app, cobjd); - assert(ua_chan); + if (!ua_chan) { + DBG("Application channel is being teardown. Abort event notify"); + ret = 0; + goto error_rcu_unlock; + } + assert(ua_chan->session); ua_sess = ua_chan->session;