From: Jérémie Galarneau Date: Thu, 1 Aug 2019 20:37:15 +0000 (-0400) Subject: Fix: remove assertions of the existence of a trace chunk X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=7fd975c523ee6e0bb45dcb13b7308b8d9d6406ba Fix: remove assertions of the existence of a trace chunk 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 --- 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) {