From cd91c17db6e8d5a8aabf5a7533d945925babe0e6 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 9 Aug 2019 12:25:57 -0400 Subject: [PATCH] Fix: consumer: assert that stream chunk != NULL (not channel) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This assert sometimes triggers in tests/regression/tools/crash/test_crash: test_shm_path_per_pid_sigint because the destroy is performed when there is still unflushed data in the buffers. The destroy performs a chunk close on the consumer daemon, which effectively sets the channel chunk to NULL, while there are still references to the chunk in the streams (which are still active). Change the assertion in the stream read to validate that stream chunk != NULL instead. Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- src/common/consumer/consumer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/common/consumer/consumer.c b/src/common/consumer/consumer.c index 914eda8c5..8483146c6 100644 --- a/src/common/consumer/consumer.c +++ b/src/common/consumer/consumer.c @@ -1727,9 +1727,8 @@ ssize_t lttng_consumer_on_read_subbuffer_mmap( /* RCU lock for the relayd pointer */ rcu_read_lock(); - assert(stream->net_seq_idx != (uint64_t) -1ULL || - stream->chan->trace_chunk); + stream->trace_chunk); /* Flag that the current stream if set for network streaming. */ if (stream->net_seq_idx != (uint64_t) -1ULL) { -- 2.34.1