Fix: consumer: assert that stream chunk != NULL (not channel)
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 9 Aug 2019 16:25:57 +0000 (12:25 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 9 Aug 2019 21:57:02 +0000 (17:57 -0400)
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 <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/consumer/consumer.c

index 914eda8c5a1386f3650d6b47cc499e64986267a5..8483146c65ab6ecf3d1b026d1f33c62be4442c8a 100644 (file)
@@ -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) {
This page took 0.026513 seconds and 4 git commands to generate.