X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;ds=sidebyside;f=src%2Fcommon%2Fconsumer-stream.c;h=b5ab6c6bee2dc38ef615ff84f87129354abf86a2;hb=26fe59386444e0c932b5adcd5f9d6f9f114dd1e2;hp=24f1b8a42d14c580c013f3f38bac9b9576f3c89a;hpb=51230d709a394904ee9c449c26d645e737c4af94;p=lttng-tools.git diff --git a/src/common/consumer-stream.c b/src/common/consumer-stream.c index 24f1b8a42..b5ab6c6be 100644 --- a/src/common/consumer-stream.c +++ b/src/common/consumer-stream.c @@ -177,9 +177,15 @@ void consumer_stream_delete(struct lttng_consumer_stream *stream, rcu_read_unlock(); - /* Decrement the stream count of the global consumer data. */ - assert(consumer_data.stream_count > 0); - consumer_data.stream_count--; + /* + * For a *non* monitored stream, we MUST NOT decrement or else the data + * thread will use the wrong value or stream for its local stream set. + */ + if (stream->chan->monitor) { + /* Decrement the stream count of the global consumer data. */ + assert(consumer_data.stream_count > 0); + consumer_data.stream_count--; + } } /*