From: Mathieu Desnoyers Date: Fri, 9 Aug 2019 16:25:57 +0000 (-0400) Subject: Fix: consumer: assert that stream chunk != NULL (not channel) X-Git-Tag: v2.12.0-rc1~509 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=948411cd7aa5e2327177c2e4ed8be8dd65c8504c;p=lttng-tools.git Fix: consumer: assert that stream chunk != NULL (not channel) 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 --- 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) {