From 7fd975c523ee6e0bb45dcb13b7308b8d9d6406ba Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Thu, 1 Aug 2019 16:37:15 -0400 Subject: [PATCH] Fix: remove assertions of the existence of a trace chunk MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit A session can have no trace chunk on the session daemon and consumer daemon end whenever its ouput is remote (relayd) and doesn't support trace chunks. The assertions removed as part of this patch are overly strict considering that there are valid cases when trace_chunk can be NULL. Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/consumer.c | 4 ---- src/common/consumer/consumer.c | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/bin/lttng-sessiond/consumer.c b/src/bin/lttng-sessiond/consumer.c index 9246dc7ce..9c178f5fa 100644 --- a/src/bin/lttng-sessiond/consumer.c +++ b/src/bin/lttng-sessiond/consumer.c @@ -893,10 +893,6 @@ void consumer_init_ask_channel_comm_msg(struct lttcomm_consumer_msg *msg, msg->u.ask_channel.buffer_credentials.uid = UINT32_MAX; msg->u.ask_channel.buffer_credentials.gid = UINT32_MAX; - if (monitor) { - assert(trace_chunk); - } - if (trace_chunk) { uint64_t chunk_id; enum lttng_trace_chunk_status chunk_status; diff --git a/src/common/consumer/consumer.c b/src/common/consumer/consumer.c index 3896875f5..948a81d80 100644 --- a/src/common/consumer/consumer.c +++ b/src/common/consumer/consumer.c @@ -1726,7 +1726,8 @@ ssize_t lttng_consumer_on_read_subbuffer_mmap( /* RCU lock for the relayd pointer */ rcu_read_lock(); - assert(stream->chan->trace_chunk); + assert(stream->net_seq_idx != (uint64_t) -1ULL || + stream->chan->trace_chunk); /* Flag that the current stream if set for network streaming. */ if (stream->net_seq_idx != (uint64_t) -1ULL) { -- 2.34.1