Fix ua_chan assert
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 13 Jun 2013 21:07:21 +0000 (17:07 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 14 Jun 2013 13:09:25 +0000 (09:09 -0400)
delete_ust_app() can remove a channel objd from the hash table
concurrently with notify

Fix #560

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/ust-app.c

index 396ca936e004d751633fb6a8fce41cfd9c0b61cd..ee3b3406da781b1d488d17af5218933d2eefd265 100644 (file)
@@ -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;
 
This page took 0.027501 seconds and 4 git commands to generate.