[lttng-dev] [PATCH lttng-tools] Fix: consumerd memory leak when using snapshot sessions

Marian Florea marian.florea at windriver.com
Wed Jun 22 07:55:17 UTC 2016


When starting tracing a snapshot session in an active environment
a metadata channel is created that on destroy is not freed. Because the
metadata channel created is not passed to the metadata thread/is not monitored,
the destruction of this channel can be done by notifying the channel thread.
Sessiond thread inside consumerd when receiving a close_metadata command
will now also notify the channel thread to destroy the metadata channel.

Fixes: #1017

Signed-off-by: Marian Florea <marian.florea at windriver.com>
---
 src/common/ust-consumer/ust-consumer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c
index 01d5ecf..14d3dff 100644
--- a/src/common/ust-consumer/ust-consumer.c
+++ b/src/common/ust-consumer/ust-consumer.c
@@ -1622,6 +1622,8 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
 			ret_code = ret;
 		}
 
+		notify_thread_del_channel(ctx, msg.u.close_metadata.key);
+
 		goto end_msg_sessiond;
 	}
 	case LTTNG_CONSUMER_FLUSH_CHANNEL:
-- 
1.9.1



More information about the lttng-dev mailing list